$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');
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":"");
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";
$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');
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";
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;
{
global $def_coy, $db_connections;
- $coyno = $_SESSION["wa_current_user"]->company;
+ $coyno = user_company();
echo "
<script language='javascript'>
{
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);
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
$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;
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');
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();
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)
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');
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');
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;
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)));
}
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)
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;
}
//-------------------------------------------------------------------
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
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)
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');
{
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>";
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);
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);
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);
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);
$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
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'];
$rep->Line($rep->row - 8);
if ($graphics)
{
- global $SysPrefs;
$pg->x = array(_('Current'), $nowdue, $pastdue1, $pastdue2);
$pg->title = $rep->title;
$pg->axis_x = _("Days");
$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;
$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;
$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;
$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;
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);
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']))
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);
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);
$js = '';
-if ($SysPrefs->SysPrefs->use_popup_windows) {
+if ($SysPrefs->use_popup_windows) {
$js .= get_js_open_window(900, 500);
}
$himg = "<img src='$local_path_to_root/themes/aqua/images/help.gif' width='14' height='14' border='0' alt='"._('Help')."'> ";
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> \n";
$himg = "<img src='$local_path_to_root/themes/aqua/images/help.gif' width='14' height='14' border='0' alt='"._('Help')."'> ";
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> \n";
$img = "<img src='$local_path_to_root/themes/default/images/login.gif' width='14' height='14' border='0' alt='"._('Logout')."'> ";
$himg = "<img src='$local_path_to_root/themes/default/images/help.gif' width='14' height='14' border='0' alt='"._('Help')."'> ";
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> \n";