Merged changes form stabel branch up to the current state (2.3.22+).
[fa-stable.git] / purchasing / inquiry / po_search_completed.php
index 03ab7b0ec2a5bd8fa1bb2bb5e14cc185e3f73611..196de84e295c1424630927ddd1c61fe0c3adb079 100644 (file)
@@ -16,15 +16,13 @@ include_once($path_to_root . "/includes/session.inc");
 
 include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc");
 include_once($path_to_root . "/reporting/includes/reporting.inc");
-if (!@$_GET['popup'])
-{
-       $js = "";
-       if ($use_popup_windows)
-               $js .= get_js_open_window(900, 500);
-       if ($use_date_picker)
-               $js .= get_js_date_picker();
-       page(_($help_context = "Search Purchase Orders"), false, false, "", $js);
-}
+$js = "";
+if ($use_popup_windows)
+       $js .= get_js_open_window(900, 500);
+if ($use_date_picker)
+       $js .= get_js_date_picker();
+page(_($help_context = "Search Purchase Orders"), false, false, "", $js);
+
 if (isset($_GET['order_number']))
 {
        $order_number = $_GET['order_number'];
@@ -55,14 +53,13 @@ if (get_post('SearchOrders'))
 }
 //---------------------------------------------------------------------------------------------
 
-if (!@$_GET['popup'])
-       start_form();
+start_form();
 
 start_table(TABLESTYLE_NOBORDER);
 start_row();
 ref_cells(_("#:"), 'order_number', '',null, '', true);
 
-date_cells(_("from:"), 'OrdersAfterDate', '', null, -30);
+date_cells(_("from:"), 'OrdersAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
 date_cells(_("to:"), 'OrdersToDate');
 
 locations_list_cells(_("into location:"), 'StockLocation', null, true);
@@ -104,7 +101,9 @@ function trans_view($trans)
 
 function edit_link($row) 
 {
-       if (@$_GET['popup'])
+       global $page_nested;
+
+       if ($page_nested)
                return '';
        return pager_link( _("Edit"),
                "/purchasing/po_entry_items.php?" . SID 
@@ -144,9 +143,6 @@ $table->width = "80%";
 
 display_db_pager($table);
 
-if (!@$_GET['popup'])
-{
-       end_form();
-       end_page();
-}      
+end_form();
+end_page();
 ?>