From 0576342cbb3e4258551a2b0111ae80bebe0d18d8 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 8 Mar 2012 08:53:45 -0500 Subject: [PATCH] Bug 7670 - make required fields red Adding "required" style and "Required" note to additem fields, consistent with the way required fields are displayed on the add patron form. This patch also corrects an error in the client-side validation script which misidentified which fields were required. Leaving a required field empty should result in an alert and the missing field being highlighted in yellow. To test, open the add item form on a record which uses a framework in which one or more item fields are required. Required fields should be labeled in red and appended with a "Required" note. Submit the form while some required fields are empty. You should see a javascript alert. The empty mandatory fields should have a yellow background. Signed-off-by: Liz Rea Works - passes tests. Signed-off-by: Paul Poulain --- .../intranet-tmpl/prog/en/css/staff-global.css | 1 + .../prog/en/modules/cataloguing/additem.tt | 30 ++++++++++--------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index b1c38f5..e8821f5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -1290,6 +1290,7 @@ div.note { span.required { font-style : italic; + margin-left : .5em; } .term { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt index 91c2d48..008af82 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -34,25 +34,24 @@ function active(numlayer) } } function Check(f) { - var total_errors=0; -// alert(f.field_value.length); - for (i=0 ; i [% FOREACH ite IN item %]
  • - - + [% IF ( ite.mandatory ) %] + + [% ELSE %] + + [% END %] [% ite.marc_value %] @@ -246,7 +248,7 @@ function set_to_today(id, force) { [% IF ( ite.repeatable ) %] + [% END %] - + [% IF ( ite.mandatory ) %] Required[% END %]
  • [% END %] -- 1.7.5.4