Fixed tabbed dialogs. Removed redundant 'popup' variables.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 9 Nov 2015 11:04:08 +0000 (12:04 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 9 Nov 2015 11:04:08 +0000 (12:04 +0100)
inventory/cost_update.php
inventory/includes/db/items_purchases_db.inc
inventory/inquiry/stock_movements.php
inventory/inquiry/stock_status.php
inventory/manage/items.php
inventory/prices.php
inventory/purchasing_data.php
inventory/reorder_level.php
purchasing/manage/suppliers.php
sales/inquiry/customer_inquiry.php
sales/manage/customers.php

index efd99593f8a2bf1e60b3befe8d9895e9942b2f4d..11ab6fc39c7ed9c8121c9d577ad243ab0a985b20 100644 (file)
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 $page_security = 'SA_STANDARDCOST';
-if (!@$_GET['popup'])
-       $path_to_root = "..";
-else   
+
+if (@$_GET['page_level'] == 1)
        $path_to_root = "../..";
+else   
+       $path_to_root = "..";
 
 include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root . "/includes/date_functions.inc");
@@ -21,6 +22,7 @@ include_once($path_to_root . "/includes/ui.inc");
 include_once($path_to_root . "/includes/banking.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 include_once($path_to_root . "/inventory/includes/inventory_db.inc");
+include_once($path_to_root . "/includes/ui/items_cart.inc");
 
 $js = "";
 if ($SysPrefs->use_popup_windows)
@@ -112,10 +114,6 @@ $_POST['overhead_cost'] = price_decimal_format($myrow["overhead_cost"], $dec3);
 
 amount_row(_("Standard Material Cost Per Unit"), "material_cost", null, "class='tableheader2'", null, $dec1);
 
-if ($page_nested)
-{
-       hidden('popup', @$_GET['popup']);
-}
 if ($myrow["mb_flag"]=='M')
 {
        amount_row(_("Standard Labour Cost Per Unit"), "labour_cost", null, "class='tableheader2'", null, $dec2);
index 33f765a80dc2d1975c34e7de843cf3cb98a0cbe5..eecd91239de1df8c9805419fa92c78495976c601 100644 (file)
@@ -57,7 +57,7 @@ function get_item_purchasing_data($selected_id, $stock_id)
        $sql = "SELECT pdata.*, supplier.supp_name
                FROM ".TB_PREF."purch_data pdata
                        INNER JOIN ".TB_PREF."suppliers supplier ON pdata.supplier_id=supplier.supplier_id
-               WHERE pata.supplier_id=".db_escape($selected_id)."
+               WHERE pdata.supplier_id=".db_escape($selected_id)."
                        AND pdata.stock_id=".db_escape($stock_id);
 
        $result = db_query($sql, "The supplier purchasing details for the selected supplier and item could not be retrieved");
index 363f4dc9b8d402ce65d864009ed56d57febfb12d..a0783eabc9b96ef71ac419ca550f95e2ee83ea57 100644 (file)
@@ -23,7 +23,7 @@ if ($SysPrefs->use_popup_windows)
        $js .= get_js_open_window(800, 500);
 if (user_use_date_picker())
        $js .= get_js_date_picker();
-page(_($help_context = "Inventory Item Movement"), @$_GET['popup'], false, "", $js);
+page(_($help_context = "Inventory Item Movement"), isset($_GET['stock_id']), false, "", $js);
 //------------------------------------------------------------------------------------------------
 
 check_db_has_stock_items(_("There are no items defined in the system."));
@@ -38,8 +38,7 @@ if (isset($_GET['stock_id']))
        $_POST['stock_id'] = $_GET['stock_id'];
 }
 
-if (!@$_GET['popup'])
-       start_form();
+start_form();
 
 if (!isset($_POST['stock_id']))
        $_POST['stock_id'] = get_global_stock_item();
@@ -62,8 +61,7 @@ date_cells(_("To:"), 'BeforeDate');
 submit_cells('ShowMoves',_("Show Movements"),'',_('Refresh Inquiry'), 'default');
 end_row();
 end_table();
-if (!@$_GET['popup'])
-       end_form();
+end_form();
 
 set_global_stock_item($_POST['stock_id']);
 
index f409307517172f8e9ca7cadbdd996f775a59715e..6c0c0ba96422474333c1fcf93fbefbec1bd09ce1 100644 (file)
@@ -13,7 +13,7 @@ $page_security = 'SA_ITEMSSTATVIEW';
 $path_to_root = "../..";
 include_once($path_to_root . "/includes/session.inc");
 
-page(_($help_context = "Inventory Item Status"), @$_GET['popup']);
+page(_($help_context = "Inventory Item Status"), isset($_GET['stock_id']));
 
 if (isset($_GET['stock_id']))
        $_POST['stock_id'] = $_GET['stock_id'];
index 3725aca9e84b5d5fa783c142d3be74c05ebced4b..fc7f1a7a8f3ff4b634ecc7d2eeb6337614a185d4 100644 (file)
@@ -19,7 +19,7 @@ if ($SysPrefs->use_popup_windows)
 if (user_use_date_picker())
        $js .= get_js_date_picker();
 
-page(_($help_context = "Items"), @$_REQUEST['popup'], false, "", $js);
+page(_($help_context = "Items"), false, false, "", $js);
 
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/includes/ui.inc");
@@ -265,7 +265,7 @@ if (isset($_POST['delete']) && strlen($_POST['delete']) > 1)
 
 function item_settings(&$stock_id, $new_item) 
 {
-       global $SysPrefs, $path_to_root;
+       global $SysPrefs, $path_to_root, $page_nested;
 
        start_outer_table(TABLESTYLE2);
 
@@ -428,7 +428,7 @@ function item_settings(&$stock_id, $new_item)
        else 
        {
                submit_center_first('addupdate', _("Update Item"), '', 
-                       @$_REQUEST['popup'] ? true : 'default');
+                       $page_nested ? 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);
@@ -487,17 +487,17 @@ tabbed_content_start('tabs', array(
                        break;
                case 'sales_pricing':
                        $_GET['stock_id'] = $stock_id;
-                       $_GET['popup'] = 1;
+                       $_GET['page_level'] = 1;
                        include_once($path_to_root."/inventory/prices.php");
                        break;
                case 'purchase_pricing':
                        $_GET['stock_id'] = $stock_id;
-                       $_GET['popup'] = 1;
+                       $_GET['page_level'] = 1;
                        include_once($path_to_root."/inventory/purchasing_data.php");
                        break;
                case 'standard_cost':
                        $_GET['stock_id'] = $stock_id;
-                       $_GET['popup'] = 1;
+                       $_GET['page_level'] = 1;
                        include_once($path_to_root."/inventory/cost_update.php");
                        break;
                case 'reorder_level':
@@ -505,18 +505,16 @@ tabbed_content_start('tabs', array(
                        {
                                break;
                        }       
+                       $_GET['page_level'] = 1;
                        $_GET['stock_id'] = $stock_id;
-                       $_GET['popup'] = 1;
                        include_once($path_to_root."/inventory/reorder_level.php");
                        break;
                case 'movement':
                        $_GET['stock_id'] = $stock_id;
-                       $_GET['popup'] = 1;
                        include_once($path_to_root."/inventory/inquiry/stock_movements.php");
                        break;
                case 'status':
                        $_GET['stock_id'] = $stock_id;
-                       $_GET['popup'] = 1;
                        include_once($path_to_root."/inventory/inquiry/stock_status.php");
                        break;
        };
@@ -525,9 +523,8 @@ tabbed_content_end();
 
 div_end();
 
-hidden('popup', @$_REQUEST['popup']);
 end_form();
 
 //------------------------------------------------------------------------------------
 
-end_page(@$_REQUEST['popup']);
+end_page();
index c537752ecb4222ff661d729e07238b3d26cd8e80..a464e62e6000581119d6a7bea3fd44313be5caf6 100644 (file)
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 $page_security = 'SA_SALESPRICE';
-if (!@$_GET['popup'])
-       $path_to_root = "..";
-else   
+
+if (@$_GET['page_level'] == 1)
        $path_to_root = "../..";
+else   
+       $path_to_root = "..";
 
 include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root . "/sales/includes/sales_db.inc");
@@ -182,10 +183,7 @@ if ($Mode == 'Edit')
 }
 
 hidden('selected_id', $selected_id);
-if ($page_nested)
-{
-       hidden('popup', @$_GET['popup']);
-}
+
 div_start('price_details');
 start_table(TABLESTYLE2);
 
index d0302261ed86e5b857ff4e8cac0b3577e7ac28e3..8c36581ddd5d30823652d613f56eb02dc3c01b47 100644 (file)
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 $page_security = 'SA_PURCHASEPRICING';
-if (!@$_GET['popup'])
-       $path_to_root = "..";
-else   
+
+if (@$_GET['page_level'] == 1)
        $path_to_root = "../..";
+else   
+       $path_to_root = "..";
 
 include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root . "/includes/date_functions.inc");
@@ -193,10 +194,6 @@ if ($Mode =='Edit')
 
 br();
 hidden('selected_id', $selected_id);
-if ($page_nested)
-{
-       hidden('popup', @$_GET['popup']);
-}
 
 start_table(TABLESTYLE2);
 
index 8eca2ef19a629c473162ed111f43569d3da2bc97..cc0d6979ff33d6f929be01c234df133d1a16a743 100644 (file)
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 $page_security = 'SA_REORDER';
-if (!@$_GET['popup'])
-       $path_to_root = "..";
-else   
+
+if (@$_GET['page_level'] == 1)
        $path_to_root = "../..";
+else   
+       $path_to_root = "..";
 
 include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root . "/includes/date_functions.inc");
@@ -72,11 +73,6 @@ $k=0; //row colour counter
 
 $result = get_loc_details($_POST['stock_id']);
 
-if ($page_nested)
-{
-       hidden('popup', @$_GET['popup']);
-}
-
 while ($myrow = db_fetch($result))
 {
 
index 4613de18a4000df654e84bc9bdd2c10241696100..d17950c4800b9ecfe7fd3fcddb55a298a2669a66 100644 (file)
@@ -35,7 +35,8 @@ $supplier_id = get_post('supplier_id');
 //--------------------------------------------------------------------------------------------
 function supplier_settings(&$supplier_id)
 {
-
+       global $page_nested;
+       
        start_outer_table(TABLESTYLE2);
 
        table_section(1);
@@ -169,7 +170,7 @@ function supplier_settings(&$supplier_id)
        if ($supplier_id) 
        {
                submit_center_first('submit', _("Update Supplier"), 
-                 _('Update supplier data'), @$_REQUEST['popup'] ? true : 'default');
+                 _('Update supplier data'), $page_nested ? true : 'default');
                submit_return('select', get_post('supplier_id'), _("Select this supplier and return to document entry."));
                submit_center_last('delete', _("Delete Supplier"), 
                  _('Delete supplier data if have been never used'), true);
index b90eacec5b5a41b3e637717ba31c3796a38f29a4..720edc35bf4ffb3b0c477dc07ff60b134e17b26d 100644 (file)
@@ -41,7 +41,7 @@ start_table(TABLESTYLE_NOBORDER);
 start_row();
 
 if (!$page_nested)
-       customer_list_cells(_("Select a customer: "), 'customer_id', null, true, false, false, !@$_GET['popup']);
+       customer_list_cells(_("Select a customer: "), 'customer_id', null, true, false, false, true);
 
 date_cells(_("From:"), 'TransAfterDate', '', null, -user_transaction_days());
 date_cells(_("To:"), 'TransToDate', '', null);
index e7e21e894dab641b8f74eb2ac02a33e674f2833d..953d776289d2fbf2f16e5bf40af2388fe3178efb 100644 (file)
@@ -20,7 +20,7 @@ if ($SysPrefs->use_popup_windows)
 if (user_use_date_picker())
        $js .= get_js_date_picker();
        
-page(_($help_context = "Customers"), @$_REQUEST['popup'], false, "", $js); 
+page(_($help_context = "Customers"), false, false, "", $js); 
 
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/includes/banking.inc");
@@ -187,7 +187,7 @@ if (isset($_POST['delete']))
 
 function customer_settings($selected_id) 
 {
-       global $SysPrefs, $path_to_root;
+       global $SysPrefs, $path_to_root, $page_nested;
        
        if (!$selected_id) 
        {
@@ -284,8 +284,8 @@ function customer_settings($selected_id)
                start_row();
                echo '<td class="label">'._('Customer branches').':</td>';
                hyperlink_params_td($path_to_root . "/sales/manage/customer_branches.php",
-                       '<b>'. (@$_REQUEST['popup'] ?  _("Select or &Add") : _("&Add or Edit ")).'</b>', 
-                       "debtor_no=".$selected_id.(@$_REQUEST['popup'] ? '&popup=1':''));
+                       '<b>'. ($page_nested ?  _("Select or &Add") : _("&Add or Edit ")).'</b>', 
+                       "debtor_no=".$selected_id.($page_nested ? '&popup=1':''));
                end_row();
        }
 
@@ -308,7 +308,7 @@ function customer_settings($selected_id)
        else 
        {
                submit_center_first('submit', _("Update Customer"), 
-                 _('Update customer data'), @$_REQUEST['popup'] ? true : 'default');
+                 _('Update customer data'), $page_nested ? true : 'default');
                submit_return('select', $selected_id, _("Select this customer and return to document entry."));
                submit_center_last('delete', _("Delete Customer"), 
                  _('Delete customer data if have been never used'), true);
@@ -374,7 +374,6 @@ tabbed_content_start('tabs', array(
 br();
 tabbed_content_end();
 
-hidden('popup', @$_REQUEST['popup']);
 end_form();
-end_page(@$_REQUEST['popup']);
+end_page();