[Koha-patches] [PATCH] [SIGNED-OFF] Bug 10543 - add mandatory subfield check to addorderiso2709.pl

Srdjan srdjan at catalyst.net.nz
Wed Jul 17 04:38:54 CEST 2013


From: Fridolyn SOMERS <fridolyn.somers at biblibre.com>

When adding orders from staged file, you can create one order per record using item form in the bottom of addorderiso2709.pl.
This form was missing check.

Signed-off-by: Srdjan <srdjan at catalyst.net.nz>
---
 .../intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
index 3627077..7e87f5e 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
@@ -13,6 +13,7 @@
 [% INCLUDE 'datatables-strings.inc' %]
 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
+<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
 <script type="text/JavaScript">
 //<![CDATA[
     [% IF (dateformat == 'metric') %]
@@ -25,6 +26,18 @@
             ],
             "sPaginationType": "four_button"
         } ) );
+        
+        $("form#Aform").submit(function() {
+            var total_errors = CheckMandatorySubfields(this);
+            if (total_errors > 0) {
+                var 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;
+            }
+            return true;
+        });
     });
 //]]>
 </script>
-- 
1.8.1.2


More information about the Koha-patches mailing list