projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Focus set to invalid field after submit check fail
[fa-stable.git]
/
dimensions
/
dimension_entry.php
diff --git
a/dimensions/dimension_entry.php
b/dimensions/dimension_entry.php
index 6474ac1482aee51cbc82cc30d4c67b189d060a4d..e0b89b3fbce6be7d499370799985667903322e0e 100644
(file)
--- a/
dimensions/dimension_entry.php
+++ b/
dimensions/dimension_entry.php
@@
-5,8
+5,6
@@
$page_security = 10;
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");
-page(_("Dimension Entry"));
-
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/manufacturing.inc");
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/manufacturing.inc");
include_once($path_to_root . "/includes/data_checks.inc");
@@
-14,6
+12,11
@@
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/dimensions/includes/dimensions_db.inc");
include_once($path_to_root . "/dimensions/includes/dimensions_ui.inc");
include_once($path_to_root . "/dimensions/includes/dimensions_db.inc");
include_once($path_to_root . "/dimensions/includes/dimensions_ui.inc");
+$js = "";
+if ($use_date_picker)
+ $js .= get_js_date_picker();
+page(_("Dimension Entry"), false, false, "", $js);
+
//---------------------------------------------------------------------------------------
if (isset($_GET['trans_no']))
//---------------------------------------------------------------------------------------
if (isset($_GET['trans_no']))
@@
-95,12
+98,14
@@
function can_process()
if (!references::is_valid($_POST['ref']))
{
display_error( _("The dimension reference must be entered."));
if (!references::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()))
{
display_error(_("The entered reference is already in use."));
return false;
}
if (!is_new_reference($_POST['ref'], systypes::dimension()))
{
display_error(_("The entered reference is already in use."));
+ set_focus('ref');
return false;
}
}
return false;
}
}
@@
-108,18
+113,21
@@
function can_process()
if (strlen($_POST['name']) == 0)
{
display_error( _("The dimension name must be entered."));
if (strlen($_POST['name']) == 0)
{
display_error( _("The dimension name must be entered."));
+ set_focus('name');
return false;
}
if (!is_date($_POST['date_']))
{
display_error( _("The date entered is in an invalid format."));
return false;
}
if (!is_date($_POST['date_']))
{
display_error( _("The date entered is in an invalid format."));
+ set_focus('date_');
return false;
}
if (!is_date($_POST['due_date']))
{
display_error( _("The required by date entered is in an invalid format."));
return false;
}
if (!is_date($_POST['due_date']))
{
display_error( _("The required by date entered is in an invalid format."));
+ set_focus('due_date');
return false;
}
return false;
}
@@
-162,6
+170,7
@@
if (isset($_POST['delete']))
if (dimension_has_payments($selected_id) || dimension_has_deposits($selected_id))
{
display_error(_("This dimension cannot be deleted because it has already been processed."));
if (dimension_has_payments($selected_id) || dimension_has_deposits($selected_id))
{
display_error(_("This dimension cannot be deleted because it has already been processed."));
+ set_focus('ref');
$cancel_delete = true;
}
$cancel_delete = true;
}