Removed many global variables from config.default.php to GL Setup, Company Setup...
[fa-stable.git] / includes / ui / ui_input.inc
index e252c8b136165c079853fe5816aed1df221267ac..c1091b3702c63a76df24ae2e5c621167fd64578a 100644 (file)
@@ -37,6 +37,7 @@ function find_submit($prefix, $numeric=true)
     }
     return $numeric ? -1 : null;
 }
+
 //------------------------------------------------------------------------------
 //
 // Helper function for simple db table editor pages
@@ -605,7 +606,7 @@ function link_row_ex($label, $name, $size, $max=null, $title=null, $value=null,
 function date_cells($label, $name, $title = null, $check=null, $inc_days=0, 
        $inc_months=0, $inc_years=0, $params=null, $submit_on_change=false)
 {
-       global $use_date_picker, $path_to_root, $Ajax;
+       global $path_to_root, $Ajax;
 
        if (!isset($_POST[$name]) || $_POST[$name] == "")
        {
@@ -623,9 +624,13 @@ function date_cells($label, $name, $title = null, $check=null, $inc_days=0,
                        $_POST[$name] = $dd;
                }
        }
-       if ($use_date_picker)
+       if (user_use_date_picker())
+       {
+               $calc_image = (file_exists("$path_to_root/themes/".user_theme()."/images/cal.gif")) ? 
+                       "$path_to_root/themes/".user_theme()."/images/cal.gif" : "$path_to_root/themes/default/images/cal.gif";
                $post_label = "<a tabindex='-1' href=\"javascript:date_picker(document.getElementsByName('$name')[0]);\">"
-               . "     <img src='$path_to_root/themes/default/images/cal.gif' width='16' height='16' border='0' alt='"._('Click Here to Pick up the date')."'></a>\n";
+               . "     <img src='$calc_image' width='16' height='16' border='0' alt='"._('Click Here to Pick up the date')."'></a>\n";
+       }       
        else
                $post_label = "";
 
@@ -634,15 +639,15 @@ function date_cells($label, $name, $title = null, $check=null, $inc_days=0,
 
        echo "<td>";
        
-       $class = $submit_on_change ? 'class="searchbox"' : '';
+       $class = $submit_on_change ? 'date active' : 'date';
 
        $aspect = $check ? 'aspect="cdate"' : '';
        if ($check && (get_post($name) != Today()))
                $aspect .= ' style="color:#FF0000"';
 
        default_focus($name);
-
-       echo "<input type=\"text\" name=\"$name\" $class $aspect size=\"9\" maxlength=\"12\" value=\"" 
+       $size = (user_date_format()>3)?11:10; 
+       echo "<input type=\"text\" name=\"$name\" class=\"$class\" $aspect size=\"$size\" maxlength=\"12\" value=\"" 
         . $_POST[$name]. "\""
         .($title ? " title='$title'": '')." > $post_label";
        echo "</td>\n";
@@ -886,7 +891,7 @@ function inactive_control_cell($id, $value, $table, $key)
                        get_post('Update')) && (check_value('Inactive'.$id) != $value)) {
                        update_record_status($id, !$value, $table, $key);
                }
-               echo '<td align="center">'. checkbox(null, $name, $value, true, '', "align='center'")
+               echo '<td align="center">'. checkbox(null, $name, $value, true, '')
                        . hidden("LInact[$id]", $value, false) . '</td>';       
        }
 }