Fixed focus issues
[fa-stable.git] / gl / gl_payment.php
index 0b96feec3c0c27f74e2770d80c8bb419a427d281..60efb8ae655585504fc28833d988f2de6d1e1aae 100644 (file)
@@ -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('CodeID2');
+
 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');
 
 //-----------------------------------------------------------------------------------------------