Bugzilla – Attachment 19574 Details for
Bug 10543
false mandatory warning in additem
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10543 - Unify item mandatory subfields check
0002-Bug-10543-Unify-item-mandatory-subfields-check.patch (text/plain), 5.04 KB, created by
Fridolin Somers
on 2013-07-11 14:53:12 UTC
(
hide
)
Description:
Bug 10543 - Unify item mandatory subfields check
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2013-07-11 14:53:12 UTC
Size:
5.04 KB
patch
obsolete
>From c4ed19ce152c5b0138d5a4b601ab711983f1c9d8 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Thu, 11 Jul 2013 16:30:27 +0200 >Subject: [PATCH 2/3] Bug 10543 - Unify item mandatory subfields check > >Use of CheckMandatorySubfields from cataloging.js everywhere an item cataloging form is checked for mandatories >--- > .../prog/en/modules/acqui/neworderempty.tt | 9 ++------- > .../intranet-tmpl/prog/en/modules/acqui/orderreceive.tt | 15 +++------------ > .../prog/en/modules/serials/serials-edit.tt | 14 ++++++-------- > 3 files changed, 11 insertions(+), 27 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >index 47ee262..4909a2e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -6,6 +6,7 @@ > <script type="text/javascript" src="[% themelang %]/js/acq.js"></script> > [% INCLUDE 'additem.js.inc' %] > <script type="text/javascript" src="[% themelang %]/js/additem.js"></script> >+<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script> > <script type="text/javascript" src="[% themelang %]/js/prevent_submit.js"></script> > <script type="text/javascript"> > //<![CDATA[ >@@ -64,13 +65,7 @@ function Check(ff) { > } > > if ( ff.field_value ) { >- var empty_item_mandatory = 0; >- for (i = 0; i < ff.field_value.length; i++) { >- //alert("i = " + i + " => " + ff.kohafield[i] ); >- if (ff.field_value[i].value.length == 0 && ff.mandatory[i].value == 1) { >- empty_item_mandatory++; >- } >- } >+ var empty_item_mandatory = CheckMandatorySubfields(ff); > if (empty_item_mandatory > 0) { > ok = 1; > _alertString += >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 0f454c0..67999e4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >@@ -2,23 +2,14 @@ > <title>Koha › Acquisitions › Receipt summary for : [% name %] [% IF ( invoice ) %]invoice, [% invoice %][% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'additem.js.inc' %] >-<script type="text/javascript" src="[% themelang %]/js/additem.js"> </script> >+<script type="text/javascript" src="[% themelang %]/js/additem.js"></script> >+<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script> > <script type="text/javascript" src="[% themelang %]/js/prevent_submit.js"></script> > <script type="text/javascript"> > //<![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 total_errors = CheckMandatorySubfields(form); > if (total_errors != 0) { > var alertString = _("Form not submitted because of the following problem(s)"); > alertString += "\n------------------------------------------------------------------------------------\n"; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >index d0936d4..8f9ea5f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >@@ -78,21 +78,19 @@ function changeDate2(adate) { > } > > $(document).ready(function() { >- $("form#serials_edit").submit(function() { >- var total_errors = 0; >- $(".subfield_line:visible", this).each(function() { >- if ($("*[name=field_value]", this).val().length == 0 && >- $("*[name=mandatory]", this).val() == 1) { >- total_errors++; >- } >+ $("form#serials_edit").submit(function() { >+ var total_errors = 0; >+ $(this).find(".cataloguing_additem_itemlist:visible").each(function(){ >+ total_errors = total_errors + CheckMandatorySubfields(this); > }); > if ( total_errors > 0 ) { > var mes = _("Form not submitted because of the following problem(s)"); > mes += "\n------------------------------------------------------------------------------------\n"; >- mes += "\n- "+ total_errors+_(" mandatory fields empty (see bold subfields)"); >+ mes += "\n- " + total_errors + _(" mandatory fields empty (highlighted)"); > alert(mes); > return false; > } >+ return true; > }); > }); > //]]> >-- >1.7.10.4 >
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 10543
:
19412
|
19572
|
19574
|
19576
|
19704
|
19705
|
19706
|
19980
|
19981
|
19982