Bug 7641 - Add ability to suspend reserves - Followup
[koha_gimpoz] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / circulation.tt
index 061f376..0cdd2dc 100644 (file)
@@ -1,9 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Circulation
-[% IF ( borrowernumber ) %]
-&rsaquo; Checking out to [% surname %], [% firstname %]
-([% cardnumber %])
-[% END %]</title>
+<title>Koha &rsaquo; Circulation [% IF ( borrowernumber ) %] &rsaquo; Checking out to [% INCLUDE 'patron-title.inc' %] [% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% IF ( UseTablesortForCirc ) %]<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>[% END %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
                 $( '.renewals-allowed' ).hide(); $( '.renewals-disabled' ).show();
             }
         } ).attr( 'checked', false );
-        [% END %]
-               // listen submit to trigger qslip on empty checkout
-               $('#mainform').bind('submit',function() {
-                 if ($('#barcode').val() == '') {
-                   return printx_window('qslip'); }
-               });
+        [% END %][% IF ( CircAutoPrintQuickSlip ) %]
+        // listen submit to trigger qslip on empty checkout
+        $('#mainform').bind('submit',function() {
+          if ($('#barcode').val() == '') {
+            return printx_window('qslip'); }
+        });[% END %]
 
 
 var allcheckboxes = $(".checkboxed");
@@ -161,14 +157,18 @@ function refocus(calendar) {
 </script>
 [% INCLUDE 'calendar.inc' %]
 </head>
-<body>
+<body id="circ_circulation" class="circ">
 
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'circ-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo;[% IF ( borrowernumber ) %] <a href="/cgi-bin/koha/circ/circulation.pl">Checkouts</a> &rsaquo; [% firstname %] [% surname %][% ELSE %] <strong>Checkouts</strong>[% END %]</div>
-
-
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo;
+[% IF ( borrowernumber ) %]
+    <a href="/cgi-bin/koha/circ/circulation.pl">Checkouts</a> &rsaquo; [% INCLUDE 'patron-title.inc' %]
+[% ELSE %]
+    <strong>Checkouts</strong>
+[% END %]
+</div>
 [% IF ( CGIselectborrower ) %]
 <div id="doc" class="yui-t7">
 
@@ -226,6 +226,13 @@ function refocus(calendar) {
 </div>
 
 [% IF ( dateexpiry ) %]<div class="dialog message">Patron's account has been renewed until [% dateexpiry %]</div>[% END %]
+
+[% IF additional_materials %]
+    <div id="materials" class="dialog message">Note about the accompanying materials: <br />
+    [% additional_materials %]
+    </div>
+[% END %]
+
 [% IF ( NEEDSCONFIRMATION ) %]
 <div class="yui-g">
 
@@ -456,7 +463,8 @@ No patron matched <span class="ex">[% message %]</span>
         <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
     [% END %]
 
-    <label for="barcode">Checking out to [% firstname %] [% surname %] ([% cardnumber %]) </label>
+    <label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
+
        <div class="hint">Enter item barcode:</div>
 
     [% IF ( NEEDSCONFIRMATION ) %]
@@ -523,7 +531,7 @@ No patron matched <span class="ex">[% message %]</span>
 
     [% IF ( flagged ) %]
                [% IF ( noissues ) %]
-                <h4>Checking out to [% firstname %] [% surname %] ([% cardnumber %])</h4>
+               <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
         <div id="circmessages" class="circmessage warning">
                [% ELSE %]
         <div id="circmessages" class="circmessage attention">
@@ -562,9 +570,16 @@ No patron matched <span class="ex">[% message %]</span>
                        <li class="blocker"><span class="circ-hlt">Lost: </span>Patron's card is lost</li>
                        [% END %]
 
-            [% IF ( dbarred ) %]<li class="blocker">
-               <span class="circ-hlt"> Restricted:</span> Patron's account is restricted <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&amp;cardnumber=[% cardnumber %]&amp;destination=circ&amp;status=0">Lift restriction</a>
-</li>[% END %]
+            [% IF ( userdebarred ) %]
+               <li class="blocker">
+               <span class="circ-hlt"> Restricted:</span> Patron's account is restricted [% IF (userdebarreddate ) %] until [% userdebarreddate %] [% END %] [% IF (debarredcomment ) %] with the comment "[% debarredcomment %]"[% END %]
+               <form class="inline compact" action="/cgi-bin/koha/members/setstatus.pl" method="post">
+                       <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+                       <input type="hidden" name="destination" value="circ" />
+                       <input type="hidden" name="cardnumber" value="[% cardnumber %]" />
+                       <input type="submit" value="Lift restriction" />
+               </form>
+                       </li>[% END %]
 
                [% IF ( odues ) %]<li>[% IF ( nonreturns ) %]<span class="circ-hlt">Overdues:</span> Patron has <span class="circ-hlt">ITEMS OVERDUE</span>. See highlighted items <a href="#checkouts">below</a>[% END %]</li>
             [% END %]
@@ -932,9 +947,10 @@ No patron matched <span class="ex">[% message %]</span>
             <th>Hold date</th>
             <th>Title</th>
             <th>Call Number</th>
-                       <th>Barcode</th>
+            <th>Barcode</th>
             <th>Priority</th>
-                       <th>Delete?</th>
+            <th>Delete?</th>
+            <th>&nbsp;</th>
         </tr></thead>
                <tbody>
         [% FOREACH reservloo IN reservloop %]
@@ -961,11 +977,65 @@ No patron matched <span class="ex">[% message %]</span>
                 <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
                 <input type="hidden" name="reservenumber" value="[% reservloo.reservenumber %]" />
             </td>
+            <td>[% IF ( reservloo.suspend ) %]Suspended [% IF ( reservloo.suspend_until ) %] until [% reservloo.suspend_until | $KohaDates %][% END %][% END %]</td>
             </tr>
         [% END %]</tbody>
     </table>
-               <fieldset class="action"><input type="submit" class="cancel" name="submit" value="Cancel Marked Requests" /></fieldset>
+            <fieldset class="action"><input type="submit" class="cancel" name="submit" value="Cancel marked holds" /></fieldset>
     </form>
+
+    <fieldset class="action">
+        <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
+            <input type="hidden" name="from" value="circ" />
+            <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+            <input type="submit" value="Suspend all holds" />
+
+            [% IF AutoResumeSuspendedHolds %]
+            <label for="suspend_until">until</label>
+            <input type="text" size="10" id="suspend_until" name="suspend_until"/>
+            <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar"  border="0" id="CalendarSuspendUntil" style="cursor: pointer;" />
+            <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
+
+             <script language="JavaScript" type="text/javascript">
+                        //<![CDATA[
+                   function validate1(date) {
+                         var today = new Date();
+                         if ( date < today ) {
+                             return true;
+                          } else {
+                             return false;
+                          }
+                     };
+                     function refocus(calendar) {
+                        $('#barcode').focus();
+                        calendar.hide();
+                     };
+                               //#TODO - ADD syspref (AllowPostDatedCheckouts).
+                     Calendar.setup(
+                          {
+                             inputField : "suspend_until",
+                             ifFormat : "[% DHTMLcalendar_dateformat %]",
+                             button : "CalendarSuspendUntil",
+//                           disableFunc : validate1,
+//                           dateStatusFunc : validate1,
+                             onClose : refocus
+                           }
+                        );
+                               //]]>
+             </script>
+             [% END %]
+        </form>
+    </fieldset>
+
+    <fieldset class="action">
+        <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
+            <input type="hidden" name="from" value="circ" />
+            <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+            <input type="hidden" name="suspend" value="0" />
+            <input type="submit" value="Resume all suspended holds" />
+       </form>
+    </fieldset>
+
        [% ELSE %]
        <p>Patron has nothing on hold.</p>
 [% END %]