From 5e63c6ace55729bbb5ee3b060035a25a4426eb0a Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sat, 10 Jan 2015 16:53:55 +0100 Subject: [PATCH] Access to system settings moved from global scope to SysPrefs. --- access/login.php | 24 +++--- access/logout.php | 2 +- access/password_reset.php | 12 +-- admin/attachments.php | 2 +- admin/backups.php | 4 +- admin/change_current_user_password.php | 2 +- admin/company_preferences.php | 4 +- admin/db/company_db.inc | 19 ++++- admin/db/fiscalyears_db.inc | 2 - admin/db/maintenance_db.inc | 25 +++--- admin/db/users_db.inc | 6 +- admin/display_prefs.php | 4 +- admin/inst_chart.php | 2 +- admin/inst_lang.php | 4 +- admin/inst_module.php | 2 +- admin/inst_theme.php | 2 +- admin/inst_upgrade.php | 8 +- admin/print_profiles.php | 6 +- admin/view_print_transaction.php | 2 +- admin/void_transaction.php | 2 +- config.default.php | 60 ++------------ dimensions/inquiry/search_dimensions.php | 2 +- doc/api_changes.txt | 4 +- gl/bank_account_reconcile.php | 2 +- gl/bank_transfer.php | 2 +- gl/gl_bank.php | 2 +- gl/gl_journal.php | 2 +- gl/includes/db/gl_db_rates.inc | 8 +- gl/includes/db/gl_db_trans.inc | 8 +- gl/inquiry/balance_sheet.php | 10 +-- gl/inquiry/bank_inquiry.php | 2 +- gl/inquiry/gl_account_inquiry.php | 2 +- gl/inquiry/gl_trial_balance.php | 4 +- gl/inquiry/journal_inquiry.php | 2 +- gl/inquiry/profit_loss.php | 15 ++-- gl/inquiry/tax_inquiry.php | 2 +- gl/manage/close_period.php | 4 +- gl/manage/exchange_rates.php | 5 +- gl/manage/gl_account_classes.php | 12 +-- includes/access_levels.inc | 2 +- includes/current_user.inc | 45 ++++++----- includes/date_functions.inc | 80 +++++++++--------- includes/db/connect_db_mysql.inc | 25 +++--- includes/db/connect_db_mysqli.inc | 30 ++++--- includes/db/sql_functions.inc | 4 +- includes/db_pager.inc | 8 +- includes/errors.inc | 30 ++++--- includes/main.inc | 12 ++- includes/page/header.inc | 14 ++-- includes/prefs/sysprefs.inc | 25 ++++-- includes/prefs/userprefs.inc | 12 +-- includes/session.inc | 39 ++++++--- includes/system_tests.inc | 7 +- includes/types.inc | 5 +- includes/ui/db_pager_view.inc | 2 +- includes/ui/ui_lists.inc | 81 +++++++------------ includes/ui/ui_view.inc | 14 ++-- inventory/adjustments.php | 2 +- inventory/cost_update.php | 2 +- inventory/inquiry/stock_movements.php | 2 +- inventory/manage/items.php | 14 ++-- inventory/manage/sales_kits.php | 2 +- inventory/transfers.php | 2 +- manufacturing/search_work_orders.php | 2 +- manufacturing/view/wo_costs_view.php | 2 +- manufacturing/view/wo_issue_view.php | 2 +- manufacturing/view/wo_production_view.php | 2 +- manufacturing/view/work_order_view.php | 2 +- manufacturing/work_order_add_finished.php | 8 +- manufacturing/work_order_costs.php | 2 +- manufacturing/work_order_entry.php | 2 +- manufacturing/work_order_issue.php | 2 +- manufacturing/work_order_release.php | 2 +- purchasing/allocations/supplier_allocate.php | 2 +- .../allocations/supplier_allocation_main.php | 2 +- purchasing/inquiry/po_search.php | 2 +- purchasing/inquiry/po_search_completed.php | 2 +- .../inquiry/supplier_allocation_inquiry.php | 2 +- purchasing/inquiry/supplier_inquiry.php | 2 +- purchasing/manage/suppliers.php | 2 +- purchasing/po_entry_items.php | 2 +- purchasing/po_receive_items.php | 2 +- purchasing/supplier_credit.php | 14 +--- purchasing/supplier_invoice.php | 9 +-- purchasing/supplier_payment.php | 2 +- purchasing/view/view_grn.php | 2 +- purchasing/view/view_po.php | 2 +- purchasing/view/view_supp_credit.php | 2 +- purchasing/view/view_supp_invoice.php | 2 +- purchasing/view/view_supp_payment.php | 2 +- reporting/includes/Workbook.php | 6 +- reporting/includes/class.graphic.inc | 19 ++--- reporting/includes/doctext.inc | 2 + reporting/includes/excel_report.inc | 6 +- reporting/includes/pdf_report.inc | 13 ++- reporting/includes/reporting.inc | 4 +- reporting/includes/reports_classes.inc | 6 +- reporting/rep102.php | 6 +- reporting/rep104.php | 8 +- reporting/rep109.php | 4 +- reporting/rep110.php | 3 +- reporting/rep111.php | 12 +-- reporting/rep202.php | 7 +- reporting/rep301.php | 4 +- reporting/rep303.php | 8 +- reporting/rep705.php | 6 +- reporting/rep706.php | 7 +- reporting/rep707.php | 7 +- reporting/rep708.php | 4 +- reporting/rep709.php | 2 +- sales/allocations/customer_allocate.php | 2 +- .../allocations/customer_allocation_main.php | 2 +- sales/create_recurrent_invoices.php | 2 +- sales/credit_note_entry.php | 2 +- sales/customer_credit_invoice.php | 2 +- sales/customer_delivery.php | 2 +- sales/customer_invoice.php | 2 +- sales/customer_payments.php | 2 +- sales/includes/cart_class.inc | 4 +- sales/includes/db/cust_trans_db.inc | 6 +- sales/includes/sales_ui.inc | 4 +- sales/inquiry/customer_allocation_inquiry.php | 2 +- sales/inquiry/customer_inquiry.php | 2 +- sales/inquiry/sales_deliveries_view.php | 2 +- sales/inquiry/sales_orders_view.php | 2 +- sales/manage/customers.php | 14 ++-- sales/manage/recurrent_invoices.php | 2 +- sales/sales_order_entry.php | 2 +- sales/view/view_credit.php | 2 +- sales/view/view_dispatch.php | 2 +- sales/view/view_invoice.php | 2 +- sales/view/view_receipt.php | 2 +- sales/view/view_sales_order.php | 2 +- themes/aqua/renderer.php | 21 ++--- themes/cool/renderer.php | 23 +++--- themes/default/renderer.php | 23 +++--- 136 files changed, 524 insertions(+), 563 deletions(-) diff --git a/access/login.php b/access/login.php index d3154b52..9c58933d 100644 --- a/access/login.php +++ b/access/login.php @@ -21,15 +21,15 @@ function defaultCompany() } "; add_js_file('login.js'); - // Display demo user name and password within login form if "$allow_demo_mode" is true - if ($allow_demo_mode == true) + // Display demo user name and password within login form if allow_demo_mode option is true + if ($SysPrefs->allow_demo_mode == true) { $demo_text = _("Login as user: demouser and password: password"); } else { $demo_text = _("Please login here"); - if (@$allow_password_reset) { + if (@$SysPrefs->allow_password_reset) { $demo_text .= " "._("or")." "._("request new password").""; } } @@ -40,7 +40,7 @@ function defaultCompany() $js .= ""; + document.getElementById('log_msg').innerHTML='$demo_text'}, 1000*".$SysPrefs->login_delay.");"; $demo_text = $blocked_msg; } flush_dir(user_js_cache()); @@ -50,7 +50,7 @@ function defaultCompany() $login_timeout = $_SESSION["wa_current_user"]->last_act; - $title = $login_timeout ? _('Authorization timeout') : $app_title." ".$version." - "._("Login"); + $title = $login_timeout ? _('Authorization timeout') : $SysPrefs->app_title." ".$version." - "._("Login"); $encoding = isset($_SESSION['language']->encoding) ? $_SESSION['language']->encoding : "iso-8859-1"; $rtl = isset($_SESSION['language']->dir) ? $_SESSION['language']->dir : "ltr"; $onload = !$login_timeout ? "onload='defaultCompany()'" : ""; @@ -79,7 +79,7 @@ function defaultCompany() start_row(); echo ""; if (!$login_timeout) { // FA logo - echo "FrontAccounting"; + echo "FrontAccounting"; } else { echo ""._('Authorization timeout').""; } @@ -88,12 +88,12 @@ function defaultCompany() echo "\n"; if (!$login_timeout) - table_section_title(_("Version")." $version Build $build_version - "._("Login")); - $value = $login_timeout ? $_SESSION['wa_current_user']->loginname : ($allow_demo_mode ? "demouser":""); + table_section_title(_("Version")." $version Build ".$SysPrefs->build_version." - "._("Login")); + $value = $login_timeout ? $_SESSION['wa_current_user']->loginname : ($SysPrefs->allow_demo_mode ? "demouser":""); text_row(_("User name"), "user_name_entry_field", $value, 20, 30); - $password = $allow_demo_mode ? "password":""; + $password = $SysPrefs->allow_demo_mode ? "password":""; password_row(_("Password:"), 'password', $password); @@ -104,7 +104,7 @@ function defaultCompany() $coy = $_SESSION['wa_current_user']->company; else $coy = $def_coy; - if (!@$text_company_selection) { + if (!@$SysPrefs->text_company_selection) { echo ""._("Company")."\n"; - table_section_title(_("Version")." $version Build $build_version - "._("Password reset")); + table_section_title(_("Version")." $version Build ".$SysPrefs->build_version." - "._("Password reset")); text_row(_("Email"), "email_entry_field", "", 20, 30); @@ -66,7 +66,7 @@ function defaultCompany() $coy = $_SESSION['wa_current_user']->company; else $coy = $def_coy; - if (!@$text_company_selection) { + if (!@$SysPrefs->text_company_selection) { echo ""._("Company")."