[0000290] Can't upload files
[fa-stable.git] / inventory / manage / items.php
index 900641ecf2bec717e7efee964b989bf042ee6067..1391b825da10ae35f305a6165b31454b3535f813 100644 (file)
@@ -245,7 +245,7 @@ start_form(true);
 
 if (db_has_stock_items()) 
 {
-       start_table("class='tablestyle_noborder'");
+       start_table(TABLESTYLE_NOBORDER);
        start_row();
     stock_items_list_cells(_("Select an item:"), 'stock_id', null,
          _('New item'), true, check_value('show_inactive'));
@@ -261,7 +261,7 @@ if (db_has_stock_items())
 }
 
 div_start('details');
-start_outer_table($table_style2, 5);
+start_outer_table(TABLESTYLE2);
 
 table_section(1);
 
@@ -276,7 +276,8 @@ if ($new_item)
 } 
 else 
 { // Must be modifying an existing item
-       if (!isset($_POST['NewStockID'])) {
+       if (get_post('NewStockID') != get_post('stock_id')) { // first item display
+
                $_POST['NewStockID'] = $_POST['stock_id'];
 
                $myrow = get_item($_POST['NewStockID']);
@@ -305,7 +306,7 @@ else
        set_focus('description');
 }
 
-text_row(_("Name:"), 'description', null, 52, 50);
+text_row(_("Name:"), 'description', null, 52, 200);
 
 textarea_row(_('Description:'), 'long_description', null, 42, 3);
 
@@ -393,7 +394,7 @@ if (isset($_POST['NewStockID']) && file_exists(company_path().'/images/'
 {
  // 31/08/08 - rand() call is necessary here to avoid caching problems. Thanks to Peter D.
        $stock_img_link .= "<img id='item_img' alt = '[".$_POST['NewStockID'].".jpg".
-               "]' src='".company_path().'images/'.item_img_name($_POST['NewStockID']).
+               "]' src='".company_path().'/images/'.item_img_name($_POST['NewStockID']).
                ".jpg?nocache=".rand()."'"." height='$pic_height' border='0'>";
        $check_remove_image = true;
 }