X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=dimensions%2Fdimension_entry.php;h=7b9bcb3791ceb475581dc3a87287c7ed71b480c8;hb=36ec54507b7841b2352734b81e45b95e371ecdab;hp=bf6fe3eeb1b179e0513486c869870d3b984f7823;hpb=8cac19c37c960e50f7c11964510c0d09a530e7b5;p=fa-stable.git
diff --git a/dimensions/dimension_entry.php b/dimensions/dimension_entry.php
index bf6fe3ee..7b9bcb37 100644
--- a/dimensions/dimension_entry.php
+++ b/dimensions/dimension_entry.php
@@ -1,8 +1,16 @@
.
+***********************************************************************/
+$page_security = 'SA_DIMENSION';
+$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
@@ -70,15 +78,25 @@ if (isset($_GET['ClosedID']))
safe_exit();
}
+//---------------------------------------------------------------------------------------
+
+if (isset($_GET['ReopenedID']))
+{
+ $id = $_GET['ReopenedID'];
+
+ display_notification_centered(_("The dimension has been re-opened. ") . " #$id");
+ safe_exit();
+}
+
//-------------------------------------------------------------------------------------------------
function safe_exit()
{
global $path_to_root;
- hyperlink_no_params("", _("Enter a new dimension"));
+ hyperlink_no_params("", _("Enter a &new dimension"));
echo "
";
- hyperlink_no_params($path_to_root . "/dimensions/inquiry/search_dimensions.php", _("Select an existing dimension"));
+ hyperlink_no_params($path_to_root . "/dimensions/inquiry/search_dimensions.php", _("&Select an existing dimension"));
display_footer_exit();
}
@@ -87,19 +105,19 @@ function safe_exit()
function can_process()
{
- global $selected_id;
+ global $selected_id, $Refs;
if ($selected_id == -1)
{
- if (!references::is_valid($_POST['ref']))
+ if (!$Refs->is_valid($_POST['ref']))
{
display_error( _("The dimension reference must be entered."));
set_focus('ref');
return false;
}
- if (!is_new_reference($_POST['ref'], systypes::dimension()))
+ if (!is_new_reference($_POST['ref'], ST_DIMENSION))
{
display_error(_("The entered reference is already in use."));
set_focus('ref');
@@ -190,6 +208,13 @@ if (isset($_POST['close']))
meta_forward($_SERVER['PHP_SELF'], "ClosedID=$selected_id");
}
+if (isset($_POST['reopen']))
+{
+
+ // update the closed flag
+ reopen_dimension($selected_id);
+ meta_forward($_SERVER['PHP_SELF'], "ReopenedID=$selected_id");
+}
//-------------------------------------------------------------------------------------
start_form();
@@ -207,11 +232,11 @@ if ($selected_id != -1)
}
// if it's a closed dimension can't edit it
- if ($myrow["closed"] == 1)
- {
- display_error(_("This dimension is closed and cannot be edited."));
- display_footer_exit();
- }
+ //if ($myrow["closed"] == 1)
+ //{
+ // display_error(_("This dimension is closed and cannot be edited."));
+ // display_footer_exit();
+ //}
$_POST['ref'] = $myrow["reference"];
$_POST['closed'] = $myrow["closed"];
@@ -219,7 +244,7 @@ if ($selected_id != -1)
$_POST['type_'] = $myrow["type_"];
$_POST['date_'] = sql2date($myrow["date_"]);
$_POST['due_date'] = sql2date($myrow["due_date"]);
- $_POST['memo_'] = get_comments_string(systypes::dimension(), $selected_id);
+ $_POST['memo_'] = get_comments_string(ST_DIMENSION, $selected_id);
hidden('ref', $_POST['ref']);
@@ -229,7 +254,7 @@ if ($selected_id != -1)
}
else
{
- ref_row(_("Dimension Reference:"), 'ref', '', references::get_next(systypes::dimension()));
+ ref_row(_("Dimension Reference:"), 'ref', '', $Refs->get_next(ST_DIMENSION));
}
text_row_ex(_("Name") . ":", 'name', 50, 75);
@@ -240,22 +265,28 @@ number_list_row(_("Type"), 'type_', null, 1, $dim);
date_row(_("Start Date") . ":", 'date_');
-date_row(_("Date Required By") . ":", 'due_date', '', null, sys_prefs::default_dimension_required_by());
+date_row(_("Date Required By") . ":", 'due_date', '', null, $SysPrefs->default_dimension_required_by());
textarea_row(_("Memo:"), 'memo_', null, 40, 5);
end_table(1);
+if (isset($_POST['closed']) && $_POST['closed'] == 1)
+ display_note(_("This Dimension is closed."), 0, 0, "class='currentfg'");
+
if ($selected_id != -1)
{
echo "
";
- submit_center_first('UPDATE_ITEM', _("Update"), _('Save changes to dimension'), true);
- submit('close', _("Close This Dimension"), true, _('Mark this dimension as closed'), true);
+ submit_center_first('UPDATE_ITEM', _("Update"), _('Save changes to dimension'), 'default');
+ if ($_POST['closed'] == 1)
+ submit('reopen', _("Re-open This Dimension"), true, _('Mark this dimension as re-opened'), true);
+ else
+ 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, '', true);
+ submit_center('ADD_ITEM', _("Add"), true, '', 'default');
}
end_form();