Merge commit 'kc/master'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reserve / request.tmpl
index 80f6bdc..67baf2d 100644 (file)
@@ -1,46 +1,61 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha &rsaquo; Circulation &rsaquo; Holds &rsaquo; Place a hold on <!-- TMPL_VAR NAME="title" --></title>
+<!-- TMPL_UNLESS NAME="multi_hold" -->
+    <title>Koha &rsaquo; Circulation &rsaquo; Holds &rsaquo; Place a hold on <!-- TMPL_VAR NAME="title" escape="html" --></title>
+<!-- TMPL_ELSE -->
+    <title>Koha &rsaquo; Circulation &rsaquo; Holds &rsaquo; Confirm Holds</title>
+<!-- /TMPL_UNLESS -->
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<!-- TMPL_INCLUDE NAME="calendar.inc" -->
 <script type="text/javascript">
-// <![CDATA[ 
+    // <![CDATA[
+var patron_homebranch = "<!-- TMPL_VAR NAME="borrower_branchname" ESCAPE="JS" -->";
+var override_items = {<!-- TMPL_LOOP NAME="bibitemloop" --><!-- TMPL_LOOP NAME="itemloop" --><!-- TMPL_IF NAME="override" -->
+    <!-- TMPL_VAR NAME="itemnumber" -->: {
+        homebranch: "<!-- TMPL_VAR NAME="homebranchname" ESCAPE="JS" -->",
+        holdallowed: <!-- TMPL_VAR NAME="holdallowed" -->
+    },
+<!-- /TMPL_IF --><!-- /TMPL_LOOP --><!-- /TMPL_LOOP -->
+};
+var MSG_NO_ITEMS_AVAILABLE = _("A hold cannot be requested on any of these items.");
+
 function check() {
        var msg = "";
        var count_reserv = 0;
        var alreadyreserved = 0;
 
-// check if we have checkitem form
-if (document.form.checkitem){
-       for (i=0;i<document.form.checkitem.length;i++){
-               if (document.form.checkitem[i].checked == true) {
+    // check if we have checkitem form
+    if (document.form.checkitem){
+        for (i=0;i<document.form.checkitem.length;i++){
+            if (document.form.checkitem[i].checked == true) {
                                count_reserv++ ;
                        }
-       }
-       // for only one item, check the checkitem without consider the loop checkitem
-       if (i==0){
-               if (document.form.checkitem.checked == true) {
-                       count_reserv++;
-               }
-       }
-}
+        }
+        // for only one item, check the checkitem without consider the loop checkitem
+        if (i==0){
+                   if (document.form.checkitem.checked == true) {
+                           count_reserv++;
+                   }
+           }
+    }
 
-if (document.form.request.checked == true){
+    if (document.form.request.checked == true){
                count_reserv++ ;
-}
+    }
 
-if (document.form.alreadyreserved.value == "1"){
+    if (document.form.alreadyreserved && document.form.alreadyreserved.value == "1"){
                 alreadyreserved++ ;
-}
+    }
 
-if (count_reserv == "0"){
-               msg += ("- Please select an item to place a hold\n");
-}
-if (count_reserv >= "2"){
-               msg += ("- You may only place a hold on one item at a time\n");
-}
+    if (count_reserv == "0"){
+               msg += (_("- Please select an item to place a hold") + "\n");
+    }
+    if (count_reserv >= "2"){
+               msg += (_("- You may only place a hold on one item at a time") + "\n");
+    }
 
-if (alreadyreserved > "0"){
-               msg += ("- This patron had already placed a hold on this item\n Please cancel the previous hold first \n");
-}
+    if (alreadyreserved > "0"){
+               msg += (_("- This patron had already placed a hold on this item") + "\n" + _("Please cancel the previous hold first") + "\n");
+    }
 
        if (msg == "") return(true);
        else    {
@@ -49,17 +64,59 @@ if (alreadyreserved > "0"){
        }
 }
 
+function checkMultiHold() {
+    var spans = $(".multi_hold_item");
+    if ($(spans).size() == 0) {
+        alert(MSG_NO_ITEMS_AVAILABLE);
+        return false;
+    }
+
+    var biblionumbers = "";
+    $(spans).each(function() {
+        var bibnum = $(this).attr("title");
+        biblionumbers += bibnum + "/";
+    });
+
+    var badSpans = $(".not_holdable");
+    var badBibs = "";
+    $(badSpans).each(function() {
+        var bibnum = $(this).attr("title");
+        badBibs += bibnum + "/";
+    });
+
+    $("#multi_hold_bibs").val(biblionumbers);
+    $("#bad_bibs").val(badBibs);
+
+    return true;
+}
+
  $(document).ready(function() {
+    $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
+        var itemnumber = this.value;
+        var msg;
+
+        switch (override_items[itemnumber].holdallowed) {
+            case 0: msg = _( 'This item normally cannot be put on hold.' ); break;
+            case 1: msg = _( 'This item normally cannot be put on hold except for patrons from ' ) + override_items[itemnumber].homebranch + '.'; break;
+        }
+
+        msg += "\n\n" + _( 'Place hold on this item?' );
+
+        return confirm(msg);
+    });
+    $("input.warning").click(function() {
+        return confirm( _( 'None of these items can normally be put on hold for this patron.' ) + "\n\n" + _( 'Place hold?' ) );
+    });
        $("#requestany").click(function() {
                if(this.checked){
-               $("input[@name=checkitem]").each(function() {
+               $("input[name=checkitem]").each(function() {
                        $(this).attr("checked","");
                });
                }
        });
-       $("input[@name=checkitem]").click(function() {
+       $("input[name=checkitem]").click(function() {
                onechecked = 0;
-               $("input[@name=checkitem]").each(function() {
+               $("input[name=checkitem]").each(function() {
                        if(this.checked){
                                onechecked = 1;
                        }
@@ -79,86 +136,131 @@ if (alreadyreserved > "0"){
 <!-- TMPL_INCLUDE NAME="header.inc" -->
 <!-- TMPL_INCLUDE NAME="circ-search.inc" -->
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalogue</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a> &rsaquo; Place a hold on <!-- TMPL_VAR NAME="title" --></div>
+<!-- TMPL_UNLESS NAME="multi_hold" -->
+    <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a> &rsaquo; Place a hold on <!-- TMPL_VAR NAME="title" escape="html" --></div>
+<!-- TMPL_ELSE -->
+    <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> &rsaquo; Confirm Holds</div>
+<!-- /TMPL_UNLESS -->
 
  <div id="doc3" class="yui-t2">
 
    <div id="bd">
        <div id="yui-main">
        <div class="yui-b">
-
-<!-- TMPL_IF NAME="messagetransfert" -->
-               <div>
+<!-- TMPL_IF NAME="noitems" -->
+<div class="dialog alert">
+<strong>Cannot place hold:</strong> this record has no items attached.
+</div>
+<!-- TMPL_ELSE -->
+  <!-- TMPL_IF NAME="messagetransfert" -->
+               <div class="dialog message">
                                <h2>Hold found for (<!-- TMPL_VAR NAME="nextreservtitle" -->), please transfer</h2>
-                       <p>Hold placed by : <b> <!-- TMPL_VAR NAME="nextreservsurname" --> <!-- TMPL_VAR NAME="nextreservfirstname" --></b> at : <b> <!-- TMPL_VAR NAME="branchname" --> </b>, Please transfer this item.
+                       <p>Hold placed by : <strong> <!-- TMPL_VAR NAME="nextreservsurname" --> <!-- TMPL_VAR NAME="nextreservfirstname" --></strong> at : <strong> <!-- TMPL_VAR NAME="branchname" --> </strong>, Please transfer this item.
                        </p>
                        <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
                                <input type="submit" class="button" />
                        </form>
                </div>
-       <!-- /TMPL_IF -->
-<h1>Place a hold on <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a></h1>
+  <!-- /TMPL_IF -->
 
-<!-- TMPL_UNLESS NAME="cardnumber"-->
-    <!-- TMPL_IF NAME="messageborrower" -->                                    
-      <div class="problem">No patron with this name, Please, try another </div>    
+  <!-- TMPL_UNLESS NAME="multi_hold" -->
+    <h1>Place a hold on <!-- TMPL_INCLUDE NAME="biblio-default-view.inc" --><!-- TMPL_VAR NAME="title" escape="html" --></a></h1>
+  <!-- TMPL_ELSE -->
+    <h1>Confirm Holds</h1>
+  <!-- /TMPL_UNLESS -->
+
+  <!-- TMPL_UNLESS NAME="cardnumber"-->
+    <!-- TMPL_IF NAME="messageborrower" -->
+      <div class="dialog alert"><h3>Patron Not Found</h3><p>No patron with this name, Please, try another</p> </div>
     <!-- /TMPL_IF -->
     <form action="request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" method="post">
         <!-- TMPL_UNLESS name="CGIselectborrower" -->
                        <fieldset class="brief">
                        <label for="patron">Patron: </label>
-                               <div class="hint">(type card number or part of a name)</div>
-                <input type="text" size="20" id="patron" class="focus" name="findborrower" /> 
+                               <div class="hint">Enter patron card number or partial name:</div>
+                <input type="text" size="20" id="patron" class="focus" name="findborrower" />
                 <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber"-->" />
                 <input type="submit" value="Search" />
                        </fieldset>
         <!-- TMPL_ELSE -->
-            <!-- TMPL_VAR NAME="CGIselectborrower" -->
-                <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber"-->" />
-                <input type="submit" value="Select" />
+                       <fieldset>
+                       <!-- TMPL_VAR NAME="CGIselectborrower" -->
+                       <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber"-->" /><fieldset class="action"><input type="submit" value="Select" /></fieldset></fieldset>
+
         <!-- /TMPL_UNLESS -->
+        <!-- TMPL_IF NAME="multi_hold" -->
+            <input type="hidden" name="multi_hold" value="<!-- TMPL_VAR NAME="multi_hold" -->"/>
+            <input type="hidden" name="biblionumbers" value="<!-- TMPL_VAR NAME="biblionumbers" -->"/>
+        <!-- /TMPL_IF -->
     </form>
-<!-- TMPL_ELSE -->
-  <!-- TMPL_IF NAME="maxreserves" -->
-    <p class="problem">
-      <strong>Too many holds</strong>
-      Currently, this patron has too many holds.
-    </p>
-    <!-- /TMPL_IF -->
+  <!-- TMPL_ELSE -->
+
+<!-- TMPL_IF NAME="warnings" -->
+    <div class="dialog alert">
+
+    <!-- TMPL_UNLESS NAME="multi_hold" -->
+      <h3>Cannot Place Hold</h3>
+         <ul>
+        <!-- TMPL_IF NAME="maxreserves" -->
+          <li><strong>Too Many Holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="borrowerfirstname" --> <!-- TMPL_VAR NAME="borrowersurname" --> </a> has too many holds.</li>
+        <!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="alreadyreserved" -->
+          <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="borrowerfirstname" --> <!-- TMPL_VAR NAME="borrowersurname" --></a> <strong>already has a hold</strong> on this item </li>
+        <!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="none_available" -->
+          <li> <strong>No copies are available</strong> to be placed on hold</li>
+        <!-- /TMPL_IF -->
+         </ul>
+    <!-- TMPL_ELSE -->
+      <h3>Cannot Place Hold on Some Items</h3>
+    <!-- /TMPL_UNLESS -->
+
+    </div>
+<!-- /TMPL_IF -->
 
+<!-- TMPL_IF NAME="messages" -->
+    <div class="dialog message"><ul>
     <!-- TMPL_IF NAME="expiry" -->
-    <br />
-    <p class="problem">
-      <strong>Expired account</strong>
-      This patron's account has expired
-    </p>
+    <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="borrowerfirstname" --> <!-- TMPL_VAR NAME="borrowersurname" --></a>'s <strong>account has expired</strong></li>
     <!-- /TMPL_IF -->
 
-    <!-- TMPL_IF NAME="diffbranch" -->                 
-    <p class="problem">
-      <strong>Warning:</strong> Pickup Library is different than Patron's Home Library
-    </p>
+<!-- TMPL_IF NAME="diffbranch" -->
+    <li> <strong>Pickup library is different</strong> than <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="borrowerfirstname" --> <!-- TMPL_VAR NAME="borrowersurname" --></a>'s home library (<!-- TMPL_VAR NAME="borrower_branchname" --> / <!-- TMPL_VAR NAME="borrower_branchcode" --> )</li>
     <!-- /TMPL_IF -->
 
-    <!-- TMPL_IF NAME="alreadyreserved" -->                    
-    <p class="problem">
-      <strong>Warning:</strong>
-      This patron already has a hold on this item
-    </p>
-    <!-- /TMPL_IF -->
+</ul></div>
+<!-- /TMPL_IF -->
 
   <!-- TMPL_IF NAME="messageborrower" -->
-    <p class="problem"><strong>Patron not found:</strong> Name or barcode not found. Please try an other </p>
+   <div class="dialog alert"><h3>Patron not found:</h3> <p>Name or barcode not found. Please try an other </p></div>
   <!-- /TMPL_IF -->
+
   <fieldset class="rows left">
     <legend>Hold details</legend>
-        <form action="placerequest.pl" method="post" onsubmit="return check();" name="form">
-    
+        <!-- TMPL_UNLESS NAME="multi_hold" -->
+            <form action="placerequest.pl" method="post" onsubmit="return check();" name="form">
+        <!-- TMPL_ELSE -->
+            <form action="placerequest.pl" method="post" onsubmit="return checkMultiHold();" name="form">
+        <!-- /TMPL_UNLESS -->
+
         <input type="hidden" size="10" name="member" value="<!--  TMPL_VAR NAME="cardnumber" -->" />
-        <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
         <input type="hidden" name="type" value="str8" />
-        <input type="hidden" name="title" value="<!-- TMPL_VAR NAME="title" -->" />
-        <input type="hidden" name="rank-request" value="<!-- TMPL_VAR NAME="fixedRank" -->" />
+
+        <!-- TMPL_IF NAME="multi_hold" -->
+            <input type="hidden" name="multi_hold" value="<!-- TMPL_VAR NAME="multi_hold" -->"/>
+            <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="<!-- TMPL_VAR NAME="biblionumbers" -->"/>
+            <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
+            <input type="hidden" name="request" value="any"/>
+            <!-- TMPL_LOOP NAME="biblioloop" -->
+              <input type="hidden" name="title_<!-- TMPL_VAR NAME="biblionumber">" value="<!-- TMPL_VAR NAME="title" ESCAPE="html">"/>
+              <input type="hidden" name="rank_<!-- TMPL_VAR NAME="biblionumber">" value="<!-- TMPL_VAR NAME="rank">"/>
+            <!-- /TMPL_LOOP -->
+        <!-- TMPL_ELSE -->
+            <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
+            <input type="hidden" name="title" value="<!-- TMPL_VAR NAME="title" ESCAPE="html" -->" />
+            <input type="hidden" name="rank-request" value="<!-- TMPL_VAR NAME="fixedRank" -->" />
+        <!-- /TMPL_IF -->
+
        <ol> <li><span class="label">Patron:</span>
             <!-- TMPL_IF NAME="cardnumber"-->
                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="borrowerfirstname" --> <!-- TMPL_VAR NAME="borrowersurname" --> (<!--  TMPL_VAR NAME="cardnumber" -->)</a>
@@ -166,10 +268,12 @@ if (alreadyreserved > "0"){
                 Not defined yet
             <!-- /TMPL_IF -->
         </li>
-        <li>
-        <span class="label">Priority:</span>
-            <strong><!-- TMPL_VAR Name="fixedRank" --></strong>
-        </li>
+        <!-- TMPL_UNLESS NAME="multi_hold" -->
+          <li>
+              <span class="label">Priority:</span>
+              <strong><!-- TMPL_VAR Name="fixedRank" --></strong>
+          </li>
+        <!-- /TMPL_UNLESS -->
         <li>
             <label for="holdnotes">Notes:</label>
             <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
@@ -179,56 +283,134 @@ if (alreadyreserved > "0"){
             <!-- TMPL_VAR NAME="CGIbranch" -->
         </li>
 
-        <li> <label for="requestany">Place a hold on the next available copy </label>
+       <!-- TMPL_IF NAME="reserve_in_future" -->
+       <li>
+           <label for="reserve_date">Hold starts on date:</label>
+           <input name="reserve_date" id="reserve_date" size="10" readonly="readonly">
+           <img src="<!-- TMPL_VAR NAME="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="CalendarReserveDate" style="cursor: pointer;" />
+           <script language="JavaScript" type="text/javascript">
+               //<![CDATA[
+               function validate1(date) {
+                       var today = new Date();
+                       if ( (date > today) ||
+                    ( date.getDate() == today.getDate() &&
+                      date.getMonth() == today.getMonth() &&
+                      date.getFullYear() == today.getFullYear() ) ) {
+                               return false;
+                       } else {
+                               return true;
+                       }
+               };
+               Calendar.setup(
+                       {
+                               inputField : "reserve_date",
+                               ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                               button : "CalendarReserveDate",
+                               disableFunc : validate1,
+                               dateStatusFunc : validate1,
+                       }
+               );
+               //]]>
+           </script>
+       </li>
+       <!-- /TMPL_IF -->
+
+       <li>
+           <label for="expiration_date">Hold expires on date:</label>
+           <input name="expiration_date" id="expiration_date" size="10" readonly="readonly" />
+           <img src="<!-- TMPL_VAR NAME="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="CalendarExpirationDate" style="cursor: pointer;" />
+           <script language="JavaScript" type="text/javascript">
+               //<![CDATA[
+               function validate1(date) {
+                       var today = new Date();
+                       if ( (date > today) ||
+                    ( date.getDate() == today.getDate() &&
+                      date.getMonth() == today.getMonth() &&
+                      date.getFullYear() == today.getFullYear() ) ) {
+                               return false;
+                       } else {
+                               return true;
+                       }
+               };
+               Calendar.setup(
+                       {
+                               inputField : "expiration_date",
+                               ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                               button : "CalendarExpirationDate",
+                               disableFunc : validate1,
+                               dateStatusFunc : validate1,
+                       }
+               );
+               //]]>
+           </script>
+               <a href='#' onclick="document.getElementById('expiration_date').value='';">Clear Date</a>
+       </li>
+
+        <!-- TMPL_UNLESS NAME="multi_hold" -->
+          <li> <label for="requestany">Place a hold on the next available copy </label>
                <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
-        </li>
+               <input type="hidden" name="biblioitem" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->" />
+               <input type="hidden" name="alreadyreserved" value="<!-- TMPL_VAR NAME="alreadyreserved" -->" />
+          </li>
+        <!-- /TMPL_UNLESS -->
 
-        <input type="hidden" name="biblioitem" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->" />
-        <input type="hidden" name="alreadyreserved" value="<!-- TMPL_VAR NAME="alreadyreserved" -->" />
 </ol>
+   <!-- TMPL_UNLESS NAME="multi_hold" -->
         <fieldset class="action">
-        <!-- TMPL_IF NAME="cardnumber"-->
-        <input type="submit" value="Place Hold" />
-        <!-- /TMPL_IF -->
+            <!-- TMPL_IF NAME="cardnumber"-->
+                <!-- TMPL_IF NAME="override_required" -->
+                    <input type="submit" class="warning" value="Place Hold" />
+                <!-- TMPL_ELSIF NAME="none_available" -->
+                    <input type="submit" disabled="disabled" value="Place Hold" />
+                <!-- TMPL_ELSE -->
+                    <input type="submit" value="Place Hold" />
+                <!-- /TMPL_IF -->
+            <!-- /TMPL_IF -->
         </fieldset>
         <!-- TMPL_LOOP name="bibitemloop" -->
-<ol>
-       <!-- TMPL_UNLESS NAME="item-level_itypes" -->
-        <li><span class="label">Item type:</span> <!-- TMPL_VAR NAME="description" --></li>
-       <!-- /TMPL_UNLESS -->
-        <!-- TMPL_IF NAME="publicationyear" --><li><span class="label">Publication year:</span> <!-- TMPL_VAR NAME="publicationyear" --></li><!-- /TMPL_IF -->
-</ol>
-        <label for="requestspecific">Place a hold on a specific copy</label> 
+          <ol>
+            <!-- TMPL_UNLESS NAME="item-level_itypes" -->
+              <li><span class="label">Item type:</span> <!-- TMPL_VAR NAME="description" --></li>
+            <!-- /TMPL_UNLESS -->
+
+            <!-- TMPL_IF NAME="publicationyear" --><li><span class="label">Publication year:</span> <!-- TMPL_VAR NAME="publicationyear" --></li><!-- /TMPL_IF -->
+          </ol>
+
         <table id="requestspecific">
-        <tr>
+        <caption>Place a hold on a specific copy</caption>
+               <tr>
+            <th>Hold</th>
             <!-- TMPL_IF NAME="item-level_itypes" -->
-           <th>Hold</th>
-            <th>Item type</th>
+                <th>Item type</th>
             <!-- /TMPL_IF -->
             <th>Barcode</th>
             <th>Home Library</th>
             <th>Last Location</th>
-            <th>Call number</th>
+            <th>Call no.</th>
+            <th>Copy no.</th>
             <th>Information</th>
         </tr>
     <!-- TMPL_LOOP Name="itemloop" -->
         <tr class="<!-- TMPL_VAR NAME="backgroundcolor" -->">
             <td>
             <!-- TMPL_IF NAME="available" -->
-            <input type="checkbox" name="checkitem" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
+                <input type="radio" name="checkitem" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
+            <!-- TMPL_ELSIF NAME="override" -->
+                <input type="radio" name="checkitem" class="needsoverride" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
+                <img src="/intranet-tmpl/<!-- TMPL_VAR NAME="theme" -->/img/famfamfam/silk/error.png" alt="Requires override of hold policy" />
             <!-- TMPL_ELSE -->
-            <input DISABLED type="checkbox" name="checkitem" value="<!-- TMPL_VAR NAME="itemnumber" -->" /> 
+                <input disabled="disabled" type="radio" name="checkitem" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
+                <img src="/intranet-tmpl/<!-- TMPL_VAR NAME="theme" -->/img/famfamfam/silk/cross.png" alt="Cannot be put on hold" />
             <!-- /TMPL_IF -->
             </td>
-
             <!-- TMPL_IF NAME="item-level_itypes" -->
-            <td>
-            <img src="<!-- TMPL_VAR name="imageurl" -->" alt="<!-- TMPL_VAR NAME="itypename" -->" title="<!-- TMPL_VAR NAME="itypename" -->"/>
-            </td>
+                <td>
+                    <img src="<!-- TMPL_VAR name="imageurl" -->" alt="" /> <br /> <!-- TMPL_VAR NAME="itypename" -->
+                </td>
             <!-- /TMPL_IF -->
 
             <td>
-                    <!-- TMPL_VAR NAME="barcode" --> 
+                    <!-- TMPL_VAR NAME="barcode" -->
             </td>
             <td>
             <!-- TMPL_VAR NAME="homebranchname" -->
@@ -239,22 +421,24 @@ if (alreadyreserved > "0"){
             <td>
             <!-- TMPL_VAR NAME="itemcallnumber" -->
             </td>
+            <td><!-- TMPL_IF NAME="copynumber" --><!-- TMPL_VAR NAME="copynumber" --><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td>
             <td>
-        <!-- TMPL_IF Name="date_due" -->
+               <!-- TMPL_IF Name="onloan" -->
             <span class="checkedout">Due <!-- TMPL_VAR NAME="date_due" --></span>
-        <!-- /TMPL_IF -->
-    
-        <!-- TMPL_IF Name="message" -->
-            Unavailable (lost or missing)
-        <!-- /TMPL_IF -->
-    
-        <!-- TMPL_IF Name="notforloan" -->
-            Not for loan (<!-- TMPL_VAR NAME="notforloanvalue" -->)
-        <!-- /TMPL_IF -->
-        <!-- TMPL_IF Name="transfertwhen" -->
+                       <!-- TMPL_ELSE -->
+               <!-- TMPL_IF Name="transfertwhen" -->
             In transit from <!-- TMPL_VAR NAME="transfertfrom" -->,
             to <!-- TMPL_VAR NAME="transfertto" -->, since <!-- TMPL_VAR NAME="transfertwhen" -->
-        <!-- /TMPL_IF -->
+               <!-- /TMPL_IF -->
+               <!-- /TMPL_IF -->
+
+               <!-- TMPL_IF Name="message" -->
+            Unavailable (lost or missing)
+               <!-- /TMPL_IF -->
+
+               <!-- TMPL_IF Name="notforloan" -->
+            Not for loan (<!-- TMPL_VAR NAME="notforloanvalue" -->)
+               <!-- /TMPL_IF -->
 
             <!-- TMPL_IF NAME="reservedate"-->
                     <!-- TMPL_IF NAME="nocancel" -->
@@ -273,76 +457,197 @@ if (alreadyreserved > "0"){
         </tr>
     <!-- /TMPL_LOOP --> <!-- itemloop -->
         </table>
+
     <!-- /TMPL_LOOP --> <!-- bibitemloop -->
-    
+
+  <!-- TMPL_ELSE --><!-- UNLESS multi_hold -->
+
+    <table id="requesttitles">
+      <tr>
+        <th>Title</th>
+        <!-- TMPL_UNLESS NAME="item-level_itypes" -->
+          <th>Item Type</th>
+        <!-- /TMPL_UNLESS -->
+        <th>Priority</th>
+        <th>Information</th>
+      </tr>
+      <!-- TMPL_LOOP NAME="biblioloop" -->
+        <!-- TMPL_IF NAME="warn" -->
+          <tr class="onissue">
+        <!-- TMPL_ELSE -->
+          <tr>
+        <!-- /TMPL_IF -->
+          <td>
+            <ul>
+              <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" ESCAPE="html" --></a></li>
+              <!-- TMPL_IF NAME="publicationyear" -->
+                <li><span class="label">Publication year:</span> <!-- TMPL_VAR NAME="publicationyear" --></li>
+              <!-- /TMPL_IF -->
+            </ul>
+            <!-- TMPL_UNLESS NAME="warn" -->
+              <span class="multi_hold_item" title="<!-- TMPL_VAR NAME="biblionumber" -->"></span>
+            <!-- TMPL_ELSE -->
+              <span class="not_holdable" title="<!-- TMPL_VAR NAME="biblionumber" -->"></span>
+            <!-- /TMPL_UNLESS -->
+          </td>
+          <!-- TMPL_UNLESS NAME="item-level_itypes" -->
+            <td>
+              <img src="<!-- TMPL_VAR name="imageurl" -->" alt="<!-- TMPL_VAR NAME="itypename" -->" title="<!-- TMPL_VAR NAME="itypename" -->" />
+            </td>
+          <!-- /TMPL_UNLESS -->
+            <td><!-- TMPL_VAR NAME="rank" --></td>
+          <td>
+            <!-- TMPL_IF NAME="alreadyres" -->
+              <ul>
+            <!-- TMPL_ELSE -->
+              <!-- TMPL_IF NAME="none_avail" -->
+                <ul>
+              <!-- /TMPL_IF -->
+            <!-- /TMPL_IF -->
+
+          <!-- TMPL_IF NAME="alreadyres" -->
+              <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="borrowerfirstname" --> <!-- TMPL_VAR NAME="borrowersurname" --></a> <strong>already has a hold</strong> on this item </li>
+          <!-- /TMPL_IF -->
+          <!-- TMPL_IF NAME="none_avail" -->
+              <li> <strong>No copies are available</strong> to be placed on hold</li>
+          <!-- /TMPL_IF -->
+
+            <!-- TMPL_IF NAME="alreadyres" -->
+              </ul>
+            <!-- TMPL_ELSE -->
+              <!-- TMPL_IF NAME="none_avail" -->
+                </ul>
+              <!-- /TMPL_IF -->
+            <!-- /TMPL_IF -->
+
+          </td>
+        </tr>
+      <!-- /TMPL_LOOP -->
+    </table>
+
+  <!-- /TMPL_UNLESS --><!-- /multi_hold -->
+
     <fieldset class="action">
-    <!-- TMPL_IF NAME="cardnumber"-->
-        <input type="submit" value="Place Hold" />
-    <!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="cardnumber"-->
+            <!-- TMPL_IF NAME="override_required" -->
+                <input type="submit" class="warning" value="Place Hold" />
+            <!-- TMPL_ELSIF NAME="none_available" -->
+                <input type="submit" disabled="disabled" value="Place Hold" />
+            <!-- TMPL_ELSE -->
+                <input type="submit" value="Place Hold" />
+            <!-- /TMPL_IF -->
+        <!-- /TMPL_IF -->
     </fieldset>
-       </fieldset>
     </form>
-
+       </fieldset>
 <!-- /TMPL_UNLESS -->
+
 <!-- TMPL_UNLESS NAME="cardnumber" -->
 <!-- TMPL_IF name="reserveloop" -->
 <form name="T<!-- TMPL_VAR NAME="time" -->" action="modrequest.pl" method="post">
+  <!-- TMPL_IF NAME="multi_hold" -->
+    <input type = "hidden" name="multi_hold" value="1"/>
+    <input type = "hidden" name="biblionumbers" value="<!-- TMPL_VAR NAME="biblionumbers" -->"/>
+  <!-- /TMPL_IF -->
+
 <fieldset class="rows left">
 <legend>Existing holds</legend>
+
+<!-- TMPL_LOOP NAME="biblioloop" -->
+
+    <!-- TMPL_IF NAME="reserveloop" -->
     <table>
+      <!-- TMPL_IF NAME="multi_hold" -->
+          <caption><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" ESCAPE="html" --></a></caption>
+      <!-- /TMPL_IF -->
       <tr>
-        <th>Priority</th>
+        <!-- TMPL_IF NAME="CAN_user_reserveforothers_modify_holds_priority" -->
+            <th>Priority</th>
+               <th>&nbsp</th>
+        <!-- TMPL_ELSE -->
+            <th>Delete?</th>
+        <!-- /TMPL_IF -->
         <th>Patron</th>
         <th>Notes</th>
         <th>Date</th>
+       <th>Expiration</th>
         <th>Pick up Library</th>
         <th>Details</th>
+        <!-- TMPL_IF NAME="CAN_user_reserveforothers_modify_holds_priority" -->
+            <th><img src="/intranet-tmpl/<!-- TMPL_VAR NAME='theme' -->/img/go-bottom.png" border="0" alt="Toggle Set to Lowest Priority" /></th>
+        <!-- /TMPL_IF -->
+       <th>&nbsp;</th>
       </tr>
   <!-- TMPL_LOOP Name="reserveloop" -->
-      <tr>
+  <!-- TMPL_UNLESS Name="__odd__" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_UNLESS -->
         <td>
           <input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
           <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
           <select name="rank-request">
     <!-- TMPL_IF Name="wait" -->
+        <!-- TMPL_IF NAME="intransit" -->
+            <option value="T" selected="selected">In transit</option>
+        <!-- TMPL_ELSE -->
             <option value="W" selected="selected">Waiting</option>
-       <!-- TMPL_ELSE -->
-               <!-- TMPL_IF Name="selected" -->
-            <option value="<!-- TMPL_VAR NAME="priority" -->" selected="selected">
-              <!-- TMPL_VAR NAME="priority" -->
-            </option>
-       <!-- TMPL_ELSE -->
-                       <option value="<!-- TMPL_VAR NAME="priority" -->">
-              <!-- TMPL_VAR NAME="priority" -->
-            </option>
-        <!-- /TMPL_IF -->
         <!-- /TMPL_IF -->
+    <!-- /TMPL_IF -->
+       <!-- TMPL_IF NAME="CAN_user_reserveforothers_modify_holds_priority" --><!-- TMPL_LOOP Name="optionloop" -->
+        <!-- TMPL_IF Name="selected" --><option value="<!-- TMPL_VAR NAME="num" -->" selected="selected"><!-- TMPL_VAR NAME="num" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="num" -->"><!-- TMPL_VAR NAME="num" --></option><!-- /TMPL_IF -->
+        <!-- /TMPL_LOOP --><!-- TMPL_ELSE --><option value=""></option><!-- /TMPL_IF -->
             <option value="del">del</option>
           </select>
         </td>
+
+     <!-- TMPL_IF NAME="CAN_user_reserveforothers_modify_holds_priority" -->
+        <td style="white-space:nowrap;">
+               <a title="Move Hold Up" href="request.pl?action=move&amp;where=up&amp;borrowernumber=<!-- TMPL_VAR Name="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR Name="biblionumber" -->&amp;date=<!-- TMPL_VAR Name="date" -->">
+                       <img src="/intranet-tmpl/<!-- TMPL_VAR NAME='theme' -->/img/go-up.png" border="0" alt="Go up" />
+                </a>
+
+               <a title="Move Hold To Top" href="request.pl?action=move&amp;where=top&amp;borrowernumber=<!-- TMPL_VAR Name="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR Name="biblionumber" -->&amp;date=<!-- TMPL_VAR Name="date" -->">
+                       <img src="/intranet-tmpl/<!-- TMPL_VAR NAME='theme' -->/img/go-top.png" border="0" alt="Go top" />
+                </a>
+
+                <a title="Move Hold To Bottom" href="request.pl?action=move&amp;where=bottom&amp;borrowernumber=<!-- TMPL_VAR Name="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR Name="biblionumber" -->&amp;date=<!-- TMPL_VAR Name="date" -->">
+                       <img src="/intranet-tmpl/<!-- TMPL_VAR NAME='theme' -->/img/go-bottom.png" border="0" alt="Go bottom" />
+                </a>
+
+                <a title="Move Hold Down" href="request.pl?action=move&amp;where=down&amp;borrowernumber=<!-- TMPL_VAR Name="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR Name="biblionumber" -->&amp;date=<!-- TMPL_VAR Name="date" -->">
+                       <img src="/intranet-tmpl/<!-- TMPL_VAR NAME='theme' -->/img/go-down.png" border="0" alt="Go down" />
+                </a>
+        </td>
+    <!-- /TMPL_IF -->
+
         <td>
-          <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->" ><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></a>
+          <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->" >
+         <!-- TMPL_IF NAME="hidename" -->
+             <!-- TMPL_VAR NAME="cardnumber" -->
+         <!-- TMPL_ELSE -->
+             <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" -->
+         <!-- /TMPL_IF -->
+         </a>
         </td>
         <td><!-- TMPL_VAR NAME="notes" --></td>
         <td><!-- TMPL_VAR NAME="date" --></td>
+       <td><!-- TMPL_VAR NAME="expirationdate" --></td>
         <td>
     <!-- TMPL_IF Name="wait" -->
        <!-- TMPL_IF NAME="atdestination" -->
                 <!-- TMPL_IF name="found" -->
-                Item waiting at <b> <!-- TMPL_VAR NAME="wbrname" --></b> <input type="hidden" name="pickup" value="<!-- TMPL_VAR NAME="wbrcd" -->" />
+                Item waiting at <b> <!-- TMPL_VAR NAME="wbrname" --></b> <input type="hidden" name="pickup" value="<!-- TMPL_VAR NAME="wbrcode" -->" />
             <!-- TMPL_ELSE -->
                 Waiting to be pulled
             <!-- /TMPL_IF -->
           <!-- TMPL_ELSE -->
-            Item being transfered to <b> <!-- TMPL_VAR NAME="wbrname" --></b> <input type="hidden" name="pickup" value="<!-- TMPL_VAR NAME="wbrcd" -->" />
+            Item being transfered to <b> <!-- TMPL_VAR NAME="wbrname" --></b> <input type="hidden" name="pickup" value="<!-- TMPL_VAR NAME="wbrcode" -->" />
          <!-- /TMPL_IF -->
     <!-- TMPL_ELSE -->
           <select name="pickup">
       <!-- TMPL_LOOP Name="branchloop" -->
         <!-- TMPL_IF Name="selected" -->
-            <option value="<!-- TMPL_VAR NAME="branch" -->" selected="selected">
+            <option value="<!-- TMPL_VAR NAME="value" -->" selected="selected">
         <!-- TMPL_ELSE -->
-            <option value="<!-- TMPL_VAR NAME="branch" -->">
+            <option value="<!-- TMPL_VAR NAME="value" -->">
         <!-- /TMPL_IF -->
               <!-- TMPL_VAR NAME="branchname" -->
             </option>
@@ -362,7 +667,21 @@ if (alreadyreserved > "0"){
           </a>
     <!-- TMPL_ELSE -->
       <!-- TMPL_IF Name="constrainttypea" -->
-          <i>Next available</i>
+            <!-- TMPL_IF Name="item_level_hold" -->
+                <i>Only item
+                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME='biblionumber' -->">
+                     <!-- TMPL_IF NAME="barcodenumber" -->
+                         <!-- TMPL_VAR NAME="barcodenumber" -->
+                        <input type="hidden" name="itemnumber" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
+                    <!-- TMPL_ELSE -->
+                        No Barcode
+                    <!-- /TMPL_IF -->
+                </a>
+                </i>
+            <!-- TMPL_ELSE -->
+                <i>Next available</i>
+                 <input type="hidden" name="itemnumber" value="" />
+            <!-- /TMPL_IF -->
       <!-- TMPL_ELSE -->
         <!-- TMPL_IF Name="constrainttypeo" -->
           only this type :<b><!-- TMPL_VAR NAME="volumeddesc" --> <!-- TMPL_VAR NAME="itemtype" --></b>
@@ -370,24 +689,47 @@ if (alreadyreserved > "0"){
       <!-- /TMPL_IF -->
     <!-- /TMPL_IF -->
         </td>
+
+    <!-- TMPL_IF NAME="CAN_user_reserveforothers_modify_holds_priority" -->
+       <td>
+               <a title="Toggle Lowest Priority" href="request.pl?action=setLowestPriority&amp;borrowernumber=<!-- TMPL_VAR Name="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR Name="biblionumber" -->&amp;date=<!-- TMPL_VAR Name="date" -->"> 
+                       <!-- TMPL_IF NAME="lowestPriority" -->
+                               <img src="/intranet-tmpl/<!-- TMPL_VAR NAME='theme' -->/img/go-bottom.png" border="0" alt="Unset Lowest Priority" />
+                       <!-- TMPL_ELSE -->
+                               <img src="/intranet-tmpl/<!-- TMPL_VAR NAME='theme' -->/img/go-down.png" border="0" alt="Set To Lowest Priority" />
+                       <!-- /TMPL_IF -->
+               </a>
+       </td> 
+    <!-- /TMPL_IF -->
+
+       <td>
+               <a title="Cancel Hold" href="request.pl?action=cancel&amp;borrowernumber=<!-- TMPL_VAR Name="borrowernumber" -->&amp;biblionumber=<!-- TMPL_VAR Name="biblionumber" -->&amp;date=<!-- TMPL_VAR Name="date" -->">
+                       <img src="/intranet-tmpl/<!-- TMPL_VAR NAME='theme' -->/img/x.png" border="0" alt="Cancel" />
+                </a>
+       </td>
+
       </tr>
+
   <!-- /TMPL_LOOP --> <!-- existing reserveloop -->
      </table>
-<fieldset class="action"><input type="submit" name="submit" value="Cancel hold(s)" /></fieldset>
+  <!-- /TMPL_IF --><!-- /reserveloop -->
+<!-- /TMPL_LOOP --><!-- /biblioloop -->
+
+<fieldset class="action">
+  <input type="submit" name="submit" value="Update hold(s)" />
+</fieldset>
 </fieldset>
 </form>
 <!-- /TMPL_IF -->
 <!-- /TMPL_UNLESS -->
-
+<!-- /TMPL_IF -->
 </div>
 </div>
 
 <div class="yui-b">
-<!-- TMPL_INCLUDE NAME="hold-menu.inc" -->
-<!-- TMPL_IF NAME="cardnumber"-->
-<!-- TMPL_ELSE -->
-<!-- TMPL_INCLUDE NAME="biblio-view-menu.inc" -->
-<!-- /TMPL_IF -->
+<!-- TMPL_UNLESS NAME="multi_hold" -->
+  <!-- TMPL_INCLUDE NAME="biblio-view-menu.inc" -->
+<!-- /TMPL_UNLESS -->
 
 </div>
 </div>