Focus js optimizations.
[fa-stable.git] / gl / manage / currencies.php
index eb36170e7a0827fee5d9495d51835340aaf8af38..f1b91de01618371f218dca7c8c961eef070e4962 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       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/gpl-3.0.html>.
+***********************************************************************/
 $page_security = 9;
 $path_to_root="../..";
 include_once($path_to_root . "/includes/session.inc");
@@ -123,12 +132,11 @@ function check_can_delete()
 function handle_delete()
 {
        global $selected_id, $Mode;
-       if (!check_can_delete())
-               return;
+       if (check_can_delete()) {
        //only delete if used in neither customer or supplier, comp prefs, bank trans accounts
-       
-       delete_currency($selected_id);
-       display_notification(_('Selected currency has been deleted'));
+               delete_currency($selected_id);
+               display_notification(_('Selected currency has been deleted'));
+       }
        $Mode = 'RESET';
 }
 
@@ -166,7 +174,7 @@ function display_currencies()
                label_cell($myrow["country"]);
                edit_button_cell("Edit".$myrow["curr_abrev"], _("Edit"));
                if ($myrow["curr_abrev"] != $company_currency)
-                       edit_button_cell("Delete".$myrow["curr_abrev"], _("Delete"));
+                       delete_button_cell("Delete".$myrow["curr_abrev"], _("Delete"));
                else
                        label_cell('');
                end_row();