Bug 8448 - Holds Awaiting Pickup : Cancelling a hold on a waiting item with multiple...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / waitingreserves.tt
index 39400bf..ea0faef 100644 (file)
@@ -11,7 +11,7 @@ $.tablesorter.addParser({
     type: 'text'
 });
      $(document).ready(function() {
-         $('#resultlist > ul').tabs();
+         $('#resultlist').tabs();
          $("th a").hide();
          $.tablesorter.defaults.widgets = ['zebra'];
          $("#holdst,#holdso").tablesorter({[% IF ( dateformat == 'metric' ) %]
@@ -23,7 +23,7 @@ $.tablesorter.addParser({
 //]]>
 </script>
 </head>
-<body>
+<body id="circ_waitingreserves" class="circ">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'circ-search.inc' %]
 
@@ -41,35 +41,38 @@ $.tablesorter.addParser({
         <h2>Holds awaiting pickup for your library on: [% show_date %]
             [% IF ( all_branches_link ) %]
             <span style="margin-left:20px"><a href="[% all_branches_link %]">
-            View all branches</a></span>
+            View all libraries</a></span>
             [% END %]
         </h2>
-        [% IF ( messagetransfert ) %]
-            <div>
-                <h2>Hold find for ([% nextreservtitle %]), must be transferred</h2>
-                <p>This hold placed by : <b> [% nextreservsurname %] [% nextreservfirstname %]</b> at the library : <b> [% branchname %] </b>, Please transfer this hold.
-                </p>
-                <form name="cancelReservewithtransfert" action="waitingreserves.pl" method="post">
-                    <input type="submit" class="button" />
-                </form>
-            </div>
-        [% END %]
-        [% IF ( waiting ) %]
-            <div id="bloc25">
-                <h2>This hold is waiting</h2>
-                <p>This hold ([% nextreservtitle %]) was placed by <b> : [% nextreservsurname %] [% nextreservfirstname %]</b>,
-                Please retain this hold.
-                </p>
-                <form name="cancelReservewithwaiting" action="waitingreserves.pl" method="post">
-                    <input type="submit" />
-                </form>
-            </div>
+    [% IF ( cancel_result ) %]
+        [% FOREACH cancel_result %]
+            [% IF ( messagetransfert ) %]
+                <div>
+                    <h2>Hold find for ([% nextreservtitle %]), must be transferred</h2>
+                    <p>This hold placed by : <b> [% nextreservsurname %] [% nextreservfirstname %]</b> at the library : <b> [% branchname %] </b>, Please transfer this hold.
+                    </p>
+                    <form name="cancelReservewithtransfert" action="waitingreserves.pl" method="post">
+                        <input type="submit" class="button" />
+                    </form>
+                </div>
+            [% END %]
+            [% IF ( waiting ) %]
+                <div id="bloc25">
+                    <h2>This hold is waiting</h2>
+                    <p>This hold ([% nextreservtitle %]) was placed by <b> : [% nextreservsurname %] [% nextreservfirstname %]</b>,
+                    Please retain this hold.
+                    </p>
+                    <form name="cancelReservewithwaiting" action="waitingreserves.pl" method="post">
+                        <input type="submit" />
+                    </form>
+                </div>
+            [% END %]
         [% END %]
-        [% UNLESS ( message ) %]
+    [% ELSE %]
         <div id="resultlist" class="toptabs">
             <ul>
-                <li><a href="/cgi-bin/koha/circ/waitingreserves.pl#holdswaiting">[% reservecount %] Hold(s) waiting</a></li>
-                <li><a href="/cgi-bin/koha/circ/waitingreserves.pl#holdsover">[% overcount %] Hold(s) over</a></li>
+                <li><a href="#holdswaiting">[% reservecount %] Hold(s) waiting</a></li>
+                <li><a href="#holdsover">[% overcount %] Hold(s) over</a></li>
             </ul>
             <div id="holdswaiting">
             [% IF ( reserveloop ) %]
@@ -79,6 +82,8 @@ $.tablesorter.addParser({
                     <th>Title</th>
                     <th>Patron</th>
                     <th>Location</th>
+                    <th>Copy number</th>
+                    <th>Enumeration</th>
                     <th>Action</th>
                </tr></thead>
                <tbody>[% FOREACH reserveloo IN reserveloop %]
@@ -95,6 +100,8 @@ $.tablesorter.addParser({
                         [% reserveloo.borrowermail %]</a>[% END %]
                     </td>
                     <td>[% reserveloo.homebranch %]<br />[% reserveloo.itemcallnumber %]</td>
+                    <td>[% reserveloo.copynumber %]</td>
+                    <td>[% reserveloo.enumchron %]</td>
                     <td>
                         <form name="cancelReserve" action="waitingreserves.pl" method="post">
                             <input type="hidden" name="borrowernumber" value="[% reserveloo.borrowernum %]" />
@@ -102,7 +109,7 @@ $.tablesorter.addParser({
                             <input type="hidden" name="fbr" value="[% reserveloo.holdingbranch %]" />
                             <input type="hidden" name="tbr" value="[% reserveloo.homebranch %]" />
                             [% IF ( reserveloo.dotransfer ) %]
-                            <input type="submit" value="Cancel hold and return to : [% reserveloo.homebranch %]" /> 
+                            <input type="submit" value="Cancel hold and return to : [% reserveloo.branchname %]" /> 
                             [% ELSE %]
                             <input type="submit" value="Cancel hold" />
                             [% END %]
@@ -117,13 +124,26 @@ $.tablesorter.addParser({
         </div>
         <div id="holdsover">
                 <p>Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay %] days.</p>
-                [% IF ( overloop ) %]
+               [% IF ( overloop ) %]
+               <p>
+               <form name="cancelAllReserve" action="waitingreserves.pl" method="post">
+                   <input type="hidden" name="cancelall" value="1" />
+                   <input type="hidden" name="allbranches" value="[% allbranches %]" />
+                   <input type="submit" value="Cancel [% IF TransferWhenCancelAllWaitingHolds %]and Transfer [% END %]All" />
+               </form>
+               [% UNLESS TransferWhenCancelAllWaitingHolds %]
+               Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds sypref)
+               [% END %]
+               </p>
+               <br/>
                <table id="holdso">
                <thead><tr>
                     <th>Available since</th>
                     <th>Title</th>
                     <th>Patron</th>
                     <th>Location</th>
+                    <th>Copy number</th>
+                    <th>Enumeration</th>
                     <th>Action</th>
                </tr></thead>
                <tbody>[% FOREACH overloo IN overloop %]
@@ -139,13 +159,15 @@ $.tablesorter.addParser({
         [% overloo.borrowermail %]</a>[% END %]
                     </td>
                     <td>[% overloo.homebranch %] [% overloo.itemcallnumber %]</td>
+                    <td>[% overloo.copynumber %]</td>
+                    <td>[% overloo.enumchron %]</td>
                     <td><form name="cancelReserve" action="waitingreserves.pl" method="post">
                             <input type="hidden" name="borrowernumber" value="[% overloo.borrowernum %]" />
                             <input type="hidden" name="itemnumber" value="[% overloo.itemnumber %]" />
                             <input type="hidden" name="fbr" value="[% overloo.holdingbranch %]" />
                             <input type="hidden" name="tbr" value="[% overloo.homebranch %]" />
                             [% IF ( overloo.dotransfer ) %]
-                            <input type="submit" value="Cancel hold and return to : [% overloo.homebranch %]" />
+                            <input type="submit" value="Cancel hold and return to : [% overloo.branchname %]" />
                             [% ELSE %]
                             <input type="submit" value="Cancel hold" />
                             [% END %]