-// Add image upload for New Item - by Joe
-label_row(_("Image File (.jpg)") . ":", "<input type='file' id='pic' name='pic'>");
-// Add Image upload for New Item - by Joe
-$stock_img_link = "";
-$check_remove_image = false;
-if (isset($_POST['NewStockID']) && file_exists("$comp_path/$user_comp/images/"
- .item_img_name($_POST['NewStockID']).".jpg"))
-{
- // 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='$comp_path/$user_comp/images/".item_img_name($_POST['NewStockID']).".jpg?nocache=".rand()."'".
- " height='$pic_height' border='0'>";
- $check_remove_image = true;
-}
-else
-{
- $stock_img_link .= _("No image");
+ // Add image upload for New Item - by Joe
+ file_row(_("Image File (.jpg)") . ":", 'pic', 'pic');
+ // Add Image upload for New Item - by Joe
+ $stock_img_link = "";
+ $check_remove_image = false;
+ if (isset($_POST['NewStockID']) && file_exists(company_path().'/images/'
+ .item_img_name($_POST['NewStockID']).".jpg"))
+ {
+ // 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']).
+ ".jpg?nocache=".rand()."'"." height='$pic_height' border='0'>";
+ $check_remove_image = true;
+ }
+ else
+ {
+ $stock_img_link .= _("No image");
+ }
+
+ label_row(" ", $stock_img_link);
+ if ($check_remove_image)
+ check_row(_("Delete Image:"), 'del_image');
+
+ record_status_list_row(_("Item status:"), 'inactive');
+ end_outer_table(1);
+
+ div_start('controls');
+ if (!isset($_POST['NewStockID']) || $new_item)
+ {
+ submit_center('addupdate', _("Insert New Item"), true, '', 'default');
+ }
+ else
+ {
+ submit_center_first('addupdate', _("Update Item"), '',
+ @$_REQUEST['popup'] ? true : 'default');
+ submit_return('select', get_post('stock_id'),
+ _("Select this items and return to document entry."), 'default');
+ submit('clone', _("Clone This Item"), true, '', true);
+ submit('delete', _("Delete This Item"), true, '', true);
+ submit_center_last('cancel', _("Cancel"), _("Cancel Edition"), 'cancel');
+ }
+
+ div_end();