Added cancel button on Items page.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 29 Mar 2009 15:18:46 +0000 (15:18 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 29 Mar 2009 15:18:46 +0000 (15:18 +0000)
CHANGELOG.txt
inventory/manage/items.php

index 1e5f54fa5a0cb80fc9ac2a6a61ea57e66bb6defe..eb8a0a4bd847207f2e5bc01054557ef733bed493 100644 (file)
@@ -19,6 +19,11 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+
+29-Mar-2009 Janusz Dobrowolski
+! Added cancel button
+$ /inventory/manage/items.php
+
 21-Mar-2009 Janusz Dobrowolski
 + Option to use last document date on subsequent new documents.
 $ /admin/display_prefs.php
index de0261b710216f4887febae785d2a57d31728f36..dbd25cd3caa60022865a28ad5991c64d7cf9307e 100644 (file)
@@ -22,7 +22,7 @@ include_once($path_to_root . "/includes/data_checks.inc");
 include_once($path_to_root . "/inventory/includes/inventory_db.inc");
 
 $user_comp = user_company();
-$new_item = get_post('stock_id')==''; 
+$new_item = get_post('stock_id')=='' || get_post('cancel')
 //------------------------------------------------------------------------------------
 
 if (isset($_GET['stock_id']))
@@ -40,6 +40,14 @@ if (list_updated('stock_id')) {
        $Ajax->activate('details');
        $Ajax->activate('controls');
 }
+
+if (get_post('cancel')) {
+       $_POST['NewStockID'] = $_POST['stock_id'] = '';
+    clear_data();
+       set_focus('stock_id');
+       $Ajax->activate('_page_body');
+}
+
 if (list_updated('category_id') || list_updated('mb_flag')) {
        $Ajax->activate('details');
 }
@@ -412,9 +420,11 @@ if (!isset($_POST['NewStockID']) || $new_item)
 } 
 else 
 {
-       submit_center_first('addupdate', _("Update Item"), '', 'default');
+       submit_center_first('addupdate', _("Update Item"), '', 
+       count($_SESSION['Context']) ? true : 'default');
        submit_return('select', _("Return"), _("Select this items and return to document entry."), 'default');
-       submit_center_last('delete', _("Delete This Item"), '', true);
+       submit('delete', _("Delete This Item"), true, '', true);
+       submit_center_last('cancel', _("Cancel"), _("Cancel Edition"), 'cancel');
 }
 
 div_end();