From: Joe Hunt Date: Fri, 6 Nov 2015 15:33:41 +0000 (+0100) Subject: Cleanup comments. Small bugfixes. Second run X-Git-Tag: v2.4.2~19^2~135 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=a2ae0e35302270ae811db2e6acb44c16b186a970;p=fa-stable.git Cleanup comments. Small bugfixes. Second run --- diff --git a/gl/bank_account_reconcile.php b/gl/bank_account_reconcile.php index e7b584b1..55481789 100644 --- a/gl/bank_account_reconcile.php +++ b/gl/bank_account_reconcile.php @@ -9,7 +9,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -/* Author Rob Mallon */ $page_security = 'SA_RECONCILE'; $path_to_root = ".."; include($path_to_root . "/includes/db_pager.inc"); diff --git a/gl/bank_transfer.php b/gl/bank_transfer.php index 3ebc2453..79195b5c 100644 --- a/gl/bank_transfer.php +++ b/gl/bank_transfer.php @@ -94,7 +94,6 @@ function gl_payment_controls($trans_no) $_POST['amount'] = 0; } } - $home_currency = get_company_currency(); start_form(); diff --git a/gl/gl_bank.php b/gl/gl_bank.php index 3d3f86e6..71e2c045 100644 --- a/gl/gl_bank.php +++ b/gl/gl_bank.php @@ -185,7 +185,6 @@ function create_cart($type, $trans_no) // so we have to restore it from original gl amounts $ex_rate = $bank_trans['amount']/$row['amount']; } else { - $date = $row['tran_date']; $cart->add_gl_item( $row['account'], $row['dimension_id'], $row['dimension2_id'], $row['amount'], $row['memo_']); } diff --git a/gl/gl_budget.php b/gl/gl_budget.php index cc1a5eb4..6c2ad64b 100644 --- a/gl/gl_budget.php +++ b/gl/gl_budget.php @@ -46,7 +46,6 @@ if (isset($_POST['add']) || isset($_POST['delete'])) else display_notification_centered(_("The Budget has been deleted.")); - //meta_forward($_SERVER['PHP_SELF']); $Ajax->activate('budget_tbl'); } if (isset($_POST['submit']) || isset($_POST['update'])) @@ -71,7 +70,7 @@ if (db_has_gl_accounts()) dimensions_list_row(_("Dimension")." 1", 'dim1', $_POST['dim1'], true, null, false, 1); dimensions_list_row(_("Dimension")." 2", 'dim2', $_POST['dim2'], true, null, false, 2); } - else if ($dim == 1) + elseif ($dim == 1) { dimensions_list_row(_("Dimension"), 'dim1', $_POST['dim1'], true, null, false, 1); hidden('dim2', 0); diff --git a/gl/manage/close_period.php b/gl/manage/close_period.php index 21a6aaee..07d2d476 100644 --- a/gl/manage/close_period.php +++ b/gl/manage/close_period.php @@ -27,7 +27,7 @@ page(_($help_context = "Closing GL Transactions"), false, false, "", $js); //--------------------------------------------------------------------------------------------- function check_data() { - global $Refs, $SysPrefs; + global $SysPrefs; if (!is_date($_POST['date']) || date1_greater_date2($_POST['date'], Today())) { diff --git a/gl/manage/gl_account_classes.php b/gl/manage/gl_account_classes.php index d02cfdb4..51288781 100644 --- a/gl/manage/gl_account_classes.php +++ b/gl/manage/gl_account_classes.php @@ -116,7 +116,6 @@ table_header($th); $k = 0; while ($myrow = db_fetch($result)) { - alt_table_row_color($k); label_cell($myrow["cid"]); diff --git a/gl/manage/gl_account_types.php b/gl/manage/gl_account_types.php index 04f80c62..0a1791bc 100644 --- a/gl/manage/gl_account_types.php +++ b/gl/manage/gl_account_types.php @@ -44,7 +44,6 @@ function can_process($selected_id) return false; } - //if (strcmp($_POST['id'], $_POST['parent']) == 0) if ($_POST['id'] === $_POST['parent']) { display_error(_("You cannot set an account group to be a subgroup of itself.")); diff --git a/gl/manage/revaluate_currencies.php b/gl/manage/revaluate_currencies.php index f0141418..1dae7eed 100644 --- a/gl/manage/revaluate_currencies.php +++ b/gl/manage/revaluate_currencies.php @@ -46,8 +46,6 @@ if (isset($_GET['AddedID'])) //--------------------------------------------------------------------------------------------- function check_data() { - global $Refs; - if (!is_date($_POST['date'])) { display_error( _("The entered date is invalid.")); diff --git a/gl/view/accrual_trans.php b/gl/view/accrual_trans.php index ab5d08f6..72dda431 100644 --- a/gl/view/accrual_trans.php +++ b/gl/view/accrual_trans.php @@ -52,7 +52,7 @@ $dim = get_company_pref('use_dimension'); $first_cols = array(_("Type"), "#", _("Date")); if ($dim == 2) $dim_cols = array(_("Dimension")." 1", _("Dimension")." 2"); -else if ($dim == 1) +elseif ($dim == 1) $dim_cols = array(_("Dimension")); else $dim_cols = array(); diff --git a/gl/view/gl_deposit_view.php b/gl/view/gl_deposit_view.php index 049ecdfc..767c790c 100644 --- a/gl/view/gl_deposit_view.php +++ b/gl/view/gl_deposit_view.php @@ -103,7 +103,7 @@ else if ($dim == 2) $th = array(_("Account Code"), _("Account Description"), _("Dimension")." 1", _("Dimension")." 2", _("Amount"), _("Memo")); - else if ($dim == 1) + elseif ($dim == 1) $th = array(_("Account Code"), _("Account Description"), _("Dimension"), _("Amount"), _("Memo")); else diff --git a/gl/view/gl_payment_view.php b/gl/view/gl_payment_view.php index 65587407..25f9668b 100644 --- a/gl/view/gl_payment_view.php +++ b/gl/view/gl_payment_view.php @@ -102,7 +102,7 @@ else if ($dim == 2) $th = array(_("Account Code"), _("Account Description"), _("Dimension")." 1", _("Dimension")." 2", _("Amount"), _("Memo")); - else if ($dim == 1) + elseif ($dim == 1) $th = array(_("Account Code"), _("Account Description"), _("Dimension"), _("Amount"), _("Memo")); else diff --git a/gl/view/gl_trans_view.php b/gl/view/gl_trans_view.php index 38ba7f26..0cda6160 100644 --- a/gl/view/gl_trans_view.php +++ b/gl/view/gl_trans_view.php @@ -94,7 +94,7 @@ $dim = get_company_pref('use_dimension'); if ($dim == 2) $th = array(_("Journal Date"), _("Account Code"), _("Account Name"), _("Dimension")." 1", _("Dimension")." 2", _("Debit"), _("Credit"), _("Memo")); -else if ($dim == 1) +elseif ($dim == 1) $th = array(_("Journal Date"), _("Account Code"), _("Account Name"), _("Dimension"), _("Debit"), _("Credit"), _("Memo")); else diff --git a/includes/access_levels.inc b/includes/access_levels.inc index fc3d48df..aee33a6d 100644 --- a/includes/access_levels.inc +++ b/includes/access_levels.inc @@ -53,26 +53,26 @@ define('SS_GL', 62<<8); define('SS_GL_A', 63<<8); $security_sections = array( - SS_SADMIN => _("System administration"), - SS_SETUP => _("Company setup"), - SS_SPEC => _("Special maintenance"), - SS_SALES_C => _("Sales configuration"), - SS_SALES => _("Sales transactions"), - SS_SALES_A => _("Sales related reports"), - SS_PURCH_C => _("Purchase configuration"), - SS_PURCH => _("Purchase transactions"), - SS_PURCH_A => _("Purchase analytics"), - SS_ITEMS_C => _("Inventory configuration"), - SS_ITEMS => _("Inventory operations"), - SS_ITEMS_A => _("Inventory analytics"), - SS_MANUF_C => _("Manufacturing configuration"), - SS_MANUF => _("Manufacturing transactions"), - SS_MANUF_A => _("Manufacturing analytics"), - SS_DIM_C => _("Dimensions configuration"), - SS_DIM => _("Dimensions"), - SS_GL_C => _("Banking & GL configuration"), - SS_GL => _("Banking & GL transactions"), - SS_GL_A => _("Banking & GL analytics") + SS_SADMIN => _("System administration"), + SS_SETUP => _("Company setup"), + SS_SPEC => _("Special maintenance"), + SS_SALES_C => _("Sales configuration"), + SS_SALES => _("Sales transactions"), + SS_SALES_A => _("Sales related reports"), + SS_PURCH_C => _("Purchase configuration"), + SS_PURCH => _("Purchase transactions"), + SS_PURCH_A => _("Purchase analytics"), + SS_ITEMS_C => _("Inventory configuration"), + SS_ITEMS => _("Inventory operations"), + SS_ITEMS_A => _("Inventory analytics"), + SS_MANUF_C => _("Manufacturing configuration"), + SS_MANUF => _("Manufacturing transactions"), + SS_MANUF_A => _("Manufacturing analytics"), + SS_DIM_C => _("Dimensions configuration"), + SS_DIM => _("Dimensions"), + SS_GL_C => _("Banking & GL configuration"), + SS_GL => _("Banking & GL transactions"), + SS_GL_A => _("Banking & GL analytics") ); /* @@ -297,23 +297,6 @@ function add_access_extensions() } } } -/* - Helper function to retrieve extension access definitions in isolated environment. -*/ -/* -function get_access_extensions($id) { - global $path_to_root, $installed_extensions; - - $ext = $installed_extensions[$id]; - - $security_sections = $security_areas = array(); - - if (isset($ext['acc_file'])) - include_once($path_to_root.'/'.$ext['path'].'/'.$ext['acc_file']); - - return array($security_areas, $security_sections); -} -*/ function check_edit_access($name) { diff --git a/includes/ajax.inc b/includes/ajax.inc index f71aaf47..220c0084 100644 --- a/includes/ajax.inc +++ b/includes/ajax.inc @@ -98,52 +98,37 @@ class Ajax extends JsHttpRequest { // function _addCommand($trigger, $aAttributes, $mData) { - if ($this->isActive() && ($trigger !== false)) { -// display_error('adding '.$trigger.':'.htmlentities($mData)); + if ($this->isActive() && ($trigger !== false)) { - $aAttributes['why'] = $trigger; - $aAttributes['data'] = $mData; - $this->aCommands[] = $aAttributes; - } + $aAttributes['why'] = $trigger; + $aAttributes['data'] = $mData; + $this->aCommands[] = $aAttributes; + } } - /* - * Register binds function with ajax call parameter - - function register($trigger, $function) + + function run() { - if (isset($_REQUEST[$trigger])) { - $function(&$this); - } - } - */ - function run() { - if (!$this->isActive()) return; // remove not active commands foreach ($this->aCommands as $idx => $com) { // If we should reload whole page content ignore all commands but the update. // This is page repost equivalent, although header and footer are not reloaded. - if ($com['why'] !== true && !isset($this->triggers[$com['why']])) { - unset($this->aCommands[$idx]); -// display_error('unset '.$com['t']); - } - else - if($com['n'] == 'up' && $com['t'] == '_page_body') { - $cmds = array($com); - foreach( $this->aCommands as $k=> $cmd) { - if ($cmd['n'] == 'fc' || $cmd['n'] == 'js') { // save focus - $cmds[] = $cmd; //break; - } - } - $this->aCommands = $cmds; - break; - } + if ($com['why'] !== true && !isset($this->triggers[$com['why']])) { + unset($this->aCommands[$idx]); + } + elseif($com['n'] == 'up' && $com['t'] == '_page_body') { + $cmds = array($com); + foreach( $this->aCommands as $k=> $cmd) { + if ($cmd['n'] == 'fc' || $cmd['n'] == 'js') { // save focus + $cmds[] = $cmd; //break; + } + } + $this->aCommands = $cmds; + break; + } } -// display_error('Activate:'.htmlentities(print_r($this->triggers, true))); -// display_error('Commands :'.htmlentities(print_r($this->aCommands, true))); $GLOBALS['_RESULT'] = $this->aCommands; -// exit(); } } diff --git a/includes/current_user.inc b/includes/current_user.inc index 62d729b6..9a0cedde 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -304,7 +304,7 @@ function number_format2($number, $decimals=0) global $SysPrefs; $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))); else { @@ -414,12 +414,12 @@ function user_numeric($input) { $num = str_replace( $sep, '.', $num); if (!is_numeric($num)) - return false; + return false; $num = (float)$num; if ($num == (int)$num) - return (int)$num; + return (int)$num; else - return $num; + return $num; } function user_company() diff --git a/includes/db/connect_db_mysql.inc b/includes/db/connect_db_mysql.inc index aa30740f..56e36a0a 100644 --- a/includes/db/connect_db_mysql.inc +++ b/includes/db/connect_db_mysql.inc @@ -33,7 +33,7 @@ function set_global_connection($company=-1) ///// This non empty sql_mode values can interphere with FA, so all is set empty during ///// our sessions. ///// We are, however, investigating the existing code to be compatible in the future. - db_query("SET sql_mode = '".SQL_MODE."'"); + db_query("SET sql_mode = '".SQL_MODE."'"); ///// $SysPrefs->refresh(); return $db; diff --git a/includes/db/connect_db_mysqli.inc b/includes/db/connect_db_mysqli.inc index 30e3f6c7..897316d6 100644 --- a/includes/db/connect_db_mysqli.inc +++ b/includes/db/connect_db_mysqli.inc @@ -36,7 +36,7 @@ function set_global_connection($company=-1) ///// This non empty sql_mode values can interphere with FA, so all is set empty during ///// our sessions. ///// We are, however, investigating the existing code to be compatible in the future. - db_query("SET sql_mode = '".SQL_MODE."'"); + db_query("SET sql_mode = '".SQL_MODE."'"); ///// $SysPrefs->refresh(); return $db; diff --git a/includes/db/manufacturing_db.inc b/includes/db/manufacturing_db.inc index 8adddc69..0a4035f0 100644 --- a/includes/db/manufacturing_db.inc +++ b/includes/db/manufacturing_db.inc @@ -50,7 +50,7 @@ function load_stock_levels($location) return $qoh_stock; } -// recursion fixed by Tom Moulton. Max 10 recursion levels. +// recursion fixed. Max 10 recursion levels. function stock_demand_manufacture($stock_id, $qty, $demand_id, $location, $level=0) { global $bom_list, $qoh_stock; diff --git a/includes/db_pager.inc b/includes/db_pager.inc index 70243392..ff31c1df 100644 --- a/includes/db_pager.inc +++ b/includes/db_pager.inc @@ -119,11 +119,6 @@ class db_pager { } } } - //_vd($this->select); - //_vd($this->from); - //_vd($this->where); - //_vd($this->group); - //_vd($this->order); } // // Set additional constraint on record set @@ -193,22 +188,22 @@ class db_pager { if ($result) { // setting field names for subsequent queries $c = 0; - // add result field names to column defs for - // col value retrieve and sort purposes - $cnt = min(db_num_fields($result), count($this->columns)); + // add result field names to column defs for + // col value retrieve and sort purposes + $cnt = min(db_num_fields($result), count($this->columns)); for ($c = $i = 0; $c < $cnt; $c++) { if (!(isset($this->columns[$c]['insert']) && $this->columns[$c]['insert'])) { // if (!@($this->columns[$c]['type']=='skip')) $this->columns[$c]['name']= db_field_name($result, $i); if (!@($this->columns[$c]['type']=='insert')) - $i++; - } + $i++; + } } while ($row = db_fetch_assoc($result)) { $this->data[] = $row; } } else - return false; + return false; return true; } // @@ -217,29 +212,29 @@ class db_pager { function set_page($to) { switch($to) { - case 'next': - $page = $this->curr_page+1; break; - case 'prev': - $page = $this->curr_page-1; break; - case 'last': - $page = $this->last_page; break; - default: - if (is_numeric($to)) { - $page = $to; break; - } - case 'first': - $page = 1; break; + case 'next': + $page = $this->curr_page+1; break; + case 'prev': + $page = $this->curr_page-1; break; + case 'last': + $page = $this->last_page; break; + default: + if (is_numeric($to)) { + $page = $to; break; + } + case 'first': + $page = 1; break; } - if ($page < 1) - $page = 1; - $max = $this->max_page; - if ($page > $max) - $page = $max; - $this->curr_page = $page; - $this->next_page = ($page < $max) ? $page+1 : null; - $this->prev_page = ($page > 1) ? ($page-1) : null; - $this->last_page = ($page < $max) ? $max : null; - $this->first_page = ($page != 1) ? 1: null; + if ($page < 1) + $page = 1; + $max = $this->max_page; + if ($page > $max) + $page = $max; + $this->curr_page = $page; + $this->next_page = ($page < $max) ? $page+1 : null; + $this->prev_page = ($page > 1) ? ($page-1) : null; + $this->last_page = ($page < $max) ? $max : null; + $this->first_page = ($page != 1) ? 1: null; } // // Set column definitions @@ -252,8 +247,8 @@ class db_pager { } foreach ($flds as $colnum=>$coldef) { if (is_string($colnum)) { // 'colname'=>params - $h = $colnum; - $c = $coldef; + $h = $colnum; + $c = $coldef; } else { // n=>params if (is_array($coldef)) { $h = ''; @@ -264,10 +259,10 @@ class db_pager { } } if (is_string($c)) // params is simple column type - $c = array('type'=>$c); + $c = array('type'=>$c); if (!isset($c['type'])) - $c['type'] = 'text'; + $c['type'] = 'text'; switch($c['type']) { case 'inactive': @@ -307,12 +302,12 @@ class db_pager { if ($group) $sql.= " GROUP BY $group"; $ord = array(); - // sort order column by priority instead of table order. - $columns = array(); + // sort order column by priority instead of table order. + $columns = array(); foreach ($this->columns as $col) { - if(isset($col['ord_priority'])) { - $columns[$col['ord_priority']] = $col; - } + if(isset($col['ord_priority'])) { + $columns[$col['ord_priority']] = $col; + } } krsort($columns); @@ -435,9 +430,6 @@ class db_pager { function inactive_control_cell(&$row) { if ($this->inactive_ctrl) { -// return inactive_control_cell($row[$this->inactive_ctrl['key']], -// $row['inactive'], $this->inactive_ctrl['table'], -// $this->inactive_ctrl['key']); global $Ajax; diff --git a/includes/errors.inc b/includes/errors.inc index 937270ea..2a1aedd9 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -93,46 +93,45 @@ function error_handler($errno, $errstr, $file, $line) { function fmt_errors($center=false) { global $messages, $path_to_root, $SysPrefs; - $msg_class = array( - E_USER_ERROR => 'err_msg', - E_USER_WARNING =>'warn_msg', - E_USER_NOTICE => 'note_msg'); - - $type = E_USER_NOTICE; - $content = ''; -// $class = 'no_msg'; - if (count($messages)) { - foreach($messages as $cnt=>$msg) { - if ($SysPrefs->go_debug && $msg[0]>E_USER_NOTICE) - $msg[0] = E_ERROR; - - if ($msg[0]>$type) continue; - - if ($msg[0]<$type) { - if ($msg[0] == E_USER_WARNING) { - $type = E_USER_WARNING; // user warnings - $content = ''; // clean notices when we have errors - } else { - $type = E_USER_ERROR; // php or user errors - if($type == E_USER_WARNING) - $content = ''; // clean other messages + $msg_class = array( + E_USER_ERROR => 'err_msg', + E_USER_WARNING =>'warn_msg', + E_USER_NOTICE => 'note_msg'); + + $type = E_USER_NOTICE; + $content = ''; + + if (count($messages)) { + foreach($messages as $cnt=>$msg) { + if ($SysPrefs->go_debug && $msg[0]>E_USER_NOTICE) + $msg[0] = E_ERROR; + + if ($msg[0]>$type) continue; + + if ($msg[0]<$type) { + if ($msg[0] == E_USER_WARNING) { + $type = E_USER_WARNING; // user warnings + $content = ''; // clean notices when we have errors + } else { + $type = E_USER_ERROR; // php or user errors + if($type == E_USER_WARNING) + $content = ''; // clean other messages + } } - } - $str = $msg[1]; - if (!in_array($msg[0], array(E_USER_NOTICE, E_USER_ERROR, E_USER_WARNING)) && $msg[2] != null) - $str .= ' '._('in file').': '.$msg[2].' '._('at line ').$msg[3]; + $str = $msg[1]; + if (!in_array($msg[0], array(E_USER_NOTICE, E_USER_ERROR, E_USER_WARNING)) && $msg[2] != null) + $str .= ' '._('in file').': '.$msg[2].' '._('at line ').$msg[3]; - if ($SysPrefs->go_debug>1 && $type!=E_USER_NOTICE && $type!=E_USER_WARNING) - $str .= '
'.$msg[4]; - $content .= ($cnt ? '
' : '').$str; - } - $class = $msg_class[$type]; - $content = "
$content
"; - } else - if ($path_to_root=='.') - return ''; - return $content; + if ($SysPrefs->go_debug>1 && $type!=E_USER_NOTICE && $type!=E_USER_WARNING) + $str .= '
'.$msg[4]; + $content .= ($cnt ? '
' : '').$str; + } + $class = $msg_class[$type]; + $content = "
$content
"; + } elseif ($path_to_root=='.') + return ''; + return $content; } //----------------------------------------------------------------------------- // Error box
element. @@ -142,7 +141,7 @@ function error_box() { echo "
"; -// Necessary restart instead of get_contents/clean calls due to a bug in php 4.3.2 + // Necessary restart instead of get_contents/clean calls due to a bug in php 4.3.2 $before_box = ob_get_clean(); // save html content before error box ob_start('output_html'); echo "
"; @@ -173,7 +172,6 @@ function display_db_error($msg, $sql_statement=null, $exit=true) $warning = $msg==null; $db_error = db_error_no(); -// $str = "" . _("DATABASE ERROR :") . " $msg
"; if($warning) $str = "" . _("Debug mode database warning:") . "
"; else @@ -190,7 +188,6 @@ function display_db_error($msg, $sql_statement=null, $exit=true) $cur_prefix = $db_connections[$_SESSION["wa_current_user"]->cur_con]['tbpref']; $str .= "sql that failed was : ".str_replace(TB_PREF, $cur_prefix, $sql_statement)."
"; -// if ($SysPrefs->go_debug > 1) display_backtrace(); } $str .= "

"; @@ -226,12 +223,12 @@ function check_db_error($msg, $sql_statement, $exit_if_error=true, $rollback_if_ { if ($SysPrefs->go_debug || !frindly_db_error($db_error)) { - display_db_error($msg, $sql_statement, false); + display_db_error($msg, $sql_statement, false); } if ($rollback_if_error) { - $rollback_result = db_query("rollback"); + $rollback_result = db_query("rollback"); } if ($exit_if_error) diff --git a/includes/hooks.inc b/includes/hooks.inc index cb5cddfa..6c6dda32 100644 --- a/includes/hooks.inc +++ b/includes/hooks.inc @@ -203,9 +203,9 @@ class hooks { * more than one in the cart. */ /* Default behavior check if there is enough quantity on hand and change the css - * class if needed */ + * class if needed */ static function default_get_dispatchable_quantity($line_item, $location, $date, $qoh) { - global $SysPrefs; + global $SysPrefs; if ($SysPrefs->allow_negative_stock() || ($line_item->qty_dispatched <= $qoh)) { return true; @@ -237,10 +237,10 @@ function install_hooks() } // install hooks provided by active extensions foreach($installed_extensions as $ext) { - $hook_class = 'hooks_'.$ext['package']; - if ($ext['active'] && class_exists($hook_class)) { - $Hooks[$ext['package']] = new $hook_class; - } + $hook_class = 'hooks_'.$ext['package']; + if ($ext['active'] && class_exists($hook_class)) { + $Hooks[$ext['package']] = new $hook_class; + } } } /* diff --git a/includes/lang/gettext.inc b/includes/lang/gettext.inc index cabd6099..9f1a8381 100644 --- a/includes/lang/gettext.inc +++ b/includes/lang/gettext.inc @@ -20,8 +20,6 @@ // Authors: Laurent Bedubourg // -//require_once "PEAR.php"; - define('GETTEXT_NATIVE', 1); define('GETTEXT_PHP', 2); @@ -72,9 +70,6 @@ class gettext_native_support putenv("LC_ALL=$lang_code"); putenv("LANGUAGE=$lang_code"); - //$set = setlocale(LC_ALL, "$lang_code"); - //$set = setlocale(LC_ALL, "$encoding"); - // cover a couple of country/encoding variants $up = strtoupper($encoding); $low = strtolower($encoding); @@ -95,11 +90,8 @@ class gettext_native_support return 0; $str = sprintf('language code "%s", encoding "%s" not supported by your system', $lang_code, $encoding); - //$err = new GetText_Error($str); - //return PEAR::raise_error($err); return raise_error("1 " . $str); } - //return 0; } /** * Check system support for given language nedded for gettext. @@ -193,8 +185,6 @@ class gettext_native_support $value = $this->_get_translation($key); if ($value === false) { $str = sprintf('Unable to locate gettext key "%s"', $key); - //$err = new GetText_Error($str); - //return PEAR::raise_error($err); return raise_error("2 " . $str); } @@ -276,9 +266,6 @@ class gettext_php_support extends gettext_native_support list($domain, $path) = array_shift($this->_jobs); $err = $this->add_domain($domain, $path); // error raised, break jobs - /*if (PEAR::is_error($err)) { - return $err; - }*/ if (is_error($err)) { return $err; @@ -352,8 +339,6 @@ class gettext_php_support extends gettext_native_support if (!file_exists($src_domain)) { $str = sprintf('Domain file "%s" not found.', $src_domain); - //$err = new GetText_Error($str); - //return PEAR::raise_error($err); return raise_error("4 " . $str); } @@ -370,9 +355,6 @@ class gettext_php_support extends gettext_native_support { $comp = new gettext_php_support_compiler(); $err = $comp->compile($hash, $src_domain); - /*if (PEAR::is_error($err)) { - return $err; - }*/ if (is_error($err)) { return $err; @@ -454,8 +436,6 @@ class gettext_php_support_parser if (!file_exists($file)) { $str = sprintf('Unable to locate file "%s"', $file); - //$err = new GetText_Error($str); - //return PEAR::raise_error($err); return raise_error($str); } $i = 0; @@ -530,8 +510,6 @@ class gettext_php_support_compiler if (!$fp) { $str = sprintf('Unable to open "%s" in write mode.', $dest_path); - //$err = new GetText_Error($str); - //return PEAR::raise_error($err); return raise_error($str); } fwrite($fp, ' @$pkg['DefaultStatus'] == 'active' ? true : false, 'path' => $pkg['InstallPath'], ); -// if (isset($pkg['MenuTabs'])) -// $ext['tabs'] = $pkg['MenuTabs']; -// if (isset($pkg['MenuEntries'])) -// $ext['entries'] = $pkg['MenuEntries']; -// if (isset($pkg['AccessExtensions'])) -// $ext['acc_file'] = $pkg['AccessExtensions']; if (isset($pkg['SqlScript'])) $ext['sql'] = $pkg['SqlScript']; diff --git a/includes/page/header.inc b/includes/page/header.inc index 3661c7cf..793adc03 100644 --- a/includes/page/header.inc +++ b/includes/page/header.inc @@ -78,11 +78,6 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js="" if (in_ajax()) return; // just for speed up -// $jsext = substr_replace($_SERVER['PHP_SELF'], '.js', -4); - -// if (file_exists($_SERVER['DOCUMENT_ROOT'].$jsext)) -// add_js_ufile($jsext); - $theme = user_theme(); if ($SysPrefs->help_base_url != null && $SysPrefs->use_popup_windows && $js == '') @@ -94,7 +89,7 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js="" add_js_source(get_js_open_window(900, 500)); } if ($js!='') - add_js_source($js); + add_js_source($js); if (!isset($no_menu)) { diff --git a/includes/session.inc b/includes/session.inc index e2a7fca2..3ec67df1 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -148,12 +148,12 @@ function password_reset_fail() { global $path_to_root; - echo "


" . _("Incorrect Email") . "

"; - echo "" . _("The email address does not exist in the system, or is used by more than one user.") . "

"; + echo "


" . _("Incorrect Email") . "

"; + echo "" . _("The email address does not exist in the system, or is used by more than one user.") . "

"; - echo _("Plase try again or contact your system administrator to obtain new password."); - echo "
" . _("Try again") . ""; - echo "
"; + echo _("Plase try again or contact your system administrator to obtain new password."); + echo "
" . _("Try again") . ""; + echo "
"; kill_login(); die(); @@ -163,11 +163,11 @@ function password_reset_success() { global $path_to_root; - echo "


" . _("New password sent") . "

"; - echo "" . _("A new password has been sent to your mailbox.") . "

"; + echo "


" . _("New password sent") . "

"; + echo "" . _("A new password has been sent to your mailbox.") . "

"; - echo "
" . _("Login here") . ""; - echo "
"; + echo "
" . _("Login here") . ""; + echo "
"; kill_login(); die(); diff --git a/includes/types.inc b/includes/types.inc index e1206bcf..b3d4c71a 100644 --- a/includes/types.inc +++ b/includes/types.inc @@ -131,8 +131,6 @@ function payment_person_name($type, $person_id, $full=true) { case PT_SUPPLIER : return ($full ? $payment_person_types[$type] . " ":"") . sprintf("[%05s] %s", $person_id, get_supplier_name($person_id)); default : - //DisplayDBerror("Invalid type sent to person_name"); - //return; return ''; } } diff --git a/includes/ui/allocation_cart.inc b/includes/ui/allocation_cart.inc index 954209a6..4519db73 100644 --- a/includes/ui/allocation_cart.inc +++ b/includes/ui/allocation_cart.inc @@ -278,15 +278,14 @@ function show_allocatable($show_totals) { global $systypes_array; - $k = $counter = $total_allocated = 0; + $k = $total_allocated = 0; $cart = $_SESSION['alloc']; $supp_ref = in_array($cart->type, array(ST_SUPPCREDIT, ST_SUPPAYMENT, ST_BANKPAYMENT)); if (count($cart->allocs)) { -// if ($cart->currency != $cart->person_curr) - display_heading(sprintf(_("Allocated amounts in %s:"), $cart->person_curr)); + display_heading(sprintf(_("Allocated amounts in %s:"), $cart->person_curr)); start_table(TABLESTYLE, "width='60%'"); $th = array(_("Transaction Type"), _("#"), $supp_ref ? _("Supplier Ref"): _("Ref"), _("Date"), _("Due Date"), _("Amount"), _("Other Allocations"), _("Left to Allocate"), _("This Allocation"),'',''); @@ -324,15 +323,7 @@ function show_allocatable($show_totals) { if ($show_totals) { label_row(_("Total Allocated"), price_format($total_allocated), "colspan=8 align=right", "align=right id='total_allocated'", 3); -/* - $amount = $_SESSION['alloc']->amount; - if ($_SESSION['alloc']->type == ST_SUPPCREDIT - || $_SESSION['alloc']->type == ST_SUPPAYMENT - || $_SESSION['alloc']->type == ST_BANKPAYMENT || - ($_SESSION['alloc']->type == ST_JOURNAL && $_SESSION['alloc']->person_type == PT_SUPPLIER)) - $amount = -$amount; -*/ $amount = abs($cart->amount); if (floatcmp($amount, $total_allocated) < 0) @@ -384,13 +375,7 @@ function check_allocations() $total_allocated += input_num('amount' . $counter); } -/* - $amount = $_SESSION['alloc']->amount; - if (in_array($_SESSION['alloc']->type, array(ST_BANKPAYMENT, ST_SUPPCREDIT, ST_SUPPAYMENT)) || - ($_SESSION['alloc']->type==ST_JOURNAL && $_SESSION['alloc']->person_type == PT_SUPPLIER)) - $amount = -$amount; -*/ $amount = abs($_SESSION['alloc']->amount); if ($total_allocated - ($amount + input_num('discount')) > $SysPrefs->allocation_settled_allowance()) diff --git a/includes/ui/class.reflines_crud.inc b/includes/ui/class.reflines_crud.inc index 46b4d4dc..5871e489 100644 --- a/includes/ui/class.reflines_crud.inc +++ b/includes/ui/class.reflines_crud.inc @@ -30,7 +30,7 @@ class fa_reflines extends simple_crud_view { function list_view($Mode) { - global $Ajax, $systypes_array; + global $systypes_array; start_table(TABLESTYLE); diff --git a/includes/ui/contacts_view.inc b/includes/ui/contacts_view.inc index bd25e282..d27b8faa 100644 --- a/includes/ui/contacts_view.inc +++ b/includes/ui/contacts_view.inc @@ -35,13 +35,11 @@ class contacts extends simple_crud { br(); $contacts = get_crm_persons($this->class, $this->subclass, $this->entity); -// check_value('show_inactive')); start_table(TABLESTYLE, "width='80%'"); $th = array(_('Assignment'), _("Reference"), _("Full Name"), _("Phone"), _("Sec Phone"), _("Fax"), _("email"), '', " "); - // inactive_control_column($th); table_header($th); $k = 0; @@ -59,11 +57,10 @@ class contacts extends simple_crud { label_cell($last["phone2"]); label_cell($last["fax"]); email_cell($last["email"]); - // inactive_control_cell($myrow["id"], $myrow["inactive"], 'crm_contacts', 'id'); edit_button_cell("{$this->name}Edit[{$last['id']}]", _("Edit")); - // delete button removes only category unless this is the last contact for this person + // delete button removes only category unless this is the last contact for this person delete_button_cell("{$this->name}Delete[{$last['id']}]", _("Delete")); end_row(); $description = array(); @@ -76,7 +73,7 @@ class contacts extends simple_crud { } } -//inactive_control_row($th); + //inactive_control_row($th); end_table(1); } diff --git a/includes/ui/db_pager_view.inc b/includes/ui/db_pager_view.inc index bb6574be..28c2b38d 100644 --- a/includes/ui/db_pager_view.inc +++ b/includes/ui/db_pager_view.inc @@ -132,7 +132,6 @@ function display_db_pager(&$pager) { if(get_post('show_inactive')) $pager->inactive_control_cell($row); break; default: -// case 'text': if (isset( $col['align'])) label_cell($cell, "align='" . $col['align'] . "'"); else @@ -188,7 +187,7 @@ function display_db_pager(&$pager) { echo $inact; echo ""; } else { - label_cell( _('No records') . $inact, "colspan=$colspan class='navibar'"); + label_cell( _('No records') . $inact, "colspan=$colspan class='navibar'"); } end_row(); diff --git a/includes/ui/items_cart.inc b/includes/ui/items_cart.inc index f517edd9..1b61f5a1 100644 --- a/includes/ui/items_cart.inc +++ b/includes/ui/items_cart.inc @@ -379,8 +379,7 @@ class items_cart // do not post exchange variations to AR/AP (journal in not customer/supplier currency) if ($gl->person_type_id==PT_SUPPLIER && (get_supplier_currency($gl->person_id) == $this->currency || $this->currency != $home_currency)) $supp_trans[$gl->person_id] = @$supp_trans[$gl->person_id] + $gl->amount; - else - if ($gl->person_type_id==PT_CUSTOMER && (get_customer_currency(null, $gl->branch_id) == $this->currency || $this->currency != $home_currency)) + elseif ($gl->person_type_id==PT_CUSTOMER && (get_customer_currency(null, $gl->branch_id) == $this->currency || $this->currency != $home_currency)) $cust_trans[$gl->branch_id] = @$cust_trans[$gl->branch_id] + $gl->amount; } diff --git a/includes/ui/simple_crud_class.inc b/includes/ui/simple_crud_class.inc index daf93321..05d92801 100644 --- a/includes/ui/simple_crud_class.inc +++ b/includes/ui/simple_crud_class.inc @@ -106,8 +106,6 @@ class simple_crud { { global $Ajax; - $sel_name = $this->name.'_id'; - // list controls lookup foreach (array_keys($this->pre_handlers) as $m) { if (isset($_POST[$this->name.$m])) { @@ -211,9 +209,9 @@ class simple_crud { if ($async === 'both') { $async = 'default'; $cancel = 'cancel'; } - else if ($async === 'default') + elseif ($async === 'default') $cancel = true; - else if ($async === 'cancel') + elseif ($async === 'cancel') $async = true; echo "
"; diff --git a/includes/ui/ui_controls.inc b/includes/ui/ui_controls.inc index b3107a1d..54712f9c 100644 --- a/includes/ui/ui_controls.inc +++ b/includes/ui/ui_controls.inc @@ -134,7 +134,6 @@ function table_section($number=1, $width=false) echo "\n"; output_hidden(); $width = ($width ? "width='$width'" : ""); - //echo "\n"; // outer table echo "\n"; // outer table } echo "\n"; diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index aa57475c..feb136ff 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -215,9 +215,9 @@ function submit_add_or_update($add=true, $title=false, $async=false, $clone=fals elseif ($async === 'upgrade') { $async = 'default nonajax process'; $cancel = 'cancel'; } - else if ($async === 'default') + elseif ($async === 'default') $cancel = true; - else if ($async === 'cancel') + elseif ($async === 'cancel') $async = true; if ($add) @@ -928,26 +928,6 @@ function textarea_row($label, $name, $value, $cols, $rows, $title=null, $params= echo "\n"; } -//----------------------------------------------------------------------------------- -/* -function text_row_with_submit($label, $name, $value, $size, $max, $input_name, $input_value) -{ - global $Ajax; - - default_focus($name); - echo "\n"; - echo "\n"; - $Ajax->addUpdate($name, $name, $value); -} -*/ //----------------------------------------------------------------------------------- // // When show_inactive page option is set diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index d108986f..4fc34b91 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -180,8 +180,6 @@ $opts = array( // default options $found = false; $lastcat = null; $edit = false; -//if($name=='stock_id') display_notification('
'.print_r($_POST, true).'
'); -//if($name=='curr_default') display_notification($opts['search_submit']); if($result = db_query($sql)) { while ($contact_row = db_fetch($result)) { $value = $contact_row[0]; @@ -229,8 +227,6 @@ $opts = array( // default options if ($spec_option !== false) { // if special option used - add it $first_id = $spec_id; $first_opt = $spec_option; -// } -// if($first_id !== false) { $sel = $found===false ? 'selected' : ''; $optclass = @$contact_row['inactive'] ? "class='inactive'" : ''; $selector = "\n" @@ -356,19 +352,18 @@ $opts = array( // default options $selector = $first_opt = ''; $first_id = false; $found = false; -//if($name=='SelectStockFromList') display_error($sql); - foreach($items as $value=>$descr) { - $sel = ''; - if (in_array((string)$value, $selected_id, true)) { - $sel = 'selected'; - $found = $value; - } - if ($first_id === false) { - $first_id = $value; - $first_opt = $descr; - } - $selector .= "\n"; + foreach($items as $value=>$descr) { + $sel = ''; + if (in_array((string)$value, $selected_id, true)) { + $sel = 'selected'; + $found = $value; + } + if ($first_id === false) { + $first_id = $value; + $first_opt = $descr; } + $selector .= "\n"; + } if ($first_id!==false) { $sel = ($found===$first_id) || ($found===false && ($spec_option===false)) ? "selected='selected'" : ''; @@ -590,12 +585,12 @@ function locations_list($name, $selected_id=null, $all_option=false, $submit_on_ $sql = "SELECT loc_code, location_name, inactive FROM ".TB_PREF."locations"; -return combo_input($name, $selected_id, $sql, 'loc_code', 'location_name', - array( - 'spec_option' => $all_option === true ? _("All Locations") : $all_option, - 'spec_id' => ALL_TEXT, - 'select_submit'=> $submit_on_change - ) ); + return combo_input($name, $selected_id, $sql, 'loc_code', 'location_name', + array( + 'spec_option' => $all_option === true ? _("All Locations") : $all_option, + 'spec_id' => ALL_TEXT, + 'select_submit'=> $submit_on_change + ) ); } function locations_list_cells($label, $name, $selected_id=null, $all_option=false, $submit_on_change=false) @@ -620,13 +615,13 @@ function currencies_list($name, $selected_id=null, $submit_on_change=false) { $sql = "SELECT curr_abrev, currency, inactive FROM ".TB_PREF."currencies"; -// default to the company currency -return combo_input($name, $selected_id, $sql, 'curr_abrev', 'currency', - array( - 'select_submit'=> $submit_on_change, - 'default' => get_company_currency(), - 'async' => false - ) ); + // default to the company currency + return combo_input($name, $selected_id, $sql, 'curr_abrev', 'currency', + array( + 'select_submit'=> $submit_on_change, + 'default' => get_company_currency(), + 'async' => false + ) ); } function currencies_list_cells($label, $name, $selected_id=null, $submit_on_change=false) @@ -652,16 +647,16 @@ function fiscalyears_list($name, $selected_id=null, $submit_on_change=false) $sql = "SELECT * FROM ".TB_PREF."fiscal_year"; -// default to the company current fiscal year + // default to the company current fiscal year -return combo_input($name, $selected_id, $sql, 'id', '', - array( - 'order' => 'begin', - 'default' => get_company_pref('f_year'), - 'format' => '_format_fiscalyears', - 'select_submit'=> $submit_on_change, - 'async' => false - ) ); + return combo_input($name, $selected_id, $sql, 'id', '', + array( + 'order' => 'begin', + 'default' => get_company_pref('f_year'), + 'format' => '_format_fiscalyears', + 'select_submit'=> $submit_on_change, + 'async' => false + ) ); } function _format_fiscalyears($row) @@ -690,14 +685,14 @@ function fiscalyears_list_row($label, $name, $selected_id=null) function dimensions_list($name, $selected_id=null, $no_option=false, $showname=' ', $submit_on_change=false, $showclosed=false, $showtype=1) { -$sql = "SELECT id, CONCAT(reference,' ',name) as ref FROM ".TB_PREF."dimensions"; + $sql = "SELECT id, CONCAT(reference,' ',name) as ref FROM ".TB_PREF."dimensions"; -$options = array( - 'order' => 'reference', - 'spec_option'=>$no_option ? $showname : false, - 'spec_id' => 0, - 'select_submit'=> $submit_on_change, - 'async' => false, + $options = array( + 'order' => 'reference', + 'spec_option'=>$no_option ? $showname : false, + 'spec_id' => 0, + 'select_submit'=> $submit_on_change, + 'async' => false, ); if (!$showclosed) @@ -740,22 +735,22 @@ function stock_items_list($name, $selected_id=null, $all_option=false, set_editor('item', $name, $editkey); $ret = combo_input($name, $selected_id, $sql, 'stock_id', 's.description', - array_merge( - array( - 'format' => '_format_stock_items', - 'spec_option' => $all_option===true ? _("All Items") : $all_option, - 'spec_id' => ALL_TEXT, - 'search_box' => true, - 'search' => array("stock_id", "c.description","s.description"), - 'search_submit' => get_company_pref('no_item_list')!=0, - 'size'=>10, - 'select_submit'=> $submit_on_change, - 'category' => 2, - 'order' => array('c.description','stock_id'), - 'editlink' => $editkey ? add_edit_combo('item') : false, - 'editable' => false, - 'max' => 255 - ), $opts) ); + array_merge( + array( + 'format' => '_format_stock_items', + 'spec_option' => $all_option===true ? _("All Items") : $all_option, + 'spec_id' => ALL_TEXT, + 'search_box' => true, + 'search' => array("stock_id", "c.description","s.description"), + 'search_submit' => get_company_pref('no_item_list')!=0, + 'size'=>10, + 'select_submit'=> $submit_on_change, + 'category' => 2, + 'order' => array('c.description','stock_id'), + 'editlink' => $editkey ? add_edit_combo('item') : false, + 'editable' => false, + 'max' => 255 + ), $opts) ); return $ret; } @@ -808,21 +803,21 @@ function sales_items_list($name, $selected_id=null, $all_option=false, $sql .= " GROUP BY i.item_code"; return combo_input($name, $selected_id, $sql, 'i.item_code', 'c.description', - array_merge( - array( - 'format' => '_format_stock_items', - 'spec_option' => $all_option===true ? _("All Items") : $all_option, - 'spec_id' => ALL_TEXT, - 'search_box' => true, - 'search' => array("i.item_code", "c.description", "i.description"), - 'search_submit' => get_company_pref('no_item_list')!=0, - 'size'=>15, - 'select_submit'=> $submit_on_change, - 'category' => 2, - 'order' => array('c.description','i.item_code'), - 'editable' => 30, - 'max' => 255 - ), $opts) ); + array_merge( + array( + 'format' => '_format_stock_items', + 'spec_option' => $all_option===true ? _("All Items") : $all_option, + 'spec_id' => ALL_TEXT, + 'search_box' => true, + 'search' => array("i.item_code", "c.description", "i.description"), + 'search_submit' => get_company_pref('no_item_list')!=0, + 'size'=>15, + 'select_submit'=> $submit_on_change, + 'category' => 2, + 'order' => array('c.description','i.item_code'), + 'editable' => 30, + 'max' => 255 + ), $opts) ); } function sales_items_list_cells($label, $name, $selected_id=null, $all_option=false, $submit_on_change=false, $editkey=false) @@ -935,16 +930,7 @@ function stock_purchasable_items_list_cells($label, $name, $selected_id=null, 'editable' => 30, 'cells'=>true), $editkey); } -/* -function stock_purchasable_items_list_row($label, $name, $selected_id=null, - $all_option=false, $submit_on_change=false, $editkey=false) -{ - echo ""; - stock_purchasable_items_list_cells(null, $name, $selected_id=null, - $all_option, $submit_on_change, $editkey); - echo "\n"; -} -*/ + //------------------------------------------------------------------------------------ function stock_item_types_list_row($label, $name, $selected_id=null, $enabled=true) @@ -986,12 +972,12 @@ function tax_types_list($name, $selected_id=null, $none_option=false, $submit_on $sql = "SELECT id, CONCAT(name, ' (',rate,'%)') as name FROM ".TB_PREF."tax_types"; return combo_input($name, $selected_id, $sql, 'id', 'name', - array( - 'spec_option' => $none_option, - 'spec_id' => ALL_NUMERIC, - 'select_submit'=> $submit_on_change, - 'async' => false, - ) ); + array( + 'spec_option' => $none_option, + 'spec_id' => ALL_NUMERIC, + 'select_submit'=> $submit_on_change, + 'async' => false, + ) ); } function tax_types_list_cells($label, $name, $selected_id=null, $none_option=false, @@ -1020,13 +1006,13 @@ function tax_groups_list($name, $selected_id=null, $sql = "SELECT id, name FROM ".TB_PREF."tax_groups"; return combo_input($name, $selected_id, $sql, 'id', 'name', - array( - 'order' => 'id', - 'spec_option' => $none_option, - 'spec_id' => ALL_NUMERIC, - 'select_submit'=> $submit_on_change, - 'async' => false, - ) ); + array( + 'order' => 'id', + 'spec_option' => $none_option, + 'spec_id' => ALL_NUMERIC, + 'select_submit'=> $submit_on_change, + 'async' => false, + ) ); } function tax_groups_list_cells($label, $name, $selected_id=null, $none_option=false, $submit_on_change=false) @@ -1290,7 +1276,6 @@ function sales_types_list($name, $selected_id=null, $submit_on_change=false, $sp 'spec_option' => $special_option===true ? _("All Sales Types") : $special_option, 'spec_id' => 0, 'select_submit'=> $submit_on_change, - // 'async' => false, ) ); } @@ -1323,12 +1308,12 @@ function bank_reconciliation_list($account, $name, $selected_id=null, $submit_on WHERE bank_act=".db_escape($account)." AND reconciled IS NOT NULL GROUP BY reconciled"; return combo_input($name, $selected_id, $sql, 'id', 'reconciled', - array( - 'spec_option' => $special_option, - 'format' => '_format_date', - 'spec_id' => '', - 'select_submit'=> $submit_on_change - ) ); + array( + 'spec_option' => $special_option, + 'format' => '_format_date', + 'spec_id' => '', + 'select_submit'=> $submit_on_change + ) ); } function bank_reconciliation_list_cells($label,$account, $name, $selected_id=null, $submit_on_change=false, $special_option=false) @@ -1355,10 +1340,10 @@ function workcenter_list($name, $selected_id=null, $all_option=false) $sql = "SELECT id, name, inactive FROM ".TB_PREF."workcentres"; return combo_input($name, $selected_id, $sql, 'id', 'name', - array( - 'spec_option' =>$all_option===true ? _("All Suppliers") : $all_option, - 'spec_id' => ALL_TEXT, - ) ); + array( + 'spec_option' =>$all_option===true ? _("All Suppliers") : $all_option, + 'spec_id' => ALL_TEXT, + ) ); } function workcenter_list_cells($label, $name, $selected_id=null, $all_option=false) @@ -1386,13 +1371,13 @@ function bank_accounts_list($name, $selected_id=null, $submit_on_change=false, $ FROM ".TB_PREF."bank_accounts"; return combo_input($name, $selected_id, $sql, 'id', 'bank_account_name', - array( - 'format' => '_format_add_curr', - 'select_submit'=> $submit_on_change, - 'spec_option' => $spec_option, - 'spec_id' => '', - 'async' => false - ) ); + array( + 'format' => '_format_add_curr', + 'select_submit'=> $submit_on_change, + 'spec_option' => $spec_option, + 'spec_id' => '', + 'async' => false + ) ); } function bank_accounts_list_cells($label, $name, $selected_id=null, $submit_on_change=false) @@ -1423,13 +1408,13 @@ function cash_accounts_list_row($label, $name, $selected_id=null, $submit_on_cha echo "\n"; echo "\n"; } //----------------------------------------------------------------------------------------------- @@ -1445,13 +1430,13 @@ function pos_list_row($label, $name, $selected_id=null, $spec_option=false, $sub echo "\n"; } @@ -1470,10 +1455,10 @@ function sale_payment_list($name, $category, $selected_id=null, $submit_on_chang $sql .= " WHERE days_before_due>=0"; return combo_input($name, $selected_id, $sql, 'terms_indicator', 'terms', - array( - 'select_submit'=> $submit_on_change, - 'async' => true - ) ); + array( + 'select_submit'=> $submit_on_change, + 'async' => true + ) ); } @@ -1494,10 +1479,10 @@ function class_list($name, $selected_id=null, $submit_on_change=false) $sql = "SELECT cid, class_name FROM ".TB_PREF."chart_class"; return combo_input($name, $selected_id, $sql, 'cid', 'class_name', - array( - 'select_submit'=> $submit_on_change, - 'async' => false - ) ); + array( + 'select_submit'=> $submit_on_change, + 'async' => false + ) ); } @@ -1522,12 +1507,12 @@ function stock_categories_list($name, $selected_id=null, $spec_opt=false, $submi { $sql = "SELECT category_id, description, inactive FROM ".TB_PREF."stock_category"; return combo_input($name, $selected_id, $sql, 'category_id', 'description', - array('order'=>'category_id', - 'spec_option' => $spec_opt, - 'spec_id' => -1, - 'select_submit'=> $submit_on_change, - 'async' => true - )); + array('order'=>'category_id', + 'spec_option' => $spec_opt, + 'spec_id' => -1, + 'select_submit'=> $submit_on_change, + 'async' => true + )); } function stock_categories_list_cells($label, $name, $selected_id=null, $spec_opt=false, $submit_on_change=false) @@ -1554,12 +1539,12 @@ function gl_account_types_list($name, $selected_id=null, $all_option=false, $all $sql = "SELECT id, name FROM ".TB_PREF."chart_types"; return combo_input($name, $selected_id, $sql, 'id', 'name', - array( - 'format' => '_format_account', - 'order' => array('class_id', 'id', 'parent'), - 'spec_option' =>$all_option, - 'spec_id' => ALL_TEXT - ) ); + array( + 'format' => '_format_account', + 'order' => array('class_id', 'id', 'parent'), + 'spec_option' =>$all_option, + 'spec_id' => ALL_TEXT + ) ); } function gl_account_types_list_cells($label, $name, $selected_id=null, $all_option=false, $all=false) @@ -1596,28 +1581,27 @@ function gl_all_accounts_list($name, $selected_id=null, $skip_bank_accounts=fals WHERE chart.account_type=type.id"; return combo_input($name, $selected_id, $sql, 'chart.account_code', 'chart.account_name', - array( - 'format' => '_format_account', - 'spec_option' => $all_option===true ? _("Use Item Sales Accounts") : $all_option, - 'spec_id' => '', - 'type' => 2, - 'order' => array('type.class_id','type.id','account_code'), - 'search_box' => $cells, + array( + 'format' => '_format_account', + 'spec_option' => $all_option===true ? _("Use Item Sales Accounts") : $all_option, + 'spec_id' => '', + 'type' => 2, + 'order' => array('type.class_id','type.id','account_code'), + 'search_box' => $cells, 'search_submit' => false, 'size' => 12, 'max' => 10, 'cells' => true, - 'select_submit'=> $submit_on_change, - 'async' => false, - 'category' => 2, - 'show_inactive' => $all - ) ); - + 'select_submit'=> $submit_on_change, + 'async' => false, + 'category' => 2, + 'show_inactive' => $all + ) ); } function _format_account($row) { - return $row[0] . "    " . $row[1]; + return $row[0] . "    " . $row[1]; } function gl_all_accounts_list_cells($label, $name, $selected_id=null, @@ -1977,9 +1961,9 @@ function credit_type_list_cells($label, $name, $selected=null, $submit_on_change label_cell($label); echo "\n"; } @@ -1997,8 +1981,8 @@ function number_list($name, $selected, $from, $to, $no_option=false) $items[$i] = "$i"; return array_selector($name, $selected, $items, - array( 'spec_option' => $no_option, - 'spec_id' => ALL_NUMERIC) ); + array( 'spec_option' => $no_option, + 'spec_id' => ALL_NUMERIC) ); } function number_list_cells($label, $name, $selected, $from, $to, $no_option=false) @@ -2145,13 +2129,13 @@ function security_roles_list($name, $selected_id=null, $new_item=false, $submit_ $sql = "SELECT id, role, inactive FROM ".TB_PREF."security_roles"; -return combo_input($name, $selected_id, $sql, 'id', 'description', - array( - 'spec_option'=>$new_item ? _("New role") : false, - 'spec_id' => '', - 'select_submit'=> $submit_on_change, - 'show_inactive' => $show_inactive - ) ); + return combo_input($name, $selected_id, $sql, 'id', 'description', + array( + 'spec_option'=>$new_item ? _("New role") : false, + 'spec_id' => '', + 'select_submit'=> $submit_on_change, + 'show_inactive' => $show_inactive + ) ); } function security_roles_list_cells($label, $name, $selected_id=null, $new_item=false, $submit_on_change=false, diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index 9c2b594f..cf4b4880 100644 --- a/includes/ui/ui_view.inc +++ b/includes/ui/ui_view.inc @@ -385,10 +385,8 @@ function view_stock_status($stock_id, $description=null, $echo=true) { global $path_to_root; if ($description) - //hyperlink_params_separate($path_to_root . "/inventory/inquiry/stock_status.php", (user_show_codes()?$stock_id . " - ":"") . $description, "stock_id=$stock_id"); $preview_str = "". (user_show_codes()?$stock_id . " - ":"") . $description.""; else - //hyperlink_params_separate($path_to_root . "/inventory/inquiry/stock_status.php", $stock_id, "stock_id=$stock_id"); $preview_str = "$stock_id"; if($echo) echo $preview_str;
$label"; - - if ($value == null) - $value = (!isset($_POST[$name]) ? "" : $_POST[$name]); - echo " "; - - submit($input_name, $input_value); - - echo "
$label
$label"; echo combo_input($name, $selected_id, $sql, 'id', 'bank_account_name', - array( - 'spec_option' => $all_option, - 'spec_id' => ALL_TEXT, - 'format' => '_format_add_curr', - 'select_submit'=> $submit_on_change, - 'async' => true - ) ); + array( + 'spec_option' => $all_option, + 'spec_id' => ALL_TEXT, + 'format' => '_format_add_curr', + 'select_submit'=> $submit_on_change, + 'async' => true + ) ); echo "
"; echo combo_input($name, $selected_id, $sql, 'id', 'pos_name', - array( - 'select_submit'=> $submit_on_change, - 'async' => true, - 'spec_option' =>$spec_option, - 'spec_id' => -1, - 'order'=> array('pos_name') - ) ); + array( + 'select_submit'=> $submit_on_change, + 'async' => true, + 'spec_option' =>$spec_option, + 'spec_id' => -1, + 'order'=> array('pos_name') + ) ); echo "
\n"; echo array_selector($name, $selected, - array( 'Return' => _("Items Returned to Inventory Location"), - 'WriteOff' => _("Items Written Off")), - array( 'select_submit'=> $submit_on_change ) ); + array( 'Return' => _("Items Returned to Inventory Location"), + 'WriteOff' => _("Items Written Off")), + array( 'select_submit'=> $submit_on_change ) ); echo "