}
}
-if (isset($_POST['_stock_id_update']))
+if (list_updated('stock_id'))
$Ajax->activate('cost_table');
//-----------------------------------------------------------------------------------------
else
{
stock_costable_items_list_cells(null, 'stock_id', null, false, true);
- if(isset($_POST['_stock_id_update'])) {
+ if (list_updated('stock_id')) {
$Ajax->activate('units');
$Ajax->activate('qty');
$Ajax->activate('std_cost');
else
{
stock_costable_items_list_cells(null, 'stock_id', null, false, true);
- if(isset($_POST['_stock_id_update'])) {
+ if (list_updated('stock_id')) {
$Ajax->activate('units');
$Ajax->activate('qty');
}
include_once($path_to_root . "/inventory/includes/inventory_db.inc");
-if (isset($_POST['_stock_id_update']))
+if (list_updated('stock_id'))
$Ajax->activate('status_tbl');
//----------------------------------------------------------------------------------------------------
include_once($path_to_root . "/inventory/includes/inventory_db.inc");
$user_comp = user_company();
-$new_item = (!isset($_POST['stock_id']) || $_POST['stock_id'] == "");
+$new_item = get_post('stock_id')=='';
//------------------------------------------------------------------------------------
if (isset($_GET['stock_id']))
$stock_id = strtoupper($_POST['stock_id']);
}
-if(get_post('_stock_id_update')) {
- $_POST['NewStockID'] = $_POST['stock_id'];
- if ($new_item) {
- clear_data();
- set_focus('NewStockID');
- } else {
- set_focus('description');
- }
+if (list_updated('stock_id')) {
+ $_POST['NewStockID'] = get_post('stock_id');
$Ajax->activate('details');
$Ajax->activate('controls');
// unset($_POST['New']);
function clear_data()
{
- global $new_item;
+// global $new_item;
unset($_POST['long_description']);
unset($_POST['description']);
unset($_POST['NewStockID']);
unset($_POST['dimension_id']);
unset($_POST['dimension2_id']);
- $new_item = true;
+// $new_item = true;
}
//------------------------------------------------------------------------------------
$_POST['dimension_id'], $_POST['dimension2_id']);
display_notification(_("Item has been updated."));
- set_focus('stock_id');
}
else
{ //it is a NEW part
display_notification(_("A new item has been added."));
$_POST['stock_id'] = $_POST['NewStockID'];
- $new_item = false;
- set_focus('stock_id');
+// $new_item = false;
}
+ set_focus('stock_id');
$Ajax->activate('_page_body');
}
}
if (file_exists($filename))
unlink($filename);
display_notification(_("Selected item has been deleted."));
- $new_item = true;
+// $new_item = true;
$_POST['stock_id'] = '';
clear_data();
set_focus('stock_id');
start_row();
stock_items_list_cells(_("Select an item:"), 'stock_id', null,
_('New item'), true);
-// submit_cells('SelectStockItem', _("Edit Item"));
+ $new_item = get_post('stock_id')=='';
end_row();
end_table();
}
/*If the page was called without $_POST['NewStockID'] passed to page then assume a new item is to be entered show a form with a part Code field other wise the form showing the fields with the existing entries against the part will show for editing with only a hidden stock_id field. New is set to flag that the page may have called itself and still be entering a new part, in which case the page needs to know not to go looking up details for an existing part*/
+ clear_data();
text_row(_("Item Code:"), 'NewStockID', null, 21, 20);
$company_record = get_company_prefs();
}
else
{ // Must be modifying an existing item
+ $_POST['NewStockID'] = $_POST['stock_id'];
- if (!$new_item)
- {
$myrow = get_item($_POST['NewStockID']);
$_POST['long_description'] = $myrow["long_description"];
label_row(_("Item Code:"),$_POST['NewStockID']);
hidden('NewStockID', $_POST['NewStockID']);
- }
+ set_focus('description');
}
text_row(_("Name:"), 'description', null, 52, 50);
$selected_id = -1;
}
-if (isset($_POST['_stock_id_update'])) {
+if (list_updated('stock_id')) {
$Ajax->activate('price_table');
$Ajax->activate('price_details');
}
-if (isset($_POST['_stock_id_update']) || isset($_POST['_sales_type_id_update'])
- || isset($_POST['_curr_abrev_update']) ) {
+if (list_updated('stock_id')) || isset($_POST['_curr_abrev_update']) ) {
// after change of stock, currency or salestype selector
// display default calculated price for new settings.
// If we have this price already in db it is overwritten later.
$Ajax->activate('_page_body');
}
-if (isset($_POST['_stock_id_update']))
+if (list_updated('stock_id'))
$Ajax->activate('price_table');
//--------------------------------------------------------------------------------------------------
if (isset($_GET['stock_id']))
$_POST['stock_id'] = $_GET['stock_id'];
-if (isset($_POST['_stock_id_update']))
+if (list_updated('stock_id'))
{
$Ajax->activate('show_heading');
$Ajax->activate('reorders');
stock_component_items_list_cells(null, 'stock_id',
$wo_details["stock_id"], null, false, true);
- if(isset($_POST['_stock_id_update'])) {
+ if (list_updated('stock_id')) {
$Ajax->activate('units');
$Ajax->activate('qty');
$Ajax->activate('std_cost');
set_global_stock_item($_POST['stock_id']);
-if (isset($_POST['_stock_id_update']))
+if (list_updated('stock_id'))
$Ajax->activate('usage_table');
if (isset($_POST['stock_id']))
hidden('line_no', ($_SESSION['PO']->lines_on_order + 1));
stock_purchasable_items_list_cells(null, 'stock_id', null, false, true);
- if(isset($_POST['_stock_id_update'])) {
+ if (list_updated('stock_id')) {
$Ajax->activate('price');
$Ajax->activate('units');
$Ajax->activate('qty');
else
{
stock_items_list_cells(null,'stock_id', null, false, true);
- if(isset($_POST['_stock_id_update'])) {
+ if (list_updated('stock_id')) {
$Ajax->activate('price');
$Ajax->activate('qty');
$Ajax->activate('units');
else
{
stock_items_list_cells(null,'stock_id', null, false, true);
- if(isset($_POST['_stock_id_update'])) {
+ if (list_updated('stock_id')) {
$Ajax->activate('price');
$Ajax->activate('units');
$Ajax->activate('qty');