Unnecesary direct access to user setting superseded by calls to user_* functions.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 10 Jan 2015 19:44:20 +0000 (20:44 +0100)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 10 Jan 2015 23:19:15 +0000 (00:19 +0100)
34 files changed:
access/login.php
access/password_reset.php
admin/backups.php
admin/create_coy.php
admin/db/fiscalyears_db.inc
config.default.php
gl/inquiry/bank_inquiry.php
gl/inquiry/gl_account_inquiry.php
gl/inquiry/gl_trial_balance.php
gl/inquiry/profit_loss.php
gl/inquiry/tax_inquiry.php
gl/view/accrual_trans.php
includes/current_user.inc
includes/db/connect_db_mysql.inc
includes/db/connect_db_mysqli.inc
inventory/inquiry/stock_movements.php
purchasing/includes/ui/invoice_ui.inc
purchasing/inquiry/po_search.php
purchasing/inquiry/po_search_completed.php
purchasing/inquiry/supplier_allocation_inquiry.php
purchasing/inquiry/supplier_inquiry.php
reporting/includes/pdf_report.inc
reporting/rep102.php
reporting/rep202.php
reporting/rep706.php
reporting/rep707.php
sales/inquiry/customer_allocation_inquiry.php
sales/inquiry/customer_inquiry.php
sales/inquiry/sales_deliveries_view.php
sales/inquiry/sales_orders_view.php
sales/sales_order_entry.php
themes/aqua/renderer.php
themes/cool/renderer.php
themes/default/renderer.php

index 9c58933d48b264a383d1834007c1b4951618f6ba..dbf90ab9b7af2bfb37236ec1f2b7c8c88070aac5 100644 (file)
@@ -17,7 +17,7 @@
        $js = "<script language='JavaScript' type='text/javascript'>
 function defaultCompany()
 {
-       document.forms[0].company_login_name.options[".$_SESSION["wa_current_user"]->company."].selected = true;
+       document.forms[0].company_login_name.options[".user_company()."].selected = true;
 }
 </script>";
        add_js_file('login.js');
@@ -86,7 +86,7 @@ function defaultCompany()
        echo "</td>\n";
        end_row();
 
-       echo "<input type='hidden' id=ui_mode name='ui_mode' value='".$_SESSION["wa_current_user"]->ui_mode."' />\n";
+       echo "<input type='hidden' id=ui_mode name='ui_mode' value='".fallback_mode()."' />\n";
        if (!$login_timeout)
                table_section_title(_("Version")." $version   Build ".$SysPrefs->build_version." - "._("Login"));
        $value = $login_timeout ? $_SESSION['wa_current_user']->loginname : ($SysPrefs->allow_demo_mode ? "demouser":"");
@@ -98,11 +98,10 @@ function defaultCompany()
        password_row(_("Password:"), 'password', $password);
 
        if ($login_timeout) {
-               hidden('company_login_name', $_SESSION["wa_current_user"]->company);
+               hidden('company_login_name', user_company());
        } else {
-               if (isset($_SESSION['wa_current_user']->company))
-                       $coy =  $_SESSION['wa_current_user']->company;
-               else
+               $coy =  user_company();
+               if (!isset($coy))
                        $coy = $def_coy;
                if (!@$SysPrefs->text_company_selection) {
                        echo "<tr><td>"._("Company")."</td><td><select name='company_login_name'>\n";
index afa2a1ec01305209d87fa12396c0115ed28c3cf4..a20a2180c30b9bc59c5f87a6d584b13ea615171b 100644 (file)
@@ -17,7 +17,7 @@
        $js = "<script language='JavaScript' type='text/javascript'>
 function defaultCompany()
 {
-       document.forms[0].company_login_name.options[".$_SESSION["wa_current_user"]->company."].selected = true;
+       document.forms[0].company_login_name.options[".user_company()."].selected = true;
 }
 </script>";
        add_js_file('login.js');
@@ -57,14 +57,13 @@ function defaultCompany()
        echo "</td>\n";
        end_row();
 
-       echo "<input type='hidden' id=ui_mode name='ui_mode' value='".$_SESSION["wa_current_user"]->ui_mode."' />\n";
+       echo "<input type='hidden' id=ui_mode name='ui_mode' value='".fallback_mode()."' />\n";
        table_section_title(_("Version")." $version   Build ".$SysPrefs->build_version." - "._("Password reset"));
 
        text_row(_("Email"), "email_entry_field", "", 20, 30);
 
-  if (isset($_SESSION['wa_current_user']->company))
-    $coy =  $_SESSION['wa_current_user']->company;
-  else
+  $coy =  user_company();
+  if (!isset($coy))
     $coy = $def_coy;
   if (!@$SysPrefs->text_company_selection) {
     echo "<tr><td>"._("Company")."</td><td><select name='company_login_name'>\n";
index 63f15a018f5370eab48fdabd9458ee4c1f5e12d0..2831c131747a115e4a6917a87f5a6481c3f98cf0 100644 (file)
@@ -125,8 +125,7 @@ function download_file($filename)
     return true;
 }
 
-$db_name = $_SESSION["wa_current_user"]->company;
-$conn = $db_connections[$db_name];
+$conn = $db_connections[user_company()];
 $backup_name = clean_file_name(get_post('backups'));
 $backup_path = BACKUP_PATH . $backup_name;
 
index c84219b3e941bb29224c7de9efb87280c7a93075..80c747152cc75335d1c15016d9feb2ce6abce6a0 100644 (file)
@@ -240,7 +240,7 @@ function display_companies()
 {
        global $def_coy, $db_connections;
 
-       $coyno = $_SESSION["wa_current_user"]->company;
+       $coyno = user_company();
 
        echo "
                <script language='javascript'>
index 0d9a9d21646f463349790225860b1c1649f99004..459d16209c044950c2e6580d243869bd82432ed7 100644 (file)
@@ -212,7 +212,7 @@ function delete_this_fiscalyear($selected_id)
 {
        global $db_connections;
        
-       db_backup($db_connections[$_SESSION["wa_current_user"]->company], 'Security backup before Fiscal Year Removal');
+       db_backup($db_connections[user_company()], 'Security backup before Fiscal Year Removal');
        begin_transaction();
        $ref = _("Open Balance");
        $myrow = get_fiscalyear($selected_id);
index 1b319a2b7487961dc46f15017e78e645c9f652ce..02075ef5691ffb7f21740036d1e85a9b268e53c1 100644 (file)
@@ -160,7 +160,7 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
        Show a blank editbox only if true where the Company NickName
        will have to be manually entered. This is when privacy is needed.
 */
-$text_company_selection  = false;
+       $text_company_selection  = false;
 
 /*  Should FA hide menu items (Applications, Modules, and Actions) from the user if they don't have access to them? 
     0 for no       1 for yes
@@ -173,30 +173,30 @@ $text_company_selection  = false;
        $login_delay seconds delay is required between login attempts after $login_max_attemps failed logins.
        Set $login_delay to 0 to disable the feature (not recommended)
 */
-$login_delay = 30;
-$login_max_attempts = 10;
+       $login_delay = 30;
+       $login_max_attempts = 10;
 
 /*
        Choose Exchange Rate Provider
        Default is ECB for backwards compatibility
 */
-$xr_providers = array("ECB", "YAHOO", "GOOGLE", "BLOOMBERG");
-$dflt_xr_provider = 0;
+       $xr_providers = array("ECB", "YAHOO", "GOOGLE", "BLOOMBERG");
+       $dflt_xr_provider = 0;
 
 /*
        Set to true when remote service is authoritative source of exchange rates, and can be stored automatically without
        manual edition. Otherwise exrate is stored on first new currency transaction of the day.
 */
-$xr_provider_authoritative = false;
+       $xr_provider_authoritative = false;
 
 /*
        Optional sorting sales documents lines during edition according to item code
 */
-$sort_sales_items = false;
+       $sort_sales_items = false;
 
 /*
        Trial Balance opening balance presentation option.
        When set to true past years part of opening balance is cleared.
 */
-$clear_trial_balance_opening = false;
+       $clear_trial_balance_opening = false;
 
index efc0fd406065721012908991019f7fed759e839a..577d234693021a2b63f6f60399b3f3fa53b4c8b9 100644 (file)
@@ -47,7 +47,7 @@ start_table(TABLESTYLE_NOBORDER);
 start_row();
 bank_accounts_list_cells(_("Account:"), 'bank_account', null);
 
-date_cells(_("From:"), 'TransAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+date_cells(_("From:"), 'TransAfterDate', '', null, -user_transaction_days());
 date_cells(_("To:"), 'TransToDate');
 
 submit_cells('Show',_("Show"),'','', 'default');
index 3f81e035e3d7dfce4d671f8c43fd5bf24bd3aeac..14147f6cf52da9e2cf0f1e891afc368389a4f32f 100644 (file)
@@ -68,7 +68,7 @@ function gl_inquiry_controls()
     start_table(TABLESTYLE_NOBORDER);
        start_row();
     gl_all_accounts_list_cells(_("Account:"), 'account', null, false, false, _("All Accounts"));
-       date_cells(_("from:"), 'TransFromDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+       date_cells(_("from:"), 'TransFromDate', '', null, -user_transaction_days());
        date_cells(_("to:"), 'TransToDate');
     end_row();
        end_table();
index 9d422037e96da24a79fdf2f320085dc63f327403..b8ad34fe9685111a61899d1f65b28792ba8e0a9d 100644 (file)
@@ -50,7 +50,7 @@ function gl_inquiry_controls()
        if (!isset($_POST['TransToDate']))
                $_POST['TransToDate'] = end_month($date);
        if (!isset($_POST['TransFromDate']))
-               $_POST['TransFromDate'] = add_days(end_month($date), -$_SESSION["wa_current_user"]->prefs->transaction_days());
+               $_POST['TransFromDate'] = add_days(end_month($date), -user_transaction_days());
     date_cells(_("From:"), 'TransFromDate');
        date_cells(_("To:"), 'TransToDate');
        if ($dim >= 1)
index 347b9ff8539ccdc9d198e27a3dea01602f09e67f..e7c5e3a8c4988d39599066225c2d42acb813f715 100644 (file)
@@ -164,7 +164,7 @@ function inquiry_controls()
        if (!isset($_POST['TransToDate']))
                $_POST['TransToDate'] = end_month($date);
        if (!isset($_POST['TransFromDate']))
-               $_POST['TransFromDate'] = add_days(end_month($date), -$_SESSION["wa_current_user"]->prefs->transaction_days());
+               $_POST['TransFromDate'] = add_days(end_month($date), -user_transaction_days());
     date_cells(_("From:"), 'TransFromDate');
        date_cells(_("To:"), 'TransToDate');
        
index ec96716a267b12279ce09d921a63306ac21e582f..90ec7fe7d0efa255898764da897b7e2284e57f17 100644 (file)
@@ -58,7 +58,7 @@ function tax_inquiry_controls()
     start_table(TABLESTYLE_NOBORDER);
        start_row();
 
-       date_cells(_("from:"), 'TransFromDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+       date_cells(_("from:"), 'TransFromDate', '', null, -user_transaction_days());
        date_cells(_("to:"), 'TransToDate');
        submit_cells('Show',_("Show"),'','', 'default');
 
index 525c1b2e1309b8033eca0553690d9b3620d28b84..ab5d08f671abd880c79ff5f7642714748102fd6e 100644 (file)
@@ -64,7 +64,7 @@ $th = array_merge($first_cols, $dim_cols, $remaining_cols);
 table_header($th);
 $end = $_GET['date'];
 $account = $_GET['act'];
-$begin = add_days($end, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+$begin = add_days($end, -user_transaction_days());
 
 $result = get_gl_transactions($begin, $end, -1,        $account, 0, 0, null);
 $j = 0;
index c5e2c975521bbfb821eb2b514ffc634b19a02d33..4f5e7898b4297302a1626a72c82c557ad9b00cf9 100644 (file)
@@ -304,8 +304,8 @@ function round2($number, $decimals=0)
 function number_format2($number, $decimals=0)
 {
        global $SysPrefs;
-       $tsep = $SysPrefs->thoseps[$_SESSION["wa_current_user"]->prefs->tho_sep()];
-       $dsep = $SysPrefs->decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()];
+       $tsep = $SysPrefs->thoseps[user_dec_sep()];
+       $dsep = $SysPrefs->decseps[user_dec_sep()];
        //return number_format($number, $decimals, $dsep,       $tsep);
        if($decimals==='max')
                $dec = 15 - floor(log10(abs($number)));
@@ -342,8 +342,7 @@ function fallback_mode() {
 }
 
 function price_format($number) {
-    return number_format2($number,
-       $_SESSION["wa_current_user"]->prefs->price_dec());
+    return number_format2($number, user_price_dec());
 }
 
 function price_decimal_format($number, &$dec)
@@ -383,7 +382,7 @@ function get_qty_dec($stock_id=null)
        if ($stock_id != null)
                $dec = get_unit_dec($stock_id);
        if ($stock_id == null || $dec == -1 || $dec == null)
-               $dec = $_SESSION["wa_current_user"]->prefs->qty_dec();
+               $dec = user_qty_dec();
        return $dec;
 }
 //-------------------------------------------------------------------
index b25f0b239a71fadb7c9d2e1340582503ed278ab6..2f30aef0fa75ec24a3891b70fcb70477231cc553 100644 (file)
@@ -18,7 +18,7 @@ function set_global_connection($company=-1)
 
        include ($path_to_root . "/config_db.php");
        if ($company == -1) 
-               $company = $_SESSION["wa_current_user"]->company;
+               $company = user_company();
 
        cancel_transaction(); // cancel all aborted transactions if any
 
index cc53bcfa25a903af973086a32aa28c27225c99ab..79e299e4e6ad9dd6e302e1cd0cca5964b6a24e81 100644 (file)
@@ -20,7 +20,7 @@ function set_global_connection($company=-1)
 
        include ($path_to_root . "/config_db.php");
        if ($company == -1) 
-               $company = $_SESSION["wa_current_user"]->company;
+               $company = user_company();
 
        cancel_transaction(); // cancel all aborted transactions (if any)
 
index c368d223ce0914d35e5024d3ee7c2f4c30e35a3b..e7fb0eed31d893b157e62dd5d99ef286dc6a5140 100644 (file)
@@ -55,7 +55,7 @@ start_row();
 
 locations_list_cells(_("From Location:"), 'StockLocation', null, true);
 
-date_cells(_("From:"), 'AfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+date_cells(_("From:"), 'AfterDate', '', null, -user_transaction_days());
 date_cells(_("To:"), 'BeforeDate');
 
 submit_cells('ShowMoves',_("Show Movements"),'',_('Refresh Inquiry'), 'default');
index 45ce4585e83b9557db88eada09137236c320a0df..d16e8d1392b684402fe0a80d79da9d36bc99c36d 100644 (file)
@@ -484,7 +484,7 @@ function display_grn_items(&$supp_trans, $mode=0)
                {
                        echo "</td>";
                        date_cells(_("Received between"), 'receive_begin', "", null, 
-                               -$_SESSION["wa_current_user"]->prefs->transaction_days(), 0, 0, "valign=middle");
+                               -user_transaction_days(), 0, 0, "valign=middle");
                        date_cells(_("and"), 'receive_end', '', null, 1, 0, 0, "valign=middle");
                        submit_cells('RefreshInquiry', _("Search"),'',_('Refresh Inquiry'), true);
                        echo "<td>";
index 42446bb28f8567b9648b5b2e7e2bbf33dfd6b398..71228317d99a9eee0aecec8164ed32169e318931 100644 (file)
@@ -61,7 +61,7 @@ start_table(TABLESTYLE_NOBORDER);
 start_row();
 ref_cells(_("#:"), 'order_number', '',null, '', true);
 
-date_cells(_("from:"), 'OrdersAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+date_cells(_("from:"), 'OrdersAfterDate', '', null, -user_transaction_days());
 date_cells(_("to:"), 'OrdersToDate');
 
 locations_list_cells(_("Location:"), 'StockLocation', null, true);
index 74b8f719e570e3758a9a2e45064cb722989c6de7..ca83d87465b21f5bc85740092e132b18a781d1fc 100644 (file)
@@ -60,7 +60,7 @@ start_table(TABLESTYLE_NOBORDER);
 start_row();
 ref_cells(_("#:"), 'order_number', '',null, '', true);
 
-date_cells(_("from:"), 'OrdersAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+date_cells(_("from:"), 'OrdersAfterDate', '', null, -user_transaction_days());
 date_cells(_("to:"), 'OrdersToDate');
 
 locations_list_cells(_("into location:"), 'StockLocation', null, true);
index fe80c722d51b77fba408840d125fd1d0af2e4f21..84fb2e12a9d3b2ca1d50ad6f8433dfc5b4e36792 100644 (file)
@@ -47,7 +47,7 @@ start_row();
 
 supplier_list_cells(_("Select a supplier: "), 'supplier_id', $_POST['supplier_id'], true);
 
-date_cells(_("From:"), 'TransAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+date_cells(_("From:"), 'TransAfterDate', '', null, -user_transaction_days());
 date_cells(_("To:"), 'TransToDate', '', null, 1);
 
 supp_allocations_list_cell("filterType", null);
index 88c30d23a3feaa9736fec7226e4ebc8ee809912f..b0f045258363032ebc79ec5bff79b0357d8ece4c 100644 (file)
@@ -47,7 +47,7 @@ start_row();
 if (!$page_nested)
        supplier_list_cells(_("Select a supplier:"), 'supplier_id', null, true, false, false, true);
 
-date_cells(_("From:"), 'TransAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+date_cells(_("From:"), 'TransAfterDate', '', null, -user_transaction_days());
 date_cells(_("To:"), 'TransToDate');
 
 supp_transactions_list_cell("filterType", null, true);
index e64b7f5a5a13a4688bfa28c4dc0c8adf1e2dba8d..737a60c83730f201dba877189af6ee42ced8ed4f 100644 (file)
@@ -428,8 +428,9 @@ class FrontReport extends Cpdf
                $doctype = $this->formData['doctype'];
                $header2type = true;
 
+               $lang = user_language();
                $this->SetLang(@$this->formData['rep_lang'] ? $this->formData['rep_lang']
-                       : ($_SESSION["wa_current_user"]->prefs->language ? $_SESSION["wa_current_user"]->prefs->language : $dflt_lang));
+                       : ( $lang ? $lang : $dflt_lang));
 
                 // leave layout files names without path to enable including
                 // modified versions from company/x/reporting directory
index ca14dc0362446b526ef5e28fd689428a6119b9f2..42afc13e9e6a402d625aac1a4407084c77120443 100644 (file)
@@ -69,7 +69,7 @@ function get_invoices($customer_id, $to, $all=true)
 
 function print_aged_customer_analysis()
 {
-    global $path_to_root, $systypes_array;
+    global $path_to_root, $systypes_array, $SysPrefs;
 
        $to = $_POST['PARAM_0'];
        $fromcust = $_POST['PARAM_1'];
@@ -238,7 +238,6 @@ function print_aged_customer_analysis()
        $rep->Line($rep->row - 8);
        if ($graphics)
        {
-               global $SysPrefs;
                $pg->x = array(_('Current'), $nowdue, $pastdue1, $pastdue2);
                $pg->title     = $rep->title;
                $pg->axis_x    = _("Days");
@@ -247,7 +246,7 @@ function print_aged_customer_analysis()
                $pg->type      = $graphics;
                $pg->skin      = $SysPrefs->graph_skin;
                $pg->built_in  = false;
-               $pg->latin_notation = ($SysPrefs->decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != ".");
+               $pg->latin_notation = ($SysPrefs->decseps[user_dec_sep()] != ".");
                $filename = company_path(). "/pdf_files/". uniqid("").".png";
                $pg->display($filename, true);
                $w = $pg->width / 1.5;
index 61303541b7c148788ce5fc1626c524e1498db6d0..c61c2aa5dd9ba290d8df939f8a7f69622895e764 100644 (file)
@@ -254,7 +254,7 @@ function print_aged_supplier_analysis()
                $pg->type      = $graphics;
                $pg->skin      = $SysPrefs->graph_skin;
                $pg->built_in  = false;
-               $pg->latin_notation = ($SysPrefs->decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != ".");
+               $pg->latin_notation = ($SysPrefs->decseps[user_dec_sep()] != ".");
                $filename = company_path(). "/pdf_files/". uniqid("").".png";
                $pg->display($filename, true);
                $w = $pg->width / 1.5;
index f54fddc6769871fcc629bb2af93ced0538cd0df7..07585945b5e50cddd5f9b3708f13068fdded39e6 100644 (file)
@@ -311,7 +311,7 @@ function print_balance_sheet()
                $pg->type      = $graphics;
                $pg->skin      = $SysPrefs->graph_skin;
                $pg->built_in  = false;
-               $pg->latin_notation = ($SysPrefs->decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != ".");
+               $pg->latin_notation = ($SysPrefs->decseps[user_dec_sep()] != ".");
                $filename = company_path(). "/pdf_files/". uniqid("").".png";
                $pg->display($filename, true);
                $w = $pg->width / 1.5;
index bdf8c3ba8290652b16fa3c3bef526205037d3668..a0373b52e05751e39b53c1f725ccd6fc974a2329 100644 (file)
@@ -329,7 +329,7 @@ function print_profit_and_loss_statement()
                $pg->type      = $graphics;
                $pg->skin      = $SysPrefs->graph_skin;
                $pg->built_in  = false;
-               $pg->latin_notation = ($SysPrefs->decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != ".");
+               $pg->latin_notation = ($SysPrefs->decseps[user_dec_sep()] != ".");
                $filename = company_path(). "/pdf_files/". uniqid("").".png";
                $pg->display($filename, true);
                $w = $pg->width / 1.5;
index 968600bb15e47832818228caa0b60d368d6b49d4..6d01aebcace45ea05be0abd3799b5c83f712b67c 100644 (file)
@@ -41,7 +41,7 @@ start_row();
 
 customer_list_cells(_("Select a customer: "), 'customer_id', $_POST['customer_id'], true);
 
-date_cells(_("from:"), 'TransAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+date_cells(_("from:"), 'TransAfterDate', '', null, -user_transaction_days());
 date_cells(_("to:"), 'TransToDate', '', null, 1);
 
 cust_allocations_list_cells(_("Type:"), 'filterType', null);
index 34b06832e0e292aeb95642afdd25c5ceb3faf95c..f9744d0168c15e184c3d0428e63b90e45d35d9b0 100644 (file)
@@ -43,7 +43,7 @@ start_row();
 if (!$page_nested)
        customer_list_cells(_("Select a customer: "), 'customer_id', null, true, false, false, !@$_GET['popup']);
 
-date_cells(_("From:"), 'TransAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+date_cells(_("From:"), 'TransAfterDate', '', null, -user_transaction_days());
 date_cells(_("To:"), 'TransToDate', '', null, 1);
 
 if (!isset($_POST['filterType']))
index 7bcea70fcc6ff93998bf865fbe1691d2be8db2b5..86091ebf3c5e745984fa912abded3367d35197e1 100644 (file)
@@ -99,7 +99,7 @@ start_form(false, false, $_SERVER['PHP_SELF'] ."?OutstandingOnly=".$_POST['Outst
 start_table(TABLESTYLE_NOBORDER);
 start_row();
 ref_cells(_("#:"), 'DeliveryNumber', '',null, '', true);
-date_cells(_("from:"), 'DeliveryAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+date_cells(_("from:"), 'DeliveryAfterDate', '', null, -user_transaction_days());
 date_cells(_("to:"), 'DeliveryToDate', '', null, 1);
 
 locations_list_cells(_("Location:"), 'StockLocation', null, true);
index 0095a418f78e542b1e039385abd454c0f669f6c5..35d71c6444a40b86e1838e1cba7c9482d43f119c 100644 (file)
@@ -210,7 +210,7 @@ ref_cells(_("#:"), 'OrderNumber', '',null, '', true);
 ref_cells(_("Ref"), 'OrderReference', '',null, '', true);
 if ($show_dates)
 {
-       date_cells(_("from:"), 'OrdersAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+       date_cells(_("from:"), 'OrdersAfterDate', '', null, -user_transaction_days());
        date_cells(_("to:"), 'OrdersToDate', '', null, 1);
 }
 locations_list_cells(_("Location:"), 'StockLocation', null, true, true);
index 2a0aa0b63b8b7be6eecc8f6c06efcdcb873f76b3..7a33997245a2073a3b865efcc3a3cea0b19cb7b1 100644 (file)
@@ -51,7 +51,7 @@ set_page_security( @$_SESSION['Items']->trans_type,
 
 $js = '';
 
-if ($SysPrefs->SysPrefs->use_popup_windows) {
+if ($SysPrefs->use_popup_windows) {
        $js .= get_js_open_window(900, 500);
 }
 
index 51dc97008a73289ccc8a649fcc1632f2521d1c2f..cd7075c5021ab3d3ac09022b5e209dcf6061da3b 100644 (file)
@@ -71,7 +71,7 @@
                                $himg = "<img src='$local_path_to_root/themes/aqua/images/help.gif' width='14' height='14' border='0' alt='"._('Help')."'>&nbsp;&nbsp;";
 
                                echo "<table class=logoutBar>";
-                               echo "<tr><td class=headingtext3>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
+                               echo "<tr><td class=headingtext3>" . $db_connections[user_company()]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
                                $indicator = "$path_to_root/themes/".user_theme(). "/images/ajax-loader.gif";
                                echo "<td class='logoutBarRight'><img id='ajaxmark' src='$indicator' align='center' style='visibility:hidden;'></td>";
                                echo "  <td class='logoutBarRight'><a class='shortcut' href='$path_to_root/admin/display_prefs.php?'>" . _("Preferences") . "</a>&nbsp;&nbsp;&nbsp;\n";
index 5e7e8b655182ba8215fcfb004f57167b2e8257ef..0881a204796ad0902f08855865da99deadda6f10 100644 (file)
@@ -71,7 +71,7 @@
                                $himg = "<img src='$local_path_to_root/themes/aqua/images/help.gif' width='14' height='14' border='0' alt='"._('Help')."'>&nbsp;&nbsp;";
 
                                echo "<table class=logoutBar>";
-                               echo "<tr><td class=headingtext3>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
+                               echo "<tr><td class=headingtext3>" . $db_connections[user_company()]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
                                $indicator = "$path_to_root/themes/".user_theme(). "/images/ajax-loader.gif";
                                echo "<td class='logoutBarRight'><img id='ajaxmark' src='$indicator' align='center' style='visibility:hidden;'></td>";
                                echo "  <td class='logoutBarRight'><a class='shortcut' href='$path_to_root/admin/display_prefs.php?'>" . _("Preferences") . "</a>&nbsp;&nbsp;&nbsp;\n";
index d9ae2b0020c28a32f245afbc5ecadf8e8c8fcca6..53c2ea4410fdf07301891eb245eca56a7674268b 100644 (file)
@@ -70,7 +70,7 @@
                                $img = "<img src='$local_path_to_root/themes/default/images/login.gif' width='14' height='14' border='0' alt='"._('Logout')."'>&nbsp;&nbsp;";
                                $himg = "<img src='$local_path_to_root/themes/default/images/help.gif' width='14' height='14' border='0' alt='"._('Help')."'>&nbsp;&nbsp;";
                                echo "<table class=logoutBar>";
-                               echo "<tr><td class=headingtext3>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
+                               echo "<tr><td class=headingtext3>" . $db_connections[user_company()]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
                                $indicator = "$path_to_root/themes/".user_theme(). "/images/ajax-loader.gif";
                                echo "<td class='logoutBarRight'><img id='ajaxmark' src='$indicator' align='center' style='visibility:hidden;'></td>";
                                echo "  <td class='logoutBarRight'><a class='shortcut' href='$path_to_root/admin/display_prefs.php?'>" . _("Preferences") . "</a>&nbsp;&nbsp;&nbsp;\n";