Bugzilla – Attachment 11748 Details for
Bug 8637
Lack of control on mandatory in orderreveive.tt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
0001-Bug-8637-Lack-of-control-on-mandatory-in-orderreveiv.patch (text/plain), 5.47 KB, created by
Christophe Croullebois
on 2012-08-22 13:53:07 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Christophe Croullebois
Created:
2012-08-22 13:53:07 UTC
Size:
5.47 KB
patch
obsolete
>From 58865bb2669d6fc2debfd6e9d7a5d9d7da8c650f Mon Sep 17 00:00:00 2001 >From: Christophe Croullebois <christophe.croullebois@biblibre.com> >Date: Mon, 13 Aug 2012 17:09:30 +0200 >Subject: [PATCH 1/1] 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 <chris@bigballofwax.co.nz> > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >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. >--- > .../intranet-tmpl/prog/en/css/staff-global.css | 4 ++++ > .../prog/en/modules/acqui/orderreceive.tt | 22 ++++++++++++++++++++ > .../prog/en/modules/cataloguing/additem.tt | 2 +- > .../prog/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 436b728..c642d0d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >+++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >@@ -1260,6 +1260,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 821dcd3..1e19f8b 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 @@ > //<![CDATA[ > function Check(form) { > [% IF (AcqCreateItemReceiving) %] >+ var total_errors=0; >+ $("input[name='mandatory'],select[name='mandatory']").each(function(i){ >+ if($(this).val() == 1){ >+ var mandatory_field = $("input[name='field_value'],select[name='field_value']").eq(i); >+ if(mandatory_field.val() == ''){ >+ mandatory_field.addClass("missing"); >+ total_errors++; >+ } >+ } >+ }); >+ >+ var alertString; >+ if (total_errors==0) { >+ return true; >+ } else { >+ alertString = _("Form not submitted because of the following problem(s)"); >+ alertString += "\n------------------------------------------------------------------------------------\n"; >+ alertString += "\n- "+ total_errors+_(" mandatory fields empty (highlighted)"); >+ alert(alertString); >+ return false; >+ } >+ > // Remove last itemblock if it is not in items_list > var lastitemblock = $("#outeritemblock > 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 6692274..05750b2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -44,7 +44,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 6790b3d..005a0a8 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 %] > <li> > <div class="subfield_line" style="[% iteminfo.hidden %];" id="subfield[% iteminfo.serialid %][% iteminfo.countitems %][% iteminfo.subfield %][% iteminfo.random %]"> >- <label> >- [% iteminfo.subfield %] - >- [% IF ( iteminfo.mandatory ) %] >- <b> >- [% END %] >- [% iteminfo.marc_lib %] >- [% IF ( iteminfo.mandatory ) %] >- *</b> >- [% END %] >- </label> >+ [% IF (iteminfo.mandatory) %] >+ <label class="required">[% iteminfo.subfield %] - [% iteminfo.marc_lib %]</label> >+ [% ELSE %] >+ <label>[% iteminfo.subfield %] - [% iteminfo.marc_lib %]</label> >+ [% END %] > [% iteminfo.marc_value %] > <input type="hidden" name="itemid" value="1" /> > <input type="hidden" name="kohafield" value="[% iteminfo.kohafield %]" /> > <input type="hidden" name="tag" value="[% iteminfo.tag %]" /> > <input type="hidden" name="subfield" value="[% iteminfo.subfield %]" /> > <input type="hidden" name="mandatory" value="[% iteminfo.mandatory %]" /> >+ [% IF (iteminfo.mandatory) %] <span class="required">Required</span>[% END %] > </div> > </li> > [% END %] >-- >1.7.9.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8637
:
11599
|
11639
|
11673
|
11698
|
11699
|
11735
|
11745
|
11748
|
11755