Bug 7751: Decrease Loans for Items in Demand for Holds
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / circulation.tt
index 11ee5f9..db17ced 100644 (file)
@@ -1,9 +1,15 @@
 [% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Circulation [% IF ( borrowernumber ) %] &rsaquo; Checking out to [% INCLUDE 'patron-title.inc' %] [% END %]</title>
+<title>Koha &rsaquo; Circulation
+[% IF borrowernumber %]
+  &rsaquo; Checking out to [% INCLUDE 'patron-title.inc' invert_name = 1 %]
+[% END %]
+</title>
 [% INCLUDE 'doc-head-close.inc' %]
+[% INCLUDE 'calendar.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>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
 <script type="text/javascript">
 //<![CDATA[
 [% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
@@ -15,6 +21,7 @@
 });[% END %]
 [% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
         $(document).ready(function() {
+
         $('#patronlists').tabs();
                [% IF ( UseTablesortForCirc ) %]$.tablesorter.defaults.widgets = ['zebra'];
                $("#issuest").tablesorter({[% IF ( dateformat_metric ) %]
@@ -75,6 +82,16 @@ var allcheckboxes = $(".checkboxed");
                $(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); return false;
        });
 
+    $("#CheckAllexports").click(function(){
+        $(".checkboxed").checkCheckboxes(":input[name*=biblionumbers]");
+        $(".checkboxed").unCheckCheckboxes(":input[name*=items]");
+        return false;
+    });
+    $("#CheckNoexports").click(function(){
+        $(".checkboxed").unCheckCheckboxes(":input[name*=biblionumbers]");
+        return false;
+    });
+
     $("#relrenew_all").click(function(){
         $(allcheckboxes).checkCheckboxes(":input[name*=items]");
         $(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]");
@@ -137,11 +154,71 @@ var allcheckboxes = $(".checkboxed");
                $("#add_message_form").show();
         });
 
-     $("input.radio").click(function(){
+    $("input.radio").click(function(){
         radioCheckBox($(this));
-     });
+    });
+    $("#exportmenuc").empty();
+    initExportButton();
+
+    $("#newduedate").datepicker({ minDate: 1 }); // require that renewal date is after today
+    $("#duedatespec").datetimepicker({
+        onSelect: function(dateText, inst) { $("#barcode").focus(); },
+        hour: 23,
+        minute: 59,
+    });
+
  });
 
+function initExportButton() {
+    var exportmenu = [
+        { text: _("ISO2709 with items"), onclick: {fn: function(){export_submit("iso2709_995")}} },
+        { text: _("ISO2709 without items"), onclick: {fn: function(){export_submit("iso2709")}} },
+        { text: _("CSV"), onclick: {fn: function(){export_submit("csv")}} },
+    ];
+    new YAHOO.widget.Button({
+        type: "menu",
+        label: _("Export checkouts"),
+        name: "exportmenubutton",
+        menu: exportmenu,
+        container: "exportmenuc"
+    });
+}
+
+function export_submit(format) {
+    if ($("input:checkbox[name='biblionumbers'][checked]").length < 1){
+        alert(_("You must select a checkout to export"));
+        return;
+    }
+
+    $("input:checkbox[name='biblionumbers']").each( function(){
+        var input_item = $(this).siblings("input:checkbox");
+        if ( $(this).is(":checked") ) {
+            $(input_item).attr("checked", "checked");
+        } else {
+            $(input_item).attr("checked", "");
+        }
+    } );
+
+    if (format == 'iso2709_995') {
+        format = 'iso2709';
+        $("#dont_export_item").val(0);
+    } else if (format == 'iso2709') {
+        $("#dont_export_item").val(1);
+    } else {
+        [% UNLESS ( export_with_csv_profile ) %]
+            alert(_("You must define a csv profile for export (in tools>CSV export profiles) and fill the ExportWithCsvProfile system preference"));
+            return false;
+        [% END %]
+    }
+    document.issues.action="/cgi-bin/koha/tools/export.pl";
+    document.getElementById("export_format").value = format;
+    document.issues.submit();
+
+    /* Reset form action to its initial value */
+    document.issues.action="/cgi-bin/koha/reserve/renewscript.pl";
+
+};
+
 function validate1(date) {
     var today = new Date();
     if ( date < today ) {
@@ -150,13 +227,8 @@ function validate1(date) {
         return false;
      }
 };
-function refocus(calendar) {
-   document.getElementById('barcode').focus();
-   calendar.hide();
-};
 //]]>
 </script>
-[% INCLUDE 'calendar.inc' %]
 </head>
 <body id="circ_circulation" class="circ">
 
@@ -226,7 +298,7 @@ function refocus(calendar) {
 </form>
 </div>
 
-[% IF ( dateexpiry ) %]<div class="dialog message">Patron's account has been renewed until [% dateexpiry | $KohaDates %]</div>[% END %]
+[% 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 />
@@ -245,6 +317,10 @@ function refocus(calendar) {
 <h3>Please confirm checkout</h3>
 
 <ul>
+[%IF ( AGE_RESTRICTION ) %]
+    <li>Age restriction [% AGE_RESTRICTION %]. Check out anyway?</li>
+[% END %]
+
 [% IF ( DEBT ) %]
     <li>The patron has a debt of [% DEBT %]</li>
 [% END %]
@@ -258,7 +334,7 @@ function refocus(calendar) {
 [% END %]
 
 [% IF ( RESERVED ) %]
-    <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) has been on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber %]">[% resfirstname %] [% ressurname %]</a> ([% rescardnumber %]) at [% resbranchname %] since [% resreservedate | $KohaDates %]</li>
+    <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) has been on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber %]">[% resfirstname %] [% ressurname %]</a> ([% rescardnumber %]) at [% resbranchname %] since [% resreservedate %]</li>
 [% END %]
 
 [% IF ( ISSUED_TO_ANOTHER ) %]
@@ -288,8 +364,19 @@ function refocus(calendar) {
 [% IF ( ITEM_LOST ) %]
     <li>This item has been lost with a status of "[% ITEM_LOST %]". Check out anyway?</li>
 [% END %]
+
+[% IF  HIGHHOLDS %]
+       <li>High demand item. Loan period shortened to [% HIGHHOLDS.duration %] days (due [% HIGHHOLDS.returndate %]). Check out anyway?</li>
+[% END %]
 </ul>
 
+[% IF HIGHHOLDS %]
+       <script language="JavaScript" type="text/javascript">
+       $(document).ready(function() {
+               $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate %]');
+       });
+       </script>
+[% END %]
 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
 
 [% IF ( RESERVED ) %]
@@ -312,7 +399,7 @@ function refocus(calendar) {
     [% IF ( DEBT ) %]<input type="hidden" name="debt_confirmed" value="1" />[% END %]
     [% IF ( INVALID_DATE ) %]
     <p>
-    <input type="text" size="10" id="duedatespec" name="duedatespec" value="[% duedatespec %]" />
+    <input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec %]" />
     <label for="duedatespec">Due date</label>
     </p>
     [% ELSE %]
@@ -396,6 +483,10 @@ function refocus(calendar) {
             <li>No more renewals possible</li>
         [% END %]
 
+        [%IF ( AGE_RESTRICTION ) %]
+            <li>Age restriction [% AGE_RESTRICTION %].</li>
+        [% END %]
+
         [% IF ( EXPIRED ) %]
             <li>Patron's card is expired</li>
         [% END %]
@@ -409,7 +500,7 @@ function refocus(calendar) {
         [% END %]
        
            [% IF ( USERBLOCKEDOVERDUE ) %]
-            <li>Patron has [% USERBLOCKEDOVERDUE %] overdue item(s).  Check out anyway?</li>
+            <li>Checkouts are BLOCKED because patron has overdue items</li>
         [% END %]
         </ul>
 
@@ -486,37 +577,8 @@ No patron matched <span class="ex">[% message %]</span>
 
     [% IF ( SpecifyDueDate ) %]<div class="date-select">
         <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
-               [% IF ( duedatespec ) %]<input type="text" size="10" id="duedatespec" name="duedatespec" value="[% duedatespec %]" />[% ELSE %]<input type="text" size="10" id="duedatespec" name="duedatespec" value="" />
+        [% IF ( duedatespec ) %]<input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec %]" />[% ELSE %]<input type="text" size="13" id="duedatespec" name="duedatespec" value="" />
 [% END %]
-        <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show calendar"  border="0" id="CalendarDueDate" style="cursor: pointer;" />
-             <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 : "duedatespec",
-                             ifFormat : "[% DHTMLcalendar_dateformat %]",
-                             button : "CalendarDueDate",
-//                           disableFunc : validate1,
-//                           dateStatusFunc : validate1,
-                             onClose : refocus
-                           }
-                        );
-                               //]]>
-                 </script>
-
           <label for="stickyduedate"> Remember for session:</label>
 [% IF ( stickyduedate ) %]
 <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
@@ -554,7 +616,7 @@ No patron matched <span class="ex">[% message %]</span>
 
                        [% IF ( warndeparture ) %]
                        <li><span class="circ-hlt">Expiration:</span> Patron's card will expire soon.
-            Patron's card expires on [% expiry | $KohaDates %] <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&amp;cardnumber=[% cardnumber %]&amp;destination=circ&amp;reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% borrowernumber %]&amp;categorycode=[% categorycode %]">Edit Details</a>
+                       Patron's card expires on [% expiry %] <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&amp;cardnumber=[% cardnumber %]&amp;destination=circ&amp;reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% borrowernumber %]&amp;categorycode=[% categorycode %]">Edit Details</a>
 
                        </li>
                        [% END %]
@@ -567,7 +629,7 @@ No patron matched <span class="ex">[% message %]</span>
 
                        [% IF ( expired ) %]
                        <li><span class="circ-hlt">Expiration:</span> Patron's card has expired.
-            [% IF ( expiry ) %]Patron's card expired on [% expiry | $KohaDates %][% END %] <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&amp;cardnumber=[% cardnumber %]&amp;destination=circ&amp;reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% borrowernumber %]&amp;categorycode=[% categorycode %]">Edit Details</a>
+                       [% IF ( expiry ) %]Patron's card expired on [% expiry %][% END %] <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&amp;cardnumber=[% cardnumber %]&amp;destination=circ&amp;reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% borrowernumber %]&amp;categorycode=[% categorycode %]">Edit Details</a>
 
                        </li>
                        [% END %]
@@ -582,7 +644,7 @@ No patron matched <span class="ex">[% message %]</span>
 
             [% IF ( userdebarred ) %]
                <li class="blocker">
-               <span class="circ-hlt"> Restricted:</span> Patron's account is restricted [% IF (userdebarreddate ) %] until [% userdebarreddate | $KohaDates %] [% END %] [% IF (debarredcomment ) %] with the comment "[% debarredcomment %]"[% END %]
+               <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" />
@@ -619,7 +681,7 @@ No patron matched <span class="ex">[% message %]</span>
                    <h4>Holds waiting:</h4>
                                [% FOREACH WaitingReserveLoo IN WaitingReserveLoop %]
                                    <ul>
-                            <li> <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% WaitingReserveLoo.biblionumber %]">[% WaitingReserveLoo.title |html %]</a> ([% WaitingReserveLoo.itemtype %]), [% IF ( WaitingReserveLoo.author ) %]by [% WaitingReserveLoo.author %][% END %] Hold placed on [% WaitingReserveLoo.reservedate | $KohaDates %].
+                                       <li> <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% WaitingReserveLoo.biblionumber %]">[% WaitingReserveLoo.title |html %]</a> ([% WaitingReserveLoo.itemtype %]), [% IF ( WaitingReserveLoo.author ) %]by [% WaitingReserveLoo.author %][% END %] Hold placed on [% WaitingReserveLoo.reservedate %].
                                    [% IF ( WaitingReserveLoo.waitingat ) %]
                                        <br />[% IF ( WaitingReserveLoo.waitinghere ) %]<strong class="waitinghere">[% ELSE %]<strong>[% END %]Waiting at [% WaitingReserveLoo.waitingat %]</strong>
                                    [% END %]
@@ -695,7 +757,7 @@ No patron matched <span class="ex">[% message %]</span>
 <!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
 <div id="checkouts">
 [% IF ( issuecount ) %]
-    <form action="/cgi-bin/koha/reserve/renewscript.pl" method="post" class="checkboxed">
+    <form name="issues" action="/cgi-bin/koha/reserve/renewscript.pl" method="post" class="checkboxed">
     <input type="hidden" value="circ" name="destination" />
     <input type="hidden" name="cardnumber" value="[% cardnumber %]" />
     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
@@ -712,6 +774,7 @@ No patron matched <span class="ex">[% message %]</span>
         <th scope="col">Price</th>
         <th scope="col">Renew <p class="column-tool"><a href="#" id="CheckAllitems">select all</a> | <a href="#" id="CheckNoitems">none</a></p></th>
         <th scope="col">Check in <p class="column-tool"><a href="#" id="CheckAllreturns">select all</a> | <a href="#" id="CheckNoreturns">none</a></p></th>
+        <th scope="col">Export <p class="column-tool"><a href="#" id="CheckAllexports">select all</a> | <a href="#" id="CheckNoexports">none</a></p></th>
     </tr>
 [% IF ( todayissues ) %]</thead>
 [% INCLUDE 'checkouts-table-footer.inc' %]
@@ -724,11 +787,11 @@ No patron matched <span class="ex">[% message %]</span>
     <tr class="highlight">
     [% END %]
         [% IF ( todayissue.od ) %]<td class="od">[% ELSE %]<td>[% END %]
-        [% todayissue.duedate | $KohaDates %]
+        [% todayissue.dd %]
         </td>
         <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% todayissue.biblionumber %]&amp;type=intra"><strong>[% todayissue.title |html %]</strong></a>[% IF ( todayissue.author ) %], by [% todayissue.author %][% END %][% IF ( todayissue.itemnotes ) %]- <span class="circ-hlt">[% todayissue.itemnotes %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% todayissue.biblionumber %]&amp;itemnumber=[% todayissue.itemnumber %]#item[% todayissue.itemnumber %]">[% todayissue.barcode %]</a></td>
         <td>[% UNLESS ( noItemTypeImages ) %] [% IF ( todayissue.itemtype_image ) %]<img src="[% todayissue.itemtype_image %]" alt="" />[% END %][% END %][% todayissue.itemtype %]</td>
-        <td>[% todayissue.checkoutdate | $KohaDates %]</td>
+        <td>[% todayissue.checkoutdate %]</td>
         [% IF ( todayissue.multiple_borrowers ) %]<td>[% todayissue.firstname %] [% todayissue.surname %]</td>[% END %]
         <td>[% todayissue.issuingbranchname %]</td>
         <td>[% todayissue.itemcallnumber %]</td>
@@ -768,9 +831,9 @@ No patron matched <span class="ex">[% message %]</span>
         [% END %]
         </td>
         [% END %]
-  [% IF ( todayissue.return_failed ) %]
+        [% IF ( todayissue.return_failed ) %]
             <td class="problem">Checkin failed</td>
-      [% ELSE %]
+        [% ELSE %]
             [% IF ( todayissue.renew_error_on_reserve ) %]
                <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% todayissue.biblionumber %]">On hold</a>
                 <input type="checkbox" name="all_barcodes[]" value="[% todayissue.barcode %]" checked="checked" style="display: none;" />
@@ -780,13 +843,17 @@ No patron matched <span class="ex">[% message %]</span>
                 <input type="checkbox" name="all_barcodes[]" value="[% todayissue.barcode %]" checked="checked" style="display: none;" />
             </td>
             [% END %]
-      [% END %]
+        [% END %]
+        <td style="text-align:center;">
+            <input type="checkbox" id="export_[% todayissue.biblionumber %]" name="biblionumbers" value="[% todayissue.biblionumber %]" />
+            <input type="checkbox" name="itemnumbers" value="[% todayissue.itemnumber %]" style="visibility:hidden;" />
+        </td>
     </tr>
     [% END %] <!-- /loop todayissues -->
     <!-- /if todayissues -->[% END %]
 [% IF ( previssues ) %]
-[% IF ( todayissues ) %]<tr><th colspan="10"><a name="previous" id="previous"></a>Previous checkouts</th></tr>[% ELSE %]
-<tr><th class="{sorter: false}" colspan="10"><a name="previous" id="previous"></a>Previous checkouts</th></tr></thead>
+[% IF ( todayissues ) %]<tr><th colspan="11"><a name="previous" id="previous"></a>Previous checkouts</th></tr>[% ELSE %]
+<tr><th class="{sorter: false}" colspan="11"><a name="previous" id="previous"></a>Previous checkouts</th></tr></thead>
 [% INCLUDE 'checkouts-table-footer.inc' %]
        <tbody>
 [% END %]
@@ -797,13 +864,13 @@ No patron matched <span class="ex">[% message %]</span>
         <tr class="highlight">
     [% END %]
         [% IF ( previssue.od ) %]<td class="od">[% ELSE %]<td>[% END %]
-        [% previssue.duedate | $KohaDates %]
+        [% previssue.dd %]
         </td>
         <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% previssue.biblionumber %]&amp;type=intra"><strong>[% previssue.title |html %]</strong></a>[% IF ( previssue.author ) %], by [% previssue.author %][% END %] [% IF ( previssue.itemnotes ) %]- [% previssue.itemnotes %][% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% previssue.biblionumber %]&amp;itemnumber=[% previssue.itemnumber %]#item[% previssue.itemnumber %]">[% previssue.barcode %]</a></td>
         <td>
             [% previssue.itemtype %]
         </td>
-        <td>[% previssue.issuedate | $KohaDates %]</td>
+        <td>[% previssue.displaydate %]</td>
         [% IF ( previssue.multiple_borrowers ) %]<td>[% previssue.firstname %] [% previssue.surname %]</td>[% END %]
         <td>[% previssue.issuingbranchname %]</td>
         <td>[% previssue.itemcallnumber %]</td>
@@ -844,7 +911,7 @@ No patron matched <span class="ex">[% message %]</span>
         </td>
         [% END %]
                  [% IF ( previssue.return_failed ) %]
-            <td class="problem">Checkin failed</td>
+            <td class="problem">Check-in failed</td>
         [% ELSE %]
             [% IF ( previssue.renew_error_on_reserve ) %]
                <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% previssue.biblionumber %]">On hold</a>
@@ -855,7 +922,11 @@ No patron matched <span class="ex">[% message %]</span>
                 <input type="checkbox" name="all_barcodes[]" value="[% previssue.barcode %]" checked="checked" style="display: none;" />
             </td>
             [% END %]
-      [% END %]
+        [% END %]
+        <td style="text-align:center;">
+            <input type="checkbox" id="export_[% previssue.biblionumber %]" name="biblionumbers" value="[% previssue.biblionumber %]" />
+            <input type="checkbox" name="itemnumbers" value="[% previssue.itemnumber %]" style="visibility:hidden;" />
+        </td>
     </tr>
     <!-- /loop previssues -->[% END %]
 <!--/if previssues -->[% END %]
@@ -871,7 +942,14 @@ No patron matched <span class="ex">[% message %]</span>
         [% END %]
         <input type="submit" name="renew_checked" value="Renew or Return checked items" />
         <input type="submit" id="renew_all" name="renew_all" value="Renew all" />
-        </fieldset>
+        <br/><br/>
+        Don't export fields : <input type="text" id="export_remove_fields" name="export_remove_fields" value="[% export_remove_fields %]" title="Use for iso2709 exports" />
+        <span id="exportmenuc">Export</span>
+        <input type="hidden" name="op" value="export" />
+        <input type="hidden" id="export_format" name="format" value="iso2709" />
+        <input type="hidden" id="dont_export_item" name="dont_export_item" value="0" />
+        <input type="hidden" id="record_type" name="record_type" value="bibs" />
+    </fieldset>
     [% END %]
     </form>
 [% ELSE %]
@@ -918,7 +996,7 @@ No patron matched <span class="ex">[% message %]</span>
     [% END %] <!-- /loop relissues -->
     <!-- /if relissues -->[% END %]
 [% IF ( relprevissues ) %]
-<tr><th class="{sorter: false}" colspan="10"><a name="relprevious" id="relprevious"></a>Previous checkouts</th></tr>
+<tr><th class="{sorter: false}" colspan="11"><a name="relprevious" id="relprevious"></a>Previous checkouts</th></tr>
     [% FOREACH relprevissue IN relprevissues %]
     [% IF ( loop.odd ) %]
         <tr>
@@ -965,7 +1043,7 @@ No patron matched <span class="ex">[% message %]</span>
                <tbody>
         [% FOREACH reservloo IN reservloop %]
         <tr class="[% reservloo.color %]">
-                    <td>[% reservloo.reservedate | $KohaDates %]</td>
+                    <td>[% reservloo.reservedate %]</td>
                     <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% reservloo.biblionumber %]"><strong>[% reservloo.title |html %]</strong></a>[% IF ( reservloo.author ) %], by [% reservloo.author %][% END %]</td>
                     <td>[% reservloo.itemcallnumber %]</td>
                                        <td><em>[% IF ( reservloo.barcodereserv ) %]Item [% reservloo.barcodereserv %]
@@ -1003,37 +1081,8 @@ No patron matched <span class="ex">[% message %]</span>
 
             [% 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;" />
+            <input type="text" size="10" id="suspend_until" name="suspend_until" class="datepicker" />
             <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>