When updating costs and no quantity on hand we got a db error (in newer mysql releases).
[fa-stable.git] / includes / ui / ui_input.inc
index 0ffa0247a1cb688da9c5fa42a1f0c8516e314f1e..9ae512b5910ed2111eef9d4fef0f1fdcecdf99fc 100644 (file)
@@ -624,8 +624,12 @@ function date_cells($label, $name, $title = null, $check=null, $inc_days=0,
                }
        }
        if ($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 = "";
 
@@ -641,7 +645,8 @@ function date_cells($label, $name, $title = null, $check=null, $inc_days=0,
                $aspect .= ' style="color:#FF0000"';
 
        default_focus($name);
-       echo "<input type=\"text\" name=\"$name\" class=\"$class\" $aspect size=\"10\" 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";