$ -> Affected files
---------------------------------------Release Candidate 1-------------------------------
+10-Jun-2008 Janusz Dobrowolski
+# Some more fixes related to ajax combos usage
+$ /includes/ui/ui_lists.inc
+ /inventory/cost_update.php
+ /inventory/prices.php
+ /inventory/purchasing_data.php
+ /inventory/reorder_level.php
+ /inventory/includes/item_adjustments_ui.inc
+ /inventory/inquiry/stock_status.php
+ /manufacturing/inquiry/where_used_inquiry.php
+ /manufacturing/manage/bom_edit.php
+ /purchasing/includes/ui/po_ui.inc
+
09-Jun-2008 Janusz Dobrowolski
# Some additional fixes related to last big committment
$ /gl/gl_journal.php
: _('Enter description fragment to search or * for all')) :'';
if ($selected_id == null) {
- $selected_id = get_post($name);
+ $selected_id = get_post($name, null);
}
$txt = get_post($search_box);
$rel = '';
$descr = $opts['format']==null ? $contact_row[1] :
call_user_func($opts['format'], $contact_row);
$sel = '';
- if (isset($_POST[$search_submit])) {
- if (($by_id ? $value : $contact_row[1]) === $txt)
- $selected_id = $value;
- }
- // if no initial selection - set the first item
- if ($selected_id === "") {
- $selected_id = $value;
- }
- if ($selected_id == $value) {
+ if ($selected_id === $value) {
$sel = 'selected';
$found = $value;
- $_POST[$name] = $selected_id;
}
- if ($first_opt == false) {
+ if ($first_id === false) {
$first_id = $value;
$first_opt = $descr;
- continue;
}
$selector .= "<option $sel value='$value'>$descr</option>\n";
}
db_free_result($result);
}
- if ($first_id !== false) {
- // add first option - selected also if no match for selected_id was found
- // and no special option defined
- $sel = $spec_option===false || $found === $first_id ? 'selected' : '';
- $selector = "<option $sel value='$first_id'>$first_opt</option>\n"
- . $selector;
- }
// Prepend special option.
if ($spec_option !== false) { // if special option used - add it
$first_id = $spec_id;
$first_opt = $spec_option;
- if (isset($_POST[$search_submit])) {
- if ($txt == '')
- $selected_id = $spec_id;
- }
$sel = $found===false ? 'selected' : '';
$selector = "<option $sel value='$spec_id'>$spec_option</option>\n"
. $selector;
- $first_id = $spec_id;
}
if ($found === false) {
$_POST[$name] = $first_id;
}
-
if ($by_id) {
$txt = $_POST[$name];
if ($search_box)
}
// ------ make combo ----------
-$edit_entry = '';
+ $edit_entry = '';
if ($search_box != false) {
$edit_entry = "<input type='text' name='$search_box' id='$search_box' size='".
$opts['size']."' maxlength='".$opts['max'].
function stock_purchasable_items_list($name, $selected_id, $all_option=false,
$submit_on_change=false, $opts=array())
{
-
+ global $all_items;
$sql = "SELECT stock_id, s.description, c.description
FROM ".TB_PREF."stock_master s,".TB_PREF."stock_category c
WHERE s.category_id=c.category_id
}
}
+if (isset($_POST['_stock_id_update']))
+ $Ajax->activate('cost_table');
//-----------------------------------------------------------------------------------------
start_form(false, true);
check_db_error("The cost details for the item could not be retrieved", $sql);
$myrow = db_fetch($result);
-
+div_start('cost_table');
hidden("OldMaterialCost", $myrow["material_cost"]);
hidden("OldLabourCost", $myrow["labour_cost"]);
hidden("OldOverheadCost", $myrow["overhead_cost"]);
}
end_table(1);
+div_end();
submit_center('UpdateData', _("Update"));
end_form();
else
{
echo "<td colspan=2>";
- stock_costable_items_list('stock_id', $_POST['stock_id'], false, true);
+ stock_costable_items_list('stock_id', null, false, true);
echo "</td>";
$item_info = get_item_edit_info($_POST['stock_id']);
include_once($path_to_root . "/inventory/includes/inventory_db.inc");
+if (isset($_POST['_stock_id_update']))
+ $Ajax->activate('status_tbl');
//----------------------------------------------------------------------------------------------------
check_db_has_stock_items(_("There are no items defined in the system."));
$loc_details = get_loc_details($_POST['stock_id']);
+div_start('status_tbl');
start_table($table_style);
if ($kitset_or_service == true)
}
end_table();
-
+div_end();
end_form();
end_page();
echo _("The selected price has been deleted.");
}
-
+if (isset($_POST['_stock_id_update']))
+ $Ajax->activate('price_table');
//---------------------------------------------------------------------------------------------------
$mb_flag = get_mb_flag($_POST['stock_id']);
$prices_list = get_prices($_POST['stock_id']);
+div_start('price_table');
start_table("$table_style width=30%");
$th = array(_("Currency"), _("Sales Type"), _("Price"), "", "");
}
end_table();
-
+div_end();
//------------------------------------------------------------------------------------------------
if (db_num_rows($prices_list) == 0)
display_note(_("The purchasing data item has been sucessfully deleted."));
unset ($supplier_id);
}
-
+if (isset($_POST['_stock_id_update']))
+ $Ajax->activate('price_table');
//--------------------------------------------------------------------------------------------------
start_form(false, true);
WHERE stock_id = '" . $_POST['stock_id'] . "'";
$result = db_query($sql, "The supplier purchasing details for the selected part could not be retrieved");
-
+ div_start('price_table');
if (db_num_rows($result) == 0)
{
display_note(_("There is no purchasing data set up for the part selected"));
end_table();
}
+ div_end();
}
//------------------------------------------------------------------------------------------------
$_POST['stock_id'] = $_GET['stock_id'];
}
+if (isset($_POST['_stock_id_update']))
+ $Ajax->activate('reorders');
//------------------------------------------------------------------------------------
start_form(false, true);
set_global_stock_item($_POST['stock_id']);
+div_start('reorders');
start_table("$table_style width=30%");
$th = array(_("Location"), _("Quantity On Hand"), _("Re-Order Level"));
}
end_table(1);
-
+div_end();
submit_center('UpdateData', _("Update"));
end_form();
set_global_stock_item($_POST['stock_id']);
+if (isset($_POST['_stock_id_update']))
+ $Ajax->activate('usage_table');
+
if (isset($_POST['stock_id']))
{
$sql = "SELECT ".TB_PREF."bom.*,".TB_PREF."stock_master.description,".TB_PREF."workcentres.name As WorkCentreName, ".TB_PREF."locations.location_name
$result = db_query($sql,"No parent items were returned");
+ div_start('usage_table');
if (db_num_rows($result) == 0)
{
display_note(_("The selected item is not used in any BOMs."));
end_table();
}
+ div_end();
}
end_form();
global $table_style;
$result = get_bom($selected_parent);
-
+div_start('bom');
start_table("$table_style width=60%");
$th = array(_("Code"), _("Description"), _("Location"),
_("Work Centre"), _("Quantity"), _("Units"),'','');
} //END WHILE LIST LOOP
end_table();
+div_end();
}
//--------------------------------------------------------------------------------------------------
end_form();
+if (isset($_POST['_stock_id_update']))
+ $Ajax->activate('bom');
//--------------------------------------------------------------------------------------------------
if (isset($_POST['stock_id']))
if (!isset($_POST['supplier_id']) && (get_global_supplier() != reserved_words::get_all()))
$_POST['supplier_id'] = get_global_supplier();
- supplier_list_row(_("Supplier:"), 'supplier_id', $_POST['supplier_id'], false, true);
+ supplier_list_row(_("Supplier:"), 'supplier_id', null, false, true);
if ($order->supplier_id != $_POST['supplier_id'])
{