Merging latest changes from stable branch up to 2.3.24
[fa-stable.git] / manufacturing / search_work_orders.php
index e276261f1362eae55a2ef66fcb5bac6f565155d0..98b645b340e351d9b9810aa75d50732e08b7459e 100644 (file)
@@ -17,7 +17,7 @@ include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
 $js = "";
-if ($use_popup_windows)
+if ($SysPrefs->use_popup_windows)
        $js .= get_js_open_window(800, 500);
 if (isset($_GET['outstanding_only']) && ($_GET['outstanding_only'] == true))
 {
@@ -64,10 +64,16 @@ start_form(false, false, $_SERVER['PHP_SELF'] ."?outstanding_only=$outstanding_o
 
 start_table(TABLESTYLE_NOBORDER);
 start_row();
+ref_cells(_("#:"), 'OrderId', '',null, '', true);
 ref_cells(_("Reference:"), 'OrderNumber', '',null, '', true);
 
 locations_list_cells(_("at Location:"), 'StockLocation', null, true);
 
+end_row();
+end_table();
+start_table(TABLESTYLE_NOBORDER);
+start_row();
+
 check_cells( _("Only Overdue:"), 'OverdueOnly', null);
 
 if ($outstanding_only==0)
@@ -106,8 +112,7 @@ function wo_type_name($dummy, $type)
 function edit_link($row)
 {
        return  $row['closed'] ? '<i>'._('Closed').'</i>' :
-               pager_link(_("Edit"),
-                       "/manufacturing/work_order_entry.php?trans_no=" . $row["id"], ICON_EDIT);
+               trans_editor_link(ST_WORKORDER, $row["id"]);
 }
 
 function release_link($row)
@@ -153,8 +158,8 @@ function dec_amount($row, $amount)
        return number_format2($amount, $row['decimals']);
 }
 
-$sql = get_sql_for_work_orders($outstanding_only, $_POST['SelectedStockItem'], $_POST['StockLocation'],
-       $_POST['OrderNumber'], check_value('OverdueOnly'));
+$sql = get_sql_for_work_orders($outstanding_only, get_post('SelectedStockItem'), get_post('StockLocation'),
+       get_post('OrderId'), get_post('OrderNumber'), check_value('OverdueOnly'));
 
 $cols = array(
        _("#") => array('fun'=>'view_link', 'ord'=>''), 
@@ -182,4 +187,3 @@ display_db_pager($table);
 
 end_form();
 end_page();
-?>