From 65c7c4db30bcde3a5575c8fb32953ea275995fdc Mon Sep 17 00:00:00 2001 From: Christophe Croullebois Date: Mon, 13 Aug 2012 17:09:30 +0200 Subject: [PATCH] Bug 8637: Lack of control on mandatory in orderreveive.tt Just add a check in Jscript when the form is submited, the same as in additem.tt On Owen's suggestion I have added the red color and 'Required', the same as in additem. On Jonathan's suggestion I have used the CSS class for red and italic and I have changed a variable's name (alertString2). Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Mandatory fields are now correctly checked on saving. On other Jonathan's suggestion I have created a new class "missing" and I have added the background to staff-global.css. The same for additem.tt. Signed-off-by: Katrin Fischer Retested because of minor CSS change. Works nicely. Signed-off-by: Paul Poulain Signed-off-by: Chris Cormack --- .../prog/en/css/staff-global.css | 4 ++++ .../prog/en/modules/acqui/orderreceive.tt | 22 +++++++++++++++++++ .../prog/en/modules/cataloguing/additem.tt | 2 +- .../en/modules/services/itemrecorddisplay.tt | 16 +++++--------- 4 files changed, 33 insertions(+), 11 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 334f0adaca..5ad981aeec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -1347,6 +1347,10 @@ span.required { margin-left : .5em; } +.missing{ + background-color : #FFFFCC; +} + .term { background-color: #FFC; color : #990000; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt index 97a7223363..ca96819076 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -7,6 +7,28 @@ // div:last"); var tobedeleted = true; 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 eabf5a814a..7b45a9f295 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -39,7 +39,7 @@ function Check(f) { if($(this).val() == 1){ var mandatory_field = $("input[name='field_value'],select[name='field_value']").eq(i); if(mandatory_field.val() == ''){ - mandatory_field.css("background-color","#FFFFCC"); + mandatory_field.addClass("missing"); total_errors++; } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/services/itemrecorddisplay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/services/itemrecorddisplay.tt index 6790b3da6f..005a0a87cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/services/itemrecorddisplay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/services/itemrecorddisplay.tt @@ -2,22 +2,18 @@ [% FOREACH iteminfo IN iteminformation %]
  • - + [% IF (iteminfo.mandatory) %] + + [% ELSE %] + + [% END %] [% iteminfo.marc_value %] + [% IF (iteminfo.mandatory) %] Required[% END %]
  • [% END %] -- 2.39.5