From 4805d26604f8fac454e33eebf13686b57908f557 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Tue, 10 Jun 2008 08:02:45 +0000 Subject: [PATCH] Fixed focus issues --- CHANGELOG.txt | 4 ++++ gl/gl_deposit.php | 31 ++++++++++++++++++++----------- gl/gl_journal.php | 33 ++++++++++++++++++++------------- gl/gl_payment.php | 31 +++++++++++++++++++++---------- 4 files changed, 65 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 54cd9c2b..213a98e1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -32,6 +32,10 @@ $ /includes/ui/ui_lists.inc /manufacturing/inquiry/where_used_inquiry.php /manufacturing/manage/bom_edit.php /purchasing/includes/ui/po_ui.inc +# Fixed focus issues +$ /gl/gl_journal.php + /gl/gl_deposit.php + /gl/gl_payment.php /js/inserts.js 09-Jun-2008 Janusz Dobrowolski diff --git a/gl/gl_deposit.php b/gl/gl_deposit.php index 3d5dcd05..cdc4910b 100644 --- a/gl/gl_deposit.php +++ b/gl/gl_deposit.php @@ -17,7 +17,7 @@ if ($use_popup_windows) $js .= get_js_open_window(800, 500); if ($use_date_picker) $js .= get_js_date_picker(); -set_focus('_code_id_edit'); + page(_("Bank Account Deposit Entry"), false, false, '', $js); //----------------------------------------------------------------------------------------------- @@ -207,21 +207,30 @@ function handle_new_item() } //----------------------------------------------------------------------------------------------- - -if (isset($_GET['Delete']) || isset($_GET['Edit'])) +if (isset($_GET['Edit'])) { + copy_from_py(); + set_focus('dimension_id'); +} +if (isset($_GET['Delete'])) { copy_from_py(); - -if (isset($_GET['Delete'])) handle_delete_item(); - -if (isset($_POST['AddItem']) || isset($_POST['UpdateItem'])) + set_focus('_code_id_edit'); +} +if (isset($_POST['AddItem'])) { copy_to_py(); - -if (isset($_POST['AddItem'])) handle_new_item(); - -if (isset($_POST['UpdateItem'])) + set_focus('_code_id_edit'); +} +if (isset($_POST['UpdateItem'])) { + copy_to_py(); handle_update_item(); + set_focus('_code_id_edit'); +} +if (isset($_POST['CancelItemChanges'])) + set_focus('_code_id_edit'); + +if (isset($_POST['EditItem'])) + set_focus('dimension_id'); //----------------------------------------------------------------------------------------------- diff --git a/gl/gl_journal.php b/gl/gl_journal.php index c7ad55c0..1e820f5f 100644 --- a/gl/gl_journal.php +++ b/gl/gl_journal.php @@ -19,8 +19,6 @@ if ($use_popup_windows) if ($use_date_picker) $js .= get_js_date_picker(); -set_focus('_code_id_edit'); - page(_("Journal Entry"), false, false,'', $js); //----------------------------------------------------------------------------------------------- @@ -146,7 +144,7 @@ function check_item_data() if (!(input_num('AmountDebit')!=0 ^ input_num('AmountCredit')!=0) ) { display_error(_("You must enter either a debit amount or a credit amount.")); - set_focus('Amount_Debit'); + set_focus('AmountDebit'); return false; } @@ -213,21 +211,30 @@ function handle_new_item() } //----------------------------------------------------------------------------------------------- - -if (isset($_GET['Delete']) || isset($_GET['Edit'])) +if (isset($_GET['Edit'])) { + copy_from_je(); + set_focus('dimension_id'); +} +if (isset($_GET['Delete'])) { copy_from_je(); - -if (isset($_GET['Delete'])) handle_delete_item(); - -if (isset($_POST['AddItem']) || isset($_POST['UpdateItem'])) + set_focus('_code_id_edit'); +} +if (isset($_POST['AddItem'])) { copy_to_je(); - -if (isset($_POST['AddItem'])) handle_new_item(); - -if (isset($_POST['UpdateItem'])) + set_focus('_code_id_edit'); +} +if (isset($_POST['UpdateItem'])) { + copy_to_je(); handle_update_item(); + set_focus('_code_id_edit'); +} +if (isset($_POST['CancelItemChanges'])) + set_focus('_code_id_edit'); + +if (isset($_POST['EditItem'])) + set_focus('dimension_id'); //----------------------------------------------------------------------------------------------- diff --git a/gl/gl_payment.php b/gl/gl_payment.php index 39cd6021..60efb8ae 100644 --- a/gl/gl_payment.php +++ b/gl/gl_payment.php @@ -17,7 +17,7 @@ if ($use_popup_windows) $js .= get_js_open_window(800, 500); if ($use_date_picker) $js .= get_js_date_picker(); -set_focus('_code_id_edit'); + page(_("Bank Account Payment Entry"), false, false, '', $js); //----------------------------------------------------------------------------------------------- @@ -183,6 +183,7 @@ function handle_update_item() $_SESSION['pay_items']->update_gl_item($_POST['Index'], $_POST['dimension_id'], $_POST['dimension2_id'], input_num('amount'), $_POST['LineMemo']); } + set_focus('_code_id_edit'); } //----------------------------------------------------------------------------------------------- @@ -205,20 +206,30 @@ function handle_new_item() //----------------------------------------------------------------------------------------------- -if (isset($_GET['Delete']) || isset($_GET['Edit'])) +if (isset($_GET['Edit'])) { + copy_from_py(); + set_focus('dimension_id'); +} +if (isset($_GET['Delete'])) { copy_from_py(); - -if (isset($_GET['Delete'])) handle_delete_item(); - -if (isset($_POST['AddItem']) || isset($_POST['UpdateItem'])) + set_focus('_code_id_edit'); +} +if (isset($_POST['AddItem'])) { copy_to_py(); - -if (isset($_POST['AddItem'])) handle_new_item(); - -if (isset($_POST['UpdateItem'])) + set_focus('_code_id_edit'); +} +if (isset($_POST['UpdateItem'])) { + copy_to_py(); handle_update_item(); + set_focus('_code_id_edit'); +} +if (isset($_POST['CancelItemChanges'])) + set_focus('_code_id_edit'); + +if (isset($_POST['EditItem'])) + set_focus('dimension_id'); //----------------------------------------------------------------------------------------------- -- 2.30.2