Merged bugfixes since 2.0.6
[fa-stable.git] / gl / manage / gl_account_classes.php
index 53dd536cd62224710ca40ad75865ddf95d32612f..6cc9a6d53aaf428c9773370d56096cebe0cd5c65 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU Affero General Public License,
+       AGPL, as published by the Free Software Foundation, either version 
+       3 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
 $page_security = 3;
 $path_to_root="../..";
 include($path_to_root . "/includes/session.inc");
@@ -15,7 +24,12 @@ simple_page_mode(true);
 
 function can_process() 
 {
-
+       if (!is_numeric($_POST['id'])) 
+       {
+               display_error( _("The account class ID must be numeric."));
+               set_focus('id');
+               return false;
+       }
        if (strlen($_POST['name']) == 0) 
        {
                display_error( _("The account class name cannot be empty."));
@@ -77,8 +91,8 @@ if ($Mode == 'Delete')
        {
                delete_account_class($selected_id);
                display_notification(_('Selected account class has been deleted'));
-               $Mode = 'RESET';
        }
+       $Mode = 'RESET';
 }
 
 //-----------------------------------------------------------------------------------
@@ -113,7 +127,7 @@ while ($myrow = db_fetch($result))
        label_cell($myrow['class_name']);
        label_cell($bs_text);
        edit_button_cell("Edit".$myrow["cid"], _("Edit"));
-       edit_button_cell("Delete".$myrow["cid"], _("Delete"));
+       delete_button_cell("Delete".$myrow["cid"], _("Delete"));
        end_row();
 }