Switch to new access levels system
[fa-stable.git] / dimensions / dimension_entry.php
index 8912c11cd2fc1a4b4af8d7e84928008e6925f3d3..31f45748bbe19b646788906838f316ca2a8e636a 100644 (file)
@@ -1,8 +1,16 @@
 <?php
-
-
-$page_security = 10;
-$path_to_root="..";
+/**********************************************************************
+    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 = 'SA_DIMENSION';
+$path_to_root = "..";
 include_once($path_to_root . "/includes/session.inc");
 
 include_once($path_to_root . "/includes/date_functions.inc");
@@ -76,14 +84,11 @@ function safe_exit()
 {
        global $path_to_root;
 
-       hyperlink_no_params("", _("Enter a new dimension"));
+       hyperlink_no_params("", _("Enter a &new dimension"));
        echo "<br>";
-       hyperlink_no_params($path_to_root . "/dimensions/inquiry/search_dimensions.php", _("Select an existing dimension"));
-       echo "<br><br>";
-
-       end_page();
+       hyperlink_no_params($path_to_root . "/dimensions/inquiry/search_dimensions.php", _("&Select an existing dimension"));
 
-       exit;
+       display_footer_exit();
 }
 
 //-------------------------------------------------------------------------------------
@@ -98,14 +103,14 @@ function can_process()
        if (!references::is_valid($_POST['ref'])) 
        {
                display_error( _("The dimension reference must be entered."));
-               set_focus('ref');
+                       set_focus('ref');
                return false;
        }
 
        if (!is_new_reference($_POST['ref'], systypes::dimension())) 
        {
                display_error(_("The entered reference is already in use."));
-               set_focus('ref');
+                       set_focus('ref');
                return false;
        }
        }
@@ -206,14 +211,14 @@ if ($selected_id != -1)
        if (strlen($myrow[0]) == 0) 
        {
                display_error(_("The dimension sent is not valid."));
-               exit;
+               display_footer_exit();
        }
 
        // if it's a closed dimension can't edit it
        if ($myrow["closed"] == 1) 
        {
                display_error(_("This dimension is closed and cannot be edited."));
-               exit;
+               display_footer_exit();
        }
 
        $_POST['ref'] = $myrow["reference"];
@@ -249,16 +254,17 @@ textarea_row(_("Memo:"), 'memo_', null, 40, 5);
 
 end_table(1);
 
-submit_add_or_update_center($selected_id == -1);
-
 if ($selected_id != -1) 
 {
        echo "<br>";
-
-       submit_center_first('close', _("Close This Dimension"));
-       submit_center_last('delete', _("Delete This Dimension"));
+       submit_center_first('UPDATE_ITEM', _("Update"), _('Save changes to dimension'), 'default');
+       submit('close', _("Close This Dimension"), true, _('Mark this dimension as closed'), true);
+       submit_center_last('delete', _("Delete This Dimension"), _('Delete unused dimension'), true);
+}
+else
+{
+       submit_center('ADD_ITEM', _("Add"), true, '', 'default');
 }
-
 end_form();
 
 //--------------------------------------------------------------------------------------------