[Koha-patches] [PATCH] Bug 5521 - item edit form appears if no items found

Owen Leonard oleonard at myacpl.org
Tue Oct 30 15:55:38 CET 2012


This patch changes the template so that if no items are
found the page doesn't show "The following barcodes were found"
and doesn't show the item edit form.

To test, submit a batch which contains no valid barcodes.
Compare to a batch which contains some or all valid barcodes.
---
 .../prog/en/modules/tools/batchMod-edit.tt         |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt
index 551ff40..8645853 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt
@@ -80,8 +80,10 @@ $(document).ready(function(){
         [% END %]
     </tbody>
       </table>
-      [% UNLESS ( too_many_items ) %]
-      <h4>The following barcodes were found: </h4>
+      [% IF ( item_loop ) %]
+          [% UNLESS ( too_many_items ) %]
+          <h4>The following barcodes were found: </h4>
+          [% END %]
       [% END %]
   [% END %] <!-- /notfoundbarcodes -->
 
@@ -142,6 +144,7 @@ $(document).ready(function(){
     [% END %]
 [% END %]<!-- /too_many_items -->
 
+[% IF ( item_loop ) %]
 <div id="cataloguing_additem_newitem">
         <h2>Edit Items</h2>
         <div class="hint">Checking the box right next the subfield label will disable the entry and delete the subfield on all selected items. Leave fields blank to make no change.</div>
@@ -179,6 +182,9 @@ $(document).ready(function(){
          <a href="/cgi-bin/koha/tools/batchMod.pl" class="cancel" onclick="history.back();return false;">Cancel</a>
     </fieldset>
 </div>
+[% ELSE %]
+    <p><a href="/cgi-bin/koha/tools/batchMod.pl">Return to batch item modification</a></p>
+[% END %]
 [% ELSE %] <!-- // show -->
 <fieldset class="action">
 [% IF ( src == 'CATALOGUING') %]
-- 
1.7.9.5


More information about the Koha-patches mailing list