[Koha-cvs] koha koha-tmpl/opac-tmpl/prog/en/opac-basket.tm... [rel_3_0]

Antoine Farnault antoine at koha-fr.org
Mon Jan 15 18:19:30 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Antoine Farnault <toins>	07/01/15 17:19:30

Modified files:
	koha-tmpl/opac-tmpl/prog/en: opac-basket.tmpl opac-shelves.tmpl 
	                             opac-showreviews.tmpl 
	opac           : opac-shelves.pl 

Log message:
	enable to add checked items to a shelf.
	Some display enhancements.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/opac-tmpl/prog/en/opac-basket.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.8&r2=1.1.2.9
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/opac-tmpl/prog/en/opac-shelves.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.8&r2=1.1.2.9
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/opac-tmpl/prog/en/opac-showreviews.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.1&r2=1.1.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-shelves.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.8.2.11&r2=1.8.2.12

Patches:
Index: koha-tmpl/opac-tmpl/prog/en/opac-basket.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/opac-tmpl/prog/en/opac-basket.tmpl,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -b -r1.1.2.8 -r1.1.2.9
--- koha-tmpl/opac-tmpl/prog/en/opac-basket.tmpl	22 Dec 2006 17:12:12 -0000	1.1.2.8
+++ koha-tmpl/opac-tmpl/prog/en/opac-basket.tmpl	15 Jan 2007 17:19:30 -0000	1.1.2.9
@@ -9,8 +9,8 @@
 
 <div> <!-- main -->
 
-
-<!-- TMPL_UNLESS NAME="print_basket" --><h1>Your Book Bag</h1>
+<!-- TMPL_UNLESS NAME="print_basket" -->
+<h1>Your Book Bag</h1>
 
 <div id="action">
         <!-- TMPL_IF NAME="verbose" -->
@@ -20,11 +20,20 @@
         <!-- /TMPL_IF -->
         <a href="opac-basket.pl" onclick="sendBasket(); return false;">Send</a>
         <a href="opac-basket.pl" onclick="printBasket(); return false;">Print</a>
-        <a href="opac-basket.pl" onclick="delSelRecords(); return false;">Remove Selected Items</a>
         <a href="opac-basket.pl" onclick="delBasket(); return false;">Empty and Close</a>
         <a href="opac-basket.pl" onclick="quit(); return false;">Hide Window</a>
         <!-- /TMPL_UNLESS -->
 </div>
+<br />
+<p>
+<b>Selected items :</b>
+<a href="javascript:delSelRecords();">
+    Remove
+</a> | 
+<a href="javascript:addSelToShelf();">
+    Add to a shelf
+</a>
+</p>
 
 <!-- TMPL_IF NAME="verbose" -->
     <!-- TMPL_LOOP NAME="BIBLIO_RESULTS" -->
@@ -201,9 +210,6 @@
                         <p><!-- TMPL_VAR name="notes" --></p>
                         <!-- /TMPL_IF -->
             </td>
-            <td>
-                <a href="javascript:Dopop('/cgi-bin/koha/opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->')">Add to a shelf</a>
-            </td>
             <td><!-- TMPL_VAR NAME="classification" --></td>
             </tr>
         <!-- /TMPL_LOOP -->
@@ -212,7 +218,7 @@
 
 <!-- TMPL_UNLESS NAME="print_basket" -->
 <form name="myform">
-    <input type="hidden" name="records">
+    <input type="hidden" name="records" id="records" />
 </form>
 <!-- /TMPL_UNLESS -->
 

Index: koha-tmpl/opac-tmpl/prog/en/opac-shelves.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/opac-tmpl/prog/en/opac-shelves.tmpl,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -b -r1.1.2.8 -r1.1.2.9
--- koha-tmpl/opac-tmpl/prog/en/opac-shelves.tmpl	10 Jan 2007 10:15:30 -0000	1.1.2.8
+++ koha-tmpl/opac-tmpl/prog/en/opac-shelves.tmpl	15 Jan 2007 17:19:30 -0000	1.1.2.9
@@ -13,25 +13,29 @@
  Modify this Shelf</a>
 <!-- /TMPL_IF -->
 
-<form class="inline" action="/cgi-bin/koha/opac-shelves.pl" method="post" name="mainform">
+<form action="/cgi-bin/koha/opac-shelves.pl"
+      method="POST"
+      name="mainform"
+      onsubmit="return checkForm(this);">
+    
     <!-- TMPL_IF NAME="itemsloop" -->
     <table>
         <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR Name="shelfnumber" -->" />
         <input type="hidden" name="modifyshelfcontents" value="1" />
             <tr>
                 <th>
-                    <a href="/cgi-bin/koha/opac-shelves.pl" onclick="CheckAll(); return false;">Check All</a>
+                    <a style="color:white;" href="/cgi-bin/koha/opac-shelves.pl" onclick="CheckAll(); return false;">Check All</a>
                 </th>
                 <th>&nbsp;</th>
                 <th>Title</th>
                 <th>Author</th>
                 <th>Call No.</th>
-                <th>&nbsp;</th>
             </tr>
         <!-- TMPL_LOOP Name="itemsloop" -->
             <tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->>
                     <td>
-                        <input type="checkbox" name="REM-<!-- TMPL_VAR Name="itemnumber" -->" />
+                        <input type="checkbox" name="MOD-<!-- TMPL_VAR Name="itemnumber" -->" />
+                        <input type="hidden" name="ModBiblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->">
                     </td>
                     <td>
                         <img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="itemtype" -->.gif" alt="<!-- TMPL_VAR NAME="itemtype" -->" title="<!-- TMPL_VAR NAME="itemtype" -->" />
@@ -56,11 +60,6 @@
                     </td>
                     <td><!-- TMPL_VAR Name="author" --></td>
                     <td><!-- TMPL_VAR NAME="classification" --></td>
-                    <td>
-                        <a href="javascript:addRecord('<!-- TMPL_VAR NAME="biblionumber" -->');">
-                            Add to my basket
-                        </a>
-                    </td>
         </tr>
         <!-- /TMPL_LOOP -->
     </table>
@@ -78,11 +77,20 @@
     <!-- TMPL_IF name="manageshelf" -->
         <!-- TMPL_IF NAME="itemsloop" -->
             <b>With selected items :</b>
+            <input id="check-remove"
+                   type="checkbox"
+                   name="remove"
+                   />
+            <label for="check-remove">remove</label>
+            
+            <input id="check-addbb"
+                   type="checkbox"
+                   name="addToBookBag"
+                   />
+            <label for="check-addbb">Add to bookbag</label>
+            
             <input type="submit"
-                   value="Remove"
-                   class="icon delete"
-                   onclick="return confirmDelete('Are you sure you want to remove these items from the shelf?')"
-                   style="display:inline;"
+                   value=" GO "
                    />
         <!-- /TMPL_IF -->
         <!-- /TMPL_IF -->
@@ -101,7 +109,7 @@
                 <input name="addbarcode" type="text" id="addbarcode" size="14" maxlength="14" />
                 <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR Name="shelfnumber" -->" />
                 <input type="hidden" name="modifyshelfcontents" value="1" />
-                <input type="submit" value="Save" />
+                <input type="submit" value=" Add " />
             </td>
         </tr>
     </table>
@@ -192,12 +200,50 @@
 <tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->><td><a href="opac-shelves.pl?viewshelf=<!-- TMPL_VAR Name="shelf" -->"><!-- TMPL_VAR Name="shelfname" --></a></td><td><!-- TMPL_IF NAME="category1" -->Private<!-- /TMPL_IF --><!-- TMPL_IF NAME="category2" -->Public<!-- /TMPL_IF --><!-- TMPL_IF NAME="category3" -->Free<!-- /TMPL_IF --></td><td><!-- TMPL_VAR Name="shelfbookcount" --> item(s)</td><td><!-- TMPL_IF name="mine" --><a href="opac-shelves.pl?op=modif&amp;shelf=<!-- TMPL_VAR NAME="shelf" -->">Modify</a><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td></tr>
             <!-- /TMPL_LOOP -->
         </table>
-        <p><form action="opac-shelves.pl" method="get"><input type="hidden" value="1" name="shelves" /><input type="submit" value="Add or Remove Book Shelves" /></form></p>
+        <p><form action="/cgi-bin/koha/opac-shelves.pl" method="get"><input type="hidden" value="1" name="shelves" /><input type="submit" value="Add or Remove Book Shelves" /></form></p>
     <!-- /TMPL_IF -->
 <!-- /TMPL_IF -->
 
 <br clear="both" />
 
-</body>
-</html>
+<script type="text/javascript" language="javascript">
+    // Set the focus the barcode input if it exists.
+    var barcodeInput;
+    if (barcodeInput = document.getElementById('addbarcode')) {
+        barcodeInput.focus();
+    }
+    /**
+     *  Function checkForm
+     *  This function check the form beform submited it.
+     *  If there are items to add to bookbag then add it there.
+     */
+    function checkForm(form){
+        if( form.addToBookBag.checked ) { // add to BookBag
+            AddCheckedToBookBag(form);
+        }
+        return true;
+    }
+
+    /**
+     *  Function AddCheckedToBookBag
+     *  This function add the checked item to bookbag.
+     */
+        function AddCheckedToBookBag(form) {
+            var inputs = form.getElementsByTagName('input');
+            for(var i=0,num=inputs.length; i < num; i++){
+                var input = inputs[i].getAttribute('type');
+                if (input == "checkbox") {
+                    if( inputs[i].checked ) {
+                        var itemnumber   = inputs[i].getAttribute('name');
+                        var regexp       = /MOD-/;
+                        if(itemnumber.match(regexp)){
+                            var biblionumber = inputs[i+1].value;
+                            addRecord(biblionumber,null,1); // function from basket.js
+                        }
+                    }
+                }
+            }
+        }
+</script>
 
+<!-- TMPL_INCLUDE NAME="opac-bottom.inc"-->

Index: koha-tmpl/opac-tmpl/prog/en/opac-showreviews.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/opac-tmpl/prog/en/Attic/opac-showreviews.tmpl,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -b -r1.1.2.1 -r1.1.2.2
--- koha-tmpl/opac-tmpl/prog/en/opac-showreviews.tmpl	7 Dec 2006 18:09:01 -0000	1.1.2.1
+++ koha-tmpl/opac-tmpl/prog/en/opac-showreviews.tmpl	15 Jan 2007 17:19:30 -0000	1.1.2.2
@@ -21,5 +21,3 @@
 </table>
 
 <!-- TMPL_INCLUDE NAME="opac-bottom.inc"-->
-
-

Index: opac/opac-shelves.pl
===================================================================
RCS file: /sources/koha/koha/opac/opac-shelves.pl,v
retrieving revision 1.8.2.11
retrieving revision 1.8.2.12
diff -u -b -r1.8.2.11 -r1.8.2.12
--- opac/opac-shelves.pl	10 Jan 2007 10:52:58 -0000	1.8.2.11
+++ opac/opac-shelves.pl	15 Jan 2007 17:19:30 -0000	1.8.2.12
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: opac-shelves.pl,v 1.8.2.11 2007/01/10 10:52:58 toins Exp $
+# $Id: opac-shelves.pl,v 1.8.2.12 2007/01/15 17:19:30 toins Exp $
 
 =head1 NAME
 
@@ -90,12 +90,14 @@
     if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ) ) {
         AddToShelf( $item->{'itemnumber'}, $shelfnumber );
         foreach ( $query->param ) {
-            if (/REM-(\d*)/) {
+            if (/MOD-(\d*)/) {
                 my $itemnumber = $1;
+                if ( $query->param('remove') eq "on" ) {
                 DelFromShelf( $itemnumber, $shelfnumber );
             }
         }
     }
+    }
 }
 
 # getting the Shelves list
@@ -227,6 +229,10 @@
 
 #
 # $Log: opac-shelves.pl,v $
+# Revision 1.8.2.12  2007/01/15 17:19:30  toins
+# enable to add checked items to a shelf.
+# Some display enhancements.
+#
 # Revision 1.8.2.11  2007/01/10 10:52:58  toins
 # adding syspref directly to Auth.pm instead of to the template.
 #





More information about the Koha-cvs mailing list