[Koha-patches] [PATCH] Bug 7670 - make required fields red

Owen Leonard oleonard at myacpl.org
Thu Mar 8 14:56:29 CET 2012


Adding "required" style and "Required" note to additem fields,
consistent with the way required fields are displayed
on the add patron form.

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.
---
 .../intranet-tmpl/prog/en/css/staff-global.css     |    1 +
 .../prog/en/modules/cataloguing/additem.tt         |    9 ++++++---
 2 files changed, 7 insertions(+), 3 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 fec66d6..e3120a3 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..e24fb78 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
@@ -237,8 +237,11 @@ function set_to_today(id, force) {
 	<ol>
         [% FOREACH ite IN item %]
                <li><div class="subfield_line" style="[% ite.visibility %]" id="subfield[% ite.tag %][% ite.subfield %][% ite.random %]">
-
-               <label>[% ite.subfield %] - [% IF ( ite.mandatory ) %]<b>[% END %][% ite.marc_lib %][% IF ( ite.mandatory ) %] *</b>[% END %]</label>
+                [% IF ( ite.mandatory ) %]
+               <label class="required">[% ite.subfield %] - [% ite.marc_lib %]</label>
+               [% ELSE %]
+               <label>[% ite.subfield %] - [% ite.marc_lib %]</label>
+               [% END %]
                 [% ite.marc_value %]
                 <input type="hidden" name="tag"       value="[% ite.tag %]" />
                 <input type="hidden" name="subfield"  value="[% ite.subfield %]" />
@@ -246,7 +249,7 @@ function set_to_today(id, force) {
                 [% IF ( ite.repeatable ) %]
                     <span class="buttonPlus" onclick="CloneSubfield('subfield[% ite.tag %][% ite.subfield %][% ite.random %]')">+</span>
                 [% END %]
-
+                [% IF ( ite.mandatory ) %] <span class="required">Required</span>[% END %]
             </div></li>
         [% END %]
     </ol>
-- 
1.7.3



More information about the Koha-patches mailing list