MT 1092 : Items table is now sortable ; Not found barcodes are not displayed as empty...
authorMatthias Meusburger <matthias.meusburger@biblibre.com>
Mon, 14 Sep 2009 14:38:27 +0000 (16:38 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 30 Sep 2009 09:30:31 +0000 (11:30 +0200)
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tmpl
tools/batchMod.pl

index 9cee451..07369d6 100644 (file)
@@ -1,6 +1,14 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Koha &rsaquo; Tools &rsaquo; Inventory</title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<script type="text/JavaScript" language="JavaScript">
+//<![CDATA[
+         $(document).ready(function() {
+           $("#itemst").tablesorter();
+        });
+//]]>
+</script>
 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
 </head>
 <body>
 <form name="f" action="batchMod.pl" method="post">
 <div id="cataloguing_additem_itemlist">
         <div style="overflow:auto">
-        <table>
-            <tr>
-                               <th>&nbsp;</th>
-                <!-- TMPL_LOOP NAME="item_header_loop" --> <th> <!-- TMPL_VAR NAME="header_value" --> </th>
-                <!-- /TMPL_LOOP --> </tr>
-            <!-- TMPL_LOOP NAME="item_loop" --> <tr> <!-- TMPL_IF Name="nomod"--> <td class="error">Cannot Edit</td><!--TMPL_ELSE--><td><input type="checkbox" name="itemnumber" value="<!--TMPL_VAR Name="itemnumber"-->" id="row<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked"></td><!--/TMPL_IF-->
+        <table id="itemst">
+           <thead>
+               <tr>
+                   <th>&nbsp;</th>
+                   <!-- TMPL_LOOP NAME="item_header_loop" --> 
+                   <th> <!-- TMPL_VAR NAME="header_value" --> </th>
+                   <!-- /TMPL_LOOP --> 
+               </tr>
+           </thead>
+           <tbody>
+            <!-- TMPL_LOOP NAME="item_loop" --> <tr> <!-- TMPL_IF Name="nomod"--> <td class="error">Cannot Edit</td><!--TMPL_ELSE--><td><input type="checkbox" name="itemnumber" value="<!--TMPL_VAR Name="itemnumber"-->" id="row<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" /></td><!--/TMPL_IF-->
                 <!-- TMPL_LOOP NAME="item_value" --> <td><!-- TMPL_VAR ESCAPE="HTML" NAME="field" --></td> 
                                <!-- /TMPL_LOOP --> </tr>
             <!-- /TMPL_LOOP -->
+           </tbody>
         </table>
         </div>
 </div>
index d97921e..bb6300f 100755 (executable)
@@ -126,6 +126,8 @@ if ($op eq "show"){
        switch ($filecontent) {
            case "barcode_file" {
                push @itemnumbers,map{GetItemnumberFromBarcode($_)} @contentlist;
+               # Remove not found barcodes
+               @itemnumbers = grep(!/^$/, @itemnumbers);
            }
 
            case "itemid_file" {
@@ -136,6 +138,9 @@ if ($op eq "show"){
        if ( my $list=$input->param('barcodelist')){
         push my @barcodelist, split(/\s\n/, $list);
        push @itemnumbers,map{GetItemnumberFromBarcode($_)} @barcodelist;
+       # Remove not found barcodes
+       @itemnumbers = grep(!/^$/, @itemnumbers);
+
     }
 }
        $items_display_hashref=BuildItemsData(@itemnumbers);