From cf7be1f00c6abe59755286e0c3108d9d3c0356da Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sat, 25 Jul 2009 12:17:44 +0000 Subject: [PATCH] Popup editors now available as option for some list selectors. --- CHANGELOG.txt | 29 ++++++ gl/gl_bank.php | 4 - gl/includes/ui/gl_bank_ui.inc | 9 +- includes/page/footer.inc | 10 +-- includes/session.inc | 2 + includes/ui/ui_controls.inc | 53 ++++++----- includes/ui/ui_lists.inc | 89 ++++++++++++------- inventory/purchasing_data.php | 3 +- js/inserts.js | 4 +- .../allocations/supplier_allocation_main.php | 1 - purchasing/includes/ui/po_ui.inc | 4 +- purchasing/po_entry_items.php | 2 - purchasing/supplier_credit.php | 1 - purchasing/supplier_invoice.php | 1 - purchasing/supplier_payment.php | 1 - .../allocations/customer_allocation_main.php | 1 - sales/credit_note_entry.php | 2 - sales/customer_payments.php | 2 - sales/includes/ui/sales_credit_ui.inc | 4 +- sales/includes/ui/sales_order_ui.inc | 4 +- sales/sales_order_entry.php | 2 - themes/aqua/default.css | 5 ++ themes/aqua/renderer.php | 9 +- themes/cool/default.css | 5 ++ themes/cool/renderer.php | 9 +- themes/default/default.css | 5 ++ themes/default/renderer.php | 9 +- 27 files changed, 168 insertions(+), 102 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6a4a8fcb..74cf20db 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,35 @@ Legend: ! -> Note $ -> Affected files +25-Jul-2009 Janusz Dobrowolski +! Popup editor now available as option for some list selectors. +$ /includes/ui/ui_lists.inc + /gl/gl_bank.php + /gl/includes/ui/gl_bank_ui.inc + /includes/session.inc + /includes/page/footer.inc + /includes/ui/ui_controls.inc + /inventory/purchasing_data.php + /js/inserts.js + /purchasing/po_entry_items.php + /purchasing/supplier_credit.php + /purchasing/supplier_invoice.php + /purchasing/supplier_payment.php + /purchasing/allocations/supplier_allocation_main.php + /purchasing/includes/ui/po_ui.inc + /sales/credit_note_entry.php + /sales/customer_payments.php + /sales/sales_order_entry.php + /sales/allocations/customer_allocation_main.php + /sales/includes/ui/sales_credit_ui.inc + /sales/includes/ui/sales_order_ui.inc + /themes/aqua/default.css + /themes/aqua/renderer.php + /themes/cool/default.css + /themes/cool/renderer.php + /themes/default/default.css + /themes/default/renderer.php + 21-Jul-2009 Janusz Dobrowolski ! Asynchronous customer/supplier/item selection now use popup window. $ /index.php diff --git a/gl/gl_bank.php b/gl/gl_bank.php index a9d969a2..34218c6f 100644 --- a/gl/gl_bank.php +++ b/gl/gl_bank.php @@ -41,10 +41,6 @@ page($_SESSION['page_title'], false, false, '', $js); check_db_has_bank_accounts(_("There are no bank accounts defined in the system.")); //---------------------------------------------------------------------------------------- -set_editor('supplier', 'person_id' , 'ref'); -set_editor('customer', 'person_id' , 'ref'); -set_editor('branch', 'PersonDetailID' , 'ref'); - if (list_updated('PersonDetailID')) { $br = get_branch(get_post('PersonDetailID')); $_POST['person_id'] = $br['debtor_no']; diff --git a/gl/includes/ui/gl_bank_ui.inc b/gl/includes/ui/gl_bank_ui.inc index 4693ec34..f42e8e36 100644 --- a/gl/includes/ui/gl_bank_ui.inc +++ b/gl/includes/ui/gl_bank_ui.inc @@ -44,6 +44,8 @@ function display_bank_header(&$order) $_POST['person_id'] = ''; $Ajax->activate('pmt_header'); $Ajax->activate('code_id'); + $Ajax->activate('pagehelp'); + $Ajax->activate('editors'); } payment_person_types_list_row( $payment ? _("Pay To:"):_("From:"), 'PayType', $_POST['PayType'], true); @@ -57,14 +59,15 @@ function display_bank_header(&$order) // workorders_list_row(_("Work Order:"), 'person_id', null); // break; case payment_person_types::supplier() : - supplier_list_row(_("Supplier:"), 'person_id', null, false, true); + supplier_list_row(_("Supplier:"), 'person_id', null, false, true, false, true); break; case payment_person_types::customer() : - customer_list_row(_("Customer:"), 'person_id', null, false, true); + customer_list_row(_("Customer:"), 'person_id', null, false, true, false, true); if (db_customer_has_branches($_POST['person_id'])) { - customer_branches_list_row(_("Branch:"), $_POST['person_id'], 'PersonDetailID', null, false, true, true); + customer_branches_list_row(_("Branch:"), $_POST['person_id'], + 'PersonDetailID', null, false, true, true, true); } else { diff --git a/includes/page/footer.inc b/includes/page/footer.inc index da53a925..7256dfe1 100644 --- a/includes/page/footer.inc +++ b/includes/page/footer.inc @@ -11,10 +11,7 @@ ***********************************************************************/ function page_footer($no_menu=false, $is_index=false) { - global $path_to_root, $js_lib, $Validate, $Editors; - - if (in_ajax()) - return;// just for speed up + global $path_to_root, $js_lib, $Validate, $Editors, $Ajax; if (!$is_index && function_exists('hyperlink_back')) hyperlink_back(); @@ -22,10 +19,13 @@ function page_footer($no_menu=false, $is_index=false) $rend = new renderer(); $rend->menu_footer($no_menu, $is_index); + $edits = "editors = ".JsHttpRequest::php2js($Editors).";"; + $Ajax->addScript('editors', $edits); + echo ""; add_user_js_data(); diff --git a/includes/session.inc b/includes/session.inc index d53e9b63..e327b3bb 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -145,6 +145,8 @@ $Ajax =& new Ajax(); $Validate = array(); // bindings for editors $Editors = array(); +// page help. Currently help for function keys. +$Pagehelp = array(); // intercept all output to destroy it in case of ajax call register_shutdown_function('end_flush'); diff --git a/includes/ui/ui_controls.inc b/includes/ui/ui_controls.inc index 7b518e57..b05eaa80 100644 --- a/includes/ui/ui_controls.inc +++ b/includes/ui/ui_controls.inc @@ -322,40 +322,39 @@ function div_end() } } +/* Table editor interfaces. Key is editor type + 0 => url of editor page + 1 => hotkey code + 2 => context help +*/ +$popup_editors = array( + 'customer' => array('/sales/manage/customers.php?debtor_no=', + 113, _("Customers")), + 'branch' => array('/sales/manage/customer_branches.php?SelectedBranch=', + 114, _("Branches")), + 'supplier' => array('/purchasing/manage/suppliers.php?supplier_id=', + 113, _("Suppliers")), + 'item' => array('/inventory/manage/items.php?stock_id=', + 115, _("Items")) +); /* Bind editors for various selectors. $type - type of editor - $input - array org_input => editor_input - $focus - focus after selection + $input - name of related input field + $caller - optional function key code (available values F1-F12: 112-123, + true: default) */ -function set_editor($type, $input, $focus=null) +function set_editor($type, $input, $caller=true) { - global $path_to_root, $Editors; - // table of table editor interfaces. - // key is editor type, values contain: - // 0 => url of editor page - // 1 => array of names of parameters returned back from editor interface - // 2 => hotkey code + global $path_to_root, $Editors, $popup_editors, $Pagehelp; - if($focus === null) { - $focus = $caller; - } - $urls = array( - 'customer' => array('/sales/manage/customers.php?debtor_no=', - 113, _("F2 - Customers")), - 'branch' => array('/sales/manage/customer_branches.php?SelectedBranch=', - 114, _("F3 - Branches")), - 'supplier' => array('/purchasing/manage/suppliers.php?supplier_id=', - 113, _("F2 - Suppliers")), - 'item' => array('/inventory/manage/items.php?stock_id=', - 115, _("F4 - Items")) - ); - $back = array(); - $caller = $urls[$type][1]; - $Editors[$caller] = array( $path_to_root . $urls[$type][0], $input, $focus); - -// FIX status comments + $key = $caller===true ? $popup_editors[$type][1] : $caller; + $Editors[$key] = array( $path_to_root . $popup_editors[$type][0], $input); + + $help = 'F' . ($key - 111) . ' - '; + $help .= $popup_editors[$type][2]; + $Pagehelp[] = $help; } //------------------------------------------------------------------------------ // Procedures below are now obsolete. Preserved for eventual future use. diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 672f1950..b2332aea 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -68,7 +68,7 @@ $opts = array( // default options $search_box = $opts['search_box']===true ? '_'.$name.'_edit' : $opts['search_box']; $search_submit = $opts['search_submit']===true ? '_'.$name.'_button' : $opts['search_submit']; - $select_submit = $opts['select_submit']===true ? '_'.$name.'_update' : $opts['select_submit']; + $select_submit = $opts['select_submit']; $spec_id = $opts['spec_id']; $spec_option = $opts['spec_option']; $by_id = ($opts['type'] == 0); @@ -94,7 +94,7 @@ $opts = array( // default options $rel = ''; $limit = ''; - if (isset($_POST[$select_submit])) { + if (isset($_POST['_'.$name.'_update'])) { if ($by_id) $txt = $_POST[$name]; if (!$opts['async']) @@ -222,7 +222,7 @@ $opts = array( // default options // button class selects form reload/ajax selector update $selector .= sprintf($_select_button, $disabled, user_theme(), (fallback_mode() ? '' : 'display:none;'), - $select_submit)."\n"; + '_'.$name.'_update')."\n"; } // ------ make combo ---------- @@ -281,7 +281,7 @@ $opts = array( // default options // ------ merge options with defaults ---------- if($options != null) $opts = array_merge($opts, $options); - $select_submit = $opts['select_submit']===true ? '_'.$name.'_update' : $opts['select_submit']; + $select_submit = $opts['select_submit']; $spec_id = $opts['spec_id']; $spec_option = $opts['spec_option']; $disabled = $opts['disabled'] ? "disabled" : ''; @@ -290,7 +290,7 @@ $opts = array( // default options $selected_id = get_post($name, $opts['default']); } - if (isset($_POST[$select_submit])) { + if (isset($_POST[ '_'.$name.'_update'])) { if (!$opts['async']) $Ajax->activate('_page_body'); else @@ -340,7 +340,7 @@ $opts = array( // default options global $_select_button; $selector .= sprintf($_select_button, $disabled, user_theme(), (fallback_mode() ? '' : 'display:none;'), - $select_submit)."\n"; + '_'.$name.'_update')."\n"; } default_focus($name); echo $selector; @@ -362,7 +362,7 @@ function _format_add_curr($row) } function supplier_list($name, $selected_id=null, $spec_option=false, $submit_on_change=false, - $all=false) + $all=false, $editkey = false) { global $all_items; @@ -370,6 +370,9 @@ function supplier_list($name, $selected_id=null, $spec_option=false, $submit_on_ $mode = get_company_pref('no_supplier_list'); + if ($editkey) + set_editor('supplier', $name, $editkey); + return combo_input($name, $selected_id, $sql, 'supplier_id', 'supp_name', array( 'format' => '_format_add_curr', @@ -386,25 +389,29 @@ function supplier_list($name, $selected_id=null, $spec_option=false, $submit_on_ } function supplier_list_cells($label, $name, $selected_id=null, $all_option=false, - $submit_on_change=false, $all=false) + $submit_on_change=false, $all=false, $editkey = false) { if ($label != null) echo "$label\n"; - $str = supplier_list($name, $selected_id, $all_option, $submit_on_change, $all); + $str = supplier_list($name, $selected_id, $all_option, $submit_on_change, + $all, $editkey); echo "\n"; return $str; } -function supplier_list_row($label, $name, $selected_id=null, $all_option = false, $submit_on_change=false) +function supplier_list_row($label, $name, $selected_id=null, $all_option = false, + $submit_on_change=false, $all=false, $editkey = false) { echo "$label"; - $str = supplier_list($name, $selected_id, $all_option, $submit_on_change ); + $str = supplier_list($name, $selected_id, $all_option, $submit_on_change, + $all, $editkey); echo "\n"; return $str; } //---------------------------------------------------------------------------------------------- -function customer_list($name, $selected_id=null, $spec_option=false, $submit_on_change=false, $show_inactive=false) +function customer_list($name, $selected_id=null, $spec_option=false, $submit_on_change=false, + $show_inactive=false, $editkey = false) { global $all_items; @@ -412,6 +419,9 @@ function customer_list($name, $selected_id=null, $spec_option=false, $submit_on_ $mode = get_company_pref('no_customer_list'); + if ($editkey) + set_editor('customer', $name, $editkey); + return combo_input($name, $selected_id, $sql, 'debtor_no', 'name', array( 'format' => '_format_add_curr', @@ -429,23 +439,23 @@ return combo_input($name, $selected_id, $sql, 'debtor_no', 'name', } function customer_list_cells($label, $name, $selected_id=null, $all_option=false, - $submit_on_change=false, $show_inactive=false) + $submit_on_change=false, $show_inactive=false, $editkey = false) { if ($label != null) echo "$label\n"; echo ""; $str = customer_list($name, $selected_id, $all_option, $submit_on_change, - $show_inactive); + $show_inactive, $editkey); echo "\n"; return $str; } function customer_list_row($label, $name, $selected_id=null, $all_option = false, - $submit_on_change=false, $show_inactive=false) + $submit_on_change=false, $show_inactive=false, $editkey = false) { echo "$label"; $str = customer_list($name, $selected_id, $all_option, $submit_on_change, - $show_inactive); + $show_inactive, $editkey); echo "\n\n"; return $str; } @@ -453,13 +463,16 @@ function customer_list_row($label, $name, $selected_id=null, $all_option = false //------------------------------------------------------------------------------------------------ function customer_branches_list($customer_id, $name, $selected_id=null, - $spec_option = true, $enabled=true, $submit_on_change=false) + $spec_option = true, $enabled=true, $submit_on_change=false, $editkey = false) { global $all_items; $sql = "SELECT branch_code, br_name FROM ".TB_PREF."cust_branch WHERE debtor_no='" . $customer_id . "' "; + if ($editkey) + set_editor('branch', $name, $editkey); + $where = $enabled ? array("disable_trans = 0") : array(); return combo_input($name, $selected_id, $sql, 'branch_code', 'br_name', array( @@ -472,20 +485,24 @@ return combo_input($name, $selected_id, $sql, 'branch_code', 'br_name', } //------------------------------------------------------------------------------------------------ -function customer_branches_list_cells($label,$customer_id, $name, $selected_id=null, $all_option = true, $enabled=true, $submit_on_change=false) +function customer_branches_list_cells($label,$customer_id, $name, $selected_id=null, + $all_option = true, $enabled=true, $submit_on_change=false, $editkey = false) { if ($label != null) echo "$label\n"; echo ""; - $ret = customer_branches_list($customer_id, $name, $selected_id, $all_option, $enabled, $submit_on_change); + $ret = customer_branches_list($customer_id, $name, $selected_id, $all_option, $enabled, + $submit_on_change, $editkey); echo "\n"; return $ret; } -function customer_branches_list_row($label,$customer_id, $name, $selected_id=null, $all_option = true, $enabled=true, $submit_on_change=false) +function customer_branches_list_row($label, $customer_id, $name, $selected_id=null, + $all_option = true, $enabled=true, $submit_on_change=false, $editkey = false) { echo ""; - $ret = customer_branches_list_cells($label, $customer_id, $name, $selected_id, $all_option, $enabled, $submit_on_change); + $ret = customer_branches_list_cells($label, $customer_id, $name, $selected_id, + $all_option, $enabled, $submit_on_change, $editkey); echo ""; return $ret; } @@ -647,13 +664,16 @@ function dimensions_list_row($label, $name, $selected_id=null, $no_option=false, //--------------------------------------------------------------------------------------------------- function stock_items_list($name, $selected_id=null, $all_option=false, - $submit_on_change=false, $opts=array()) + $submit_on_change=false, $opts=array(), $editkey = false) { global $all_items; $sql = "SELECT stock_id, s.description, c.description, s.inactive FROM ".TB_PREF."stock_master s,".TB_PREF."stock_category c WHERE s.category_id=c.category_id"; + if ($editkey) + set_editor('item', $name, $editkey); + return combo_input($name, $selected_id, $sql, 'stock_id', 's.description', array_merge( array( @@ -676,12 +696,12 @@ function _format_stock_items($row) } function stock_items_list_cells($label, $name, $selected_id=null, $all_option=false, - $submit_on_change=false, $all=false) + $submit_on_change=false, $all=false, $editkey = false) { if ($label != null) echo "$label\n"; $str = stock_items_list($name, $selected_id, $all_option, $submit_on_change, - array('cells'=>true, 'show_inactive'=>$all)); + array('cells'=>true, 'show_inactive'=>$all), $editkey); return $str; } /* @@ -796,20 +816,21 @@ function stock_manufactured_items_list_row($label, $name, $selected_id=null, //------------------------------------------------------------------------------------ function stock_component_items_list($name, $parent_stock_id, $selected_id=null, - $all_option=false, $submit_on_change=false) + $all_option=false, $submit_on_change=false, $editkey = false) { $str = stock_items_list($name, $selected_id, $all_option, $submit_on_change, - array('where'=>array("stock_id != '$parent_stock_id'"))); + array('where'=>array("stock_id != '$parent_stock_id'")), $editkey); return $str; } function stock_component_items_list_cells($label, $name, $parent_stock_id, - $selected_id=null, $all_option=false, $submit_on_change=false) + $selected_id=null, $all_option=false, $submit_on_change=false, $editkey = false) { if ($label != null) echo "$label\n"; $str = stock_items_list($name, $selected_id, $all_option, $submit_on_change, - array('where'=>array("stock_id != '$parent_stock_id'"), 'cells'=>true)); + array('where'=>array("stock_id != '$parent_stock_id'"), 'cells'=>true), + $editkey); return $str; } //------------------------------------------------------------------------------------ @@ -834,31 +855,31 @@ function stock_costable_items_list_cells($label, $name, $selected_id=null, //------------------------------------------------------------------------------------ function stock_purchasable_items_list($name, $selected_id=null, - $all_option=false, $submit_on_change=false, $all=false) + $all_option=false, $submit_on_change=false, $all=false, $editkey=false) { $str = stock_items_list($name, $selected_id, $all_option, $submit_on_change, array('where'=>array("mb_flag!= 'M'"), - 'show_inactive'=>$all)); + 'show_inactive'=>$all), $editkey); return $str; } function stock_purchasable_items_list_cells($label, $name, $selected_id=null, - $all_option=false, $submit_on_change=false, $all=false) + $all_option=false, $submit_on_change=false, $editkey=false) { if ($label != null) echo "$label\n"; $str = stock_items_list($name, $selected_id, $all_option, $submit_on_change, array('where'=>array("mb_flag!= 'M'"), - 'cells'=>true)); + 'cells'=>true), $editkey); return $str; } function stock_purchasable_items_list_row($label, $name, $selected_id=null, - $all_option=false, $submit_on_change=false) + $all_option=false, $submit_on_change=false, $editkey=false) { echo "\n"; $ret = stock_purchasable_items_list_cells($label, $name, $selected_id=null, - $all_option, $submit_on_change); + $all_option, $submit_on_change, $editkey); echo "\n"; return $ret; } diff --git a/inventory/purchasing_data.php b/inventory/purchasing_data.php index 20cf7536..69d4b91e 100644 --- a/inventory/purchasing_data.php +++ b/inventory/purchasing_data.php @@ -24,9 +24,8 @@ check_db_has_purchasable_items(_("There are no purchasable inventory items defin check_db_has_suppliers(_("There are no suppliers defined in the system.")); //---------------------------------------------------------------------------------------- -set_editor('supplier', 'supplier_id' , 'supplier_id'); - simple_page_mode(true); + //-------------------------------------------------------------------------------------------------- if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') diff --git a/js/inserts.js b/js/inserts.js index 6100d2dd..489a4b42 100644 --- a/js/inserts.js +++ b/js/inserts.js @@ -160,9 +160,9 @@ function passBack(value) { to[0].value = value; // ugly hack to set selector to any value to.value = value; // update page after item selection - o.JsHttpRequest.request('_'+to.name+'_update'); + o.JsHttpRequest.request('_'+to.name+'_update', to.form); + o.setFocus(to.name); } - o.setFocus(back[2]); } close(); } diff --git a/purchasing/allocations/supplier_allocation_main.php b/purchasing/allocations/supplier_allocation_main.php index 8c11ea9e..2bef7bab 100644 --- a/purchasing/allocations/supplier_allocation_main.php +++ b/purchasing/allocations/supplier_allocation_main.php @@ -26,7 +26,6 @@ if ($use_popup_windows) page(_("Supplier Allocations"), false, false, "", $js); //-------------------------------------------------------------------------------- -set_editor('supplier', 'supplier_id' , 'ShowSettled'); start_form(); diff --git a/purchasing/includes/ui/po_ui.inc b/purchasing/includes/ui/po_ui.inc index 2c7d58d7..aa0d8bcc 100644 --- a/purchasing/includes/ui/po_ui.inc +++ b/purchasing/includes/ui/po_ui.inc @@ -62,7 +62,7 @@ function display_po_header(&$order) if (!isset($_POST['supplier_id']) && (get_global_supplier() != reserved_words::get_all())) $_POST['supplier_id'] = get_global_supplier(); - supplier_list_row(_("Supplier:"), 'supplier_id', null, false, true); + supplier_list_row(_("Supplier:"), 'supplier_id', null, false, true, false, true); } else { @@ -302,7 +302,7 @@ function po_item_controls(&$order, $stock_id=null) { hidden('line_no', ($_SESSION['PO']->lines_on_order + 1)); - stock_purchasable_items_list_cells(null, 'stock_id', null, false, true); + stock_purchasable_items_list_cells(null, 'stock_id', null, false, false, true); if (list_updated('stock_id')) { $Ajax->activate('price'); $Ajax->activate('units'); diff --git a/purchasing/po_entry_items.php b/purchasing/po_entry_items.php index 0bf90f9b..b0d11699 100644 --- a/purchasing/po_entry_items.php +++ b/purchasing/po_entry_items.php @@ -38,8 +38,6 @@ check_db_has_suppliers(_("There are no suppliers defined in the system.")); check_db_has_purchasable_items(_("There are no purchasable inventory items defined in the system.")); //--------------------------------------------------------------------------------------------------------------- -set_editor('supplier', 'supplier_id' , 'ref'); -set_editor('item', 'stock_id' , 'qty'); if (isset($_GET['AddedID'])) { diff --git a/purchasing/supplier_credit.php b/purchasing/supplier_credit.php index 6f27aa51..bd2fb08a 100644 --- a/purchasing/supplier_credit.php +++ b/purchasing/supplier_credit.php @@ -33,7 +33,6 @@ page(_("Supplier Credit Note"), false, false, "", $js); check_db_has_suppliers(_("There are no suppliers defined in the system.")); //--------------------------------------------------------------------------------------------------------------- -set_editor('supplier', 'supplier_id' , 'reference'); if (isset($_GET['AddedID'])) { diff --git a/purchasing/supplier_invoice.php b/purchasing/supplier_invoice.php index 89ed41b7..371dfabc 100644 --- a/purchasing/supplier_invoice.php +++ b/purchasing/supplier_invoice.php @@ -27,7 +27,6 @@ if ($use_date_picker) $js .= get_js_date_picker(); page(_("Enter Supplier Invoice"), false, false, "", $js); -set_editor('supplier', 'supplier_id' , 'reference'); //---------------------------------------------------------------------------------------- check_db_has_suppliers(_("There are no suppliers defined in the system.")); diff --git a/purchasing/supplier_payment.php b/purchasing/supplier_payment.php index 91db00d4..a2603dfb 100644 --- a/purchasing/supplier_payment.php +++ b/purchasing/supplier_payment.php @@ -42,7 +42,6 @@ check_db_has_suppliers(_("There are no suppliers defined in the system.")); check_db_has_bank_accounts(_("There are no bank accounts defined in the system.")); //---------------------------------------------------------------------------------------- -set_editor('supplier', 'supplier_id' , 'bank_account'); if (!isset($_POST['supplier_id'])) $_POST['supplier_id'] = get_global_supplier(false); diff --git a/sales/allocations/customer_allocation_main.php b/sales/allocations/customer_allocation_main.php index 5e7d292a..e874d53d 100644 --- a/sales/allocations/customer_allocation_main.php +++ b/sales/allocations/customer_allocation_main.php @@ -22,7 +22,6 @@ if ($use_popup_windows) page(_("Customer Allocations"), false, false, "", $js); //-------------------------------------------------------------------------------- -set_editor('customer', 'customer_id' , 'ShowSettled'); start_form(); /* show all outstanding receipts and credits to be allocated */ diff --git a/sales/credit_note_entry.php b/sales/credit_note_entry.php index 4c461702..4b20b747 100644 --- a/sales/credit_note_entry.php +++ b/sales/credit_note_entry.php @@ -51,8 +51,6 @@ check_db_has_stock_items(_("There are no items defined in the system.")); check_db_has_customer_branches(_("There are no customers, or there are no customers with branches. Please define customers and customer branches.")); //----------------------------------------------------------------------------- -set_editor('customer', 'customer_id' , 'branch_id'); -set_editor('branch', 'branch_id' , 'ref'); if (list_updated('branch_id')) { // when branch is selected via external editor also customer can change diff --git a/sales/customer_payments.php b/sales/customer_payments.php index 24c6e0cd..f00a88da 100644 --- a/sales/customer_payments.php +++ b/sales/customer_payments.php @@ -38,8 +38,6 @@ check_db_has_customers(_("There are no customers defined in the system.")); check_db_has_bank_accounts(_("There are no bank accounts defined in the system.")); //---------------------------------------------------------------------------------------- -set_editor('customer', 'customer_id' , 'sales_type'); -set_editor('branch', 'BranchID' , 'bank_account'); if (list_updated('BranchID')) { // when branch is selected via external editor also customer can change diff --git a/sales/includes/ui/sales_credit_ui.inc b/sales/includes/ui/sales_credit_ui.inc index e9bb8ebe..6adfa4ce 100644 --- a/sales/includes/ui/sales_credit_ui.inc +++ b/sales/includes/ui/sales_credit_ui.inc @@ -26,7 +26,7 @@ function display_credit_header(&$order) if (!isset($_POST['customer_id']) && (get_global_customer() != reserved_words::get_all())) $_POST['customer_id'] = get_global_customer(); - customer_list_row(_("Customer:"), 'customer_id', null, false, true); + customer_list_row(_("Customer:"), 'customer_id', null, false, true, false, true); if ($order->customer_id != $_POST['customer_id'] /*|| $order->sales_type != $_POST['sales_type_id']*/) { @@ -35,7 +35,7 @@ function display_credit_header(&$order) } customer_branches_list_row(_("Branch:"), $_POST['customer_id'], - 'branch_id', null, false, true, true); + 'branch_id', null, false, true, true, true); //if (($_SESSION['credit_items']->order_no == 0) || // ($order->customer_id != $_POST['customer_id']) || diff --git a/sales/includes/ui/sales_order_ui.inc b/sales/includes/ui/sales_order_ui.inc index 8b5ec901..401a725c 100644 --- a/sales/includes/ui/sales_order_ui.inc +++ b/sales/includes/ui/sales_order_ui.inc @@ -258,7 +258,7 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group } else { - customer_list_row(_("Customer:"), 'customer_id', null, false, true); + customer_list_row(_("Customer:"), 'customer_id', null, false, true, false, true); if ($order->customer_id != get_post('customer_id', -1)) { @@ -266,7 +266,7 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group $Ajax->activate('branch_id'); } customer_branches_list_row(_("Branch:"), - $_POST['customer_id'], 'branch_id', null, false, true, true); + $_POST['customer_id'], 'branch_id', null, false, true, true, true); if( ($order->customer_id != get_post('customer_id', -1)) || ($order->Branch != get_post('branch_id', -1)) || diff --git a/sales/sales_order_entry.php b/sales/sales_order_entry.php index 40e008fd..4df319c7 100644 --- a/sales/sales_order_entry.php +++ b/sales/sales_order_entry.php @@ -60,8 +60,6 @@ if (isset($_GET['NewDelivery']) && is_numeric($_GET['NewDelivery'])) { page($_SESSION['page_title'], false, false, "", $js); //----------------------------------------------------------------------------- -set_editor('customer', 'customer_id', 'sales_type'); -set_editor('branch', 'branch_id', 'sales_type'); if (list_updated('branch_id')) { // when branch is selected via external editor also customer can change diff --git a/themes/aqua/default.css b/themes/aqua/default.css index 82d778ee..775116d9 100644 --- a/themes/aqua/default.css +++ b/themes/aqua/default.css @@ -229,6 +229,11 @@ div.tabs a:hover { border: 1px solid #8cacbb; } +#hotkeyshelp { + text-align: right; + font-weight: bolder; +} + #footer { position: relative; bottom: -3px; diff --git a/themes/aqua/renderer.php b/themes/aqua/renderer.php index 8abc9c46..9e4f2c0d 100644 --- a/themes/aqua/renderer.php +++ b/themes/aqua/renderer.php @@ -89,7 +89,8 @@ function menu_footer($no_menu, $is_index) { - global $version, $allow_demo_mode, $app_title, $power_url, $power_by, $path_to_root; + global $version, $allow_demo_mode, $app_title, $power_url, + $power_by, $path_to_root, $Pagehelp, $Ajax; include_once($path_to_root . "/includes/date_functions.inc"); if ($no_menu == false) @@ -99,8 +100,12 @@ else echo "\n"; echo ""; - if (isset($_SESSION['wa_current_user'])) + if (isset($_SESSION['wa_current_user'])) { + $phelp = implode('; ', $Pagehelp); echo "\n"; + $Ajax->addUpdate(true, 'hotkeyshelp', $phelp); + echo ""; + } echo "
" . Today() . " | " . Now() . "".$phelp."
\n"; } echo "\n"; diff --git a/themes/cool/default.css b/themes/cool/default.css index ac706d53..bf6e6eac 100644 --- a/themes/cool/default.css +++ b/themes/cool/default.css @@ -233,6 +233,11 @@ div.tabs a:hover { border: 1px solid #cccccc; } +#hotkeyshelp { + text-align: right; + font-weight: bolder; +} + #footer { position: relative; bottom: -3px; diff --git a/themes/cool/renderer.php b/themes/cool/renderer.php index f4f59c15..73520c51 100644 --- a/themes/cool/renderer.php +++ b/themes/cool/renderer.php @@ -89,7 +89,8 @@ function menu_footer($no_menu, $is_index) { - global $version, $allow_demo_mode, $app_title, $power_url, $power_by, $path_to_root; + global $version, $allow_demo_mode, $app_title, $power_url, + $power_by, $path_to_root, $Pagehelp, $Ajax; include_once($path_to_root . "/includes/date_functions.inc"); if ($no_menu == false) @@ -99,8 +100,12 @@ else echo "\n"; echo ""; - if (isset($_SESSION['wa_current_user'])) + if (isset($_SESSION['wa_current_user'])) { + $phelp = implode('; ', $Pagehelp); echo "\n"; + $Ajax->addUpdate(true, 'hotkeyshelp', $phelp); + echo ""; + } echo "
" . Today() . " | " . Now() . "".$phelp."
\n"; } echo "\n"; diff --git a/themes/default/default.css b/themes/default/default.css index b6443476..d45f2e2c 100644 --- a/themes/default/default.css +++ b/themes/default/default.css @@ -229,6 +229,11 @@ div.tabs a:hover { border: 1px solid #8cacbb; } +#hotkeyshelp { + text-align: right; + font-weight: bolder; +} + #footer { position: relative; bottom: -3px; diff --git a/themes/default/renderer.php b/themes/default/renderer.php index 43b163bd..cde08ae3 100644 --- a/themes/default/renderer.php +++ b/themes/default/renderer.php @@ -90,7 +90,8 @@ function menu_footer($no_menu, $is_index) { - global $version, $allow_demo_mode, $app_title, $power_url, $power_by, $path_to_root; + global $version, $allow_demo_mode, $app_title, $power_url, + $power_by, $path_to_root, $Pagehelp, $Ajax; include_once($path_to_root . "/includes/date_functions.inc"); if ($no_menu == false) @@ -100,8 +101,12 @@ else echo "\n"; echo ""; - if (isset($_SESSION['wa_current_user'])) + if (isset($_SESSION['wa_current_user'])) { + $phelp = implode('; ', $Pagehelp); echo "\n"; + $Ajax->addUpdate(true, 'hotkeyshelp', $phelp); + echo ""; + } echo "
" . Today() . " | " . Now() . "".$phelp."
\n"; } echo "\n"; -- 2.30.2