Bug 31095: Remove GetDebarments from circ/circulation.pl
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / circulation.tt
index d5e83f6..a24fece 100644 (file)
@@ -9,6 +9,7 @@
 [% USE ItemTypes %]
 [% USE Price %]
 [% USE AuthorisedValues %]
+[% PROCESS 'i18n.inc' %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
 [% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %]
 
 <body id="circ_circulation" class="circ">
 
-    [% INCLUDE 'header.inc' %]
+    [% WRAPPER 'header.inc' %]
     [% INCLUDE 'circ-search.inc' %]
+[% END %]
 
+    [% WRAPPER 'sub-header.inc' %]
     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
         <ol>
             <li>
@@ -54,6 +57,7 @@
             [% END %]
         </ol>
     </nav>
+    [% END %]
 
     <div class="main container-fluid">
         <main>
@@ -64,6 +68,8 @@
                         [% INCLUDE 'members-toolbar.inc' %]
                     [% END %]
 
+                    <h1>Checkouts</h1>
+
                     <!--  INITIAL BLOC : PARAMETERS & BORROWER INFO -->
                     [% IF ( was_renewed ) %]
                         <div class="dialog message">Patron's account has been renewed until [% expiry | $KohaDates %]</div>
                                 [% IF ( NOT_FOR_LOAN_FORCING ) %]
                                     <li>
                                     [% IF ( itemtype_notforloan ) %]
-                                        Item type is normally not for loan.
+                                        <span>Item type is normally not for loan.</span>
                                     [% ELSIF ( item_notforloan ) %]
                                         [% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
-                                        Item is normally not for loan[% IF (item_notforloan_lib) %] ([% item_notforloan_lib | html %])[% END %].
+                                        <span>Item is normally not for loan</span>[% IF (item_notforloan_lib) %] ([% item_notforloan_lib | html %])[% END %].
                                     [% END %]
                                         [% IF CAN_user_circulate_force_checkout %]
-                                            Check out anyway?
+                                            <span>Check out anyway?</span>
                                         [% END %]
                                     </li>
                                 [% END %]
                                         Please confirm that the accompanying materials are present: [% ADDITIONAL_MATERIALS | html %]
                                     </li>
                                 [% END %]
+
+                                [% IF RECALLED %]
+                                    [% IF RECALLED.waiting %]
+                                        <li>Item <i>[% RECALLED.biblio.title | html %]</i> ([% RECALLED.item.barcode | html %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% RECALLED.patron_id | uri %]">[% RECALLED.patron.firstname | html %] [% RECALLED.patron.surname | html %]</a> ([% RECALLED.patron.cardnumber | html %]) at [% Branches.GetName( RECALLED.pickup_library_id ) | html %] since [% RECALLED.waiting_date | $KohaDates %]</li>
+                                    [% ELSIF RECALLED.requested or RECALLED.overdue %]
+                                        <li>Item <i>[% RECALLED.biblio.title | html %]</i> [% IF RECALLED.item %]([% RECALLED.item.barcode | html %])[% END %] has been recalled by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% RECALLED.patron_id | uri %]">[% RECALLED.patron.firstname | html %] [% RECALLED.patron.surname | html %]</a> ([% RECALLED.patron.cardnumber | html %]) at [% Branches.GetName( RECALLED.pickup_library_id ) | html %] since [% RECALLED.created_date | $KohaDates %]</li>
+                                    [% END %]
+                                [% END %]
+
                             </ul>
 
                             [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
                                         </p>
                                     [% END %]
 
+                                    [% IF ( RECALLED ) %]
+                                        <p>
+                                            <label for="cancelrecall">Cancel recall</label>
+                                            <input type="radio" value="cancel" name="cancel_recall" id="cancelrecall" />
+                                            <input type="hidden" value="[% RECALLED.id | html %]" name="recall_id" />
+                                        </p>
+                                        [% IF RECALLED.waiting %]
+                                            <p>
+                                                <label for="revertrecall">Revert waiting status</label>
+                                                <input type="radio" value="revert" name="cancel_recall" id="revertrecall" checked="checked"/>
+                                                <input type="hidden" value="[% RECALLED.id | html %]" name="recall_id" />
+                                            </p>
+                                        [% END %]
+                                    [% END %]
+
                                     <input type="hidden" name="barcode" value="[% barcode | html %]" />
                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
                                     <input type="hidden" name="issueconfirmed" value="1" />
 
                                     [% IF ( INVALID_DATE ) %]
                                         <p>
-                                          <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" />
+                                          <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
                                             <label for="duedatespec">Due date</label>
                                         </p>
                                     [% ELSE %]
                                 </form>
                             [% END # /IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
 
+                            [% IF ADDITIONAL_MATERIALS && !CAN_user_circulate_force_checkout %]
+                                <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
+                                    <input type="hidden" name="restoreduedatespec" />
+
+                                    [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
+
+                                    <input type="hidden" name="barcode" value="[% barcode | html %]" />
+                                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
+                                    <input type="hidden" name="issueconfirmed" value="1" />
+                                    <input type="hidden" name="override_high_holds" value="[% override_high_holds | html %]"/>
+                                    <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
+                                    <input type="hidden" name="branch" value="[% branch | html %]" />
+
+                                    [% IF ( RENEW_ISSUE ) %]
+                                        <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, renew (Y)</button>
+                                    [% ELSE %]
+                                        <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, check out (Y)</button>
+                                    [% END %]
+
+                                    <input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
+                                    <input type="hidden" name="auto_renew" value="[% auto_renew | html %]" />
+                                </form>
+                            [% END # /IF ADDITIONAL_MATERIALS %]
+
                             [% IF ( RESERVED or RESERVE_WAITING or TRANSFERRED or PROCESSING ) %]
                                 <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
                                     <input type="hidden" name="restoreduedatespec" />
                                 </form>
                             [% END %]
 
+                            [% IF ( RECALLED ) %]
+                                <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
+                                    <button class="print" type="submit" onclick="Dopop('/cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id=[% RECALLED.id | html %]');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
+                                </form>
+                            [% END %]
+
                             <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
                                 [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
                                 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
                                 <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
                                 <input type="hidden" name="restoreduedatespec" />
                                 <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
-                                [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
+                                [% IF CAN_user_circulate_force_checkout or HIGHHOLDS or ADDITIONAL_MATERIALS %]
                                     [% IF ( RENEW_ISSUE ) %]
                                         <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't renew (N)</button>
                                     [% ELSE %]
                                 [% END %]
                             </form>
 
-                            [% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
+                            [% IF ( RESERVED || ISSUED_TO_ANOTHER || RECALLED ) && (CAN_user_reserveforothers_place_holds ) %]
                                 [% UNLESS noissues %]
                                     <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber | html %]&borrowernumber=[% patron.borrowernumber | html %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
                                 [% END %]
                                 [% END %]
 
                                 [% IF ( INVALID_DATE ) %]
-                                    <li>The due date &quot;[% INVALID_DATE | html %]&quot; is invalid</li>
+                                    <li>The due date &quot;[% INVALID_DATE | $KohaDates %]&quot; is invalid</li>
                                 [% END %]
 
                                 [% IF ( UNKNOWN_BARCODE ) %]
                                 [% IF ( USERBLOCKEDOVERDUE ) %]
                                     <li>Checkouts are BLOCKED because patron has overdue items.</li>
                                 [% END %]
+
+                                [% IF ( RECALLED_INTRANSIT ) %]
+                                    <li>Item has been recalled and is in transit for pickup at [% Branches.GetName( RECALLED_INTRANSIT ) | html %].</li>
+                                [% END %]
                                 </ul>
 
                                 [% IF (forceallow) %]
                         <h4>No patron matched <span class="ex">[% message | html %]</span></h4>
                     [% END %]
 
-                    [% IF ( borrowers ) %]
-
-                        [% INCLUDE 'patron-toolbar.inc' %]
-                        <fieldset id="circ_circulation_selectborrower">
-                            <legend>Patron selection</legend>
-                            [% INCLUDE 'circ-patron-search-results.inc' destination = "circ" %]
-                        </fieldset>
-
-                    [% ELSE %]
-
-                        <!-- BARCODE ENTRY -->
+                    <!-- BARCODE ENTRY -->
 
-                        [% IF patron %]
+                    [% IF patron %]
 
-                            [% IF patron.privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
-                                <div class="dialog alert">
-                                    <strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.
-                                </div>
-                            [% END %]
+                        [% IF patron.privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
+                            <div class="dialog alert">
+                                <strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.
+                            </div>
+                        [% END %]
 
-                            <div class="row">
-                                [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
-                                    <div class="col-sm-6">
-                                        <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
-                                            <input type="hidden" name="restoreduedatespec" />
-                                            [% IF ( issue ) %]
-                                                <fieldset id="circ_circulation_issue" class="lastchecked">
-                                            [% ELSE %]
-                                                <fieldset id="circ_circulation_issue">
-                                            [% END %]
+                        <div class="row">
+                            [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
+                                <div class="col-sm-6">
+                                    <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
+                                        <input type="hidden" name="restoreduedatespec" />
+                                        [% IF ( issue ) %]
+                                            <fieldset id="circ_circulation_issue" class="lastchecked">
+                                        [% ELSE %]
+                                            <fieldset id="circ_circulation_issue">
+                                        [% END %]
 
-                                            [% IF ( DisplayClearScreenButton ) %]
-                                                <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
-                                                <span id="printclearscreen"><a href="#" title="Print slip and clear screen"><i class="fa fa-print"></i></a></span>
-                                            [% END %]
+                                        [% IF Koha.Preference('DisplayClearScreenButton') == 'issueslip' %]
+                                            <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
+                                            <span id="printclearscreen"><a href="#" title="Print slip and clear screen"><i class="fa fa-print"></i></a></span>
+                                        [% ELSIF Koha.Preference('DisplayClearScreenButton') == 'issueqslip' %]
+                                            <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
+                                            <span id="printclearscreenq"><a href="#" title="Print quick slip and clear screen"><i class="fa fa-print"></i></a></span>
+                                        [% END %]
 
-                                            [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
+                                        [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
 
-                                            <label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
+                                        <label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
 
+                                        [% IF NEEDSCONFIRMATION %]
+                                            <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" />
+                                        [% ELSE %]
                                             [% IF Koha.Preference('itemBarcodeFallbackSearch') %]
-                                                <div class="hint">Enter item barcode or keyword:</div>
+                                                <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" placeholder="Enter item barcode or keyword" />
                                             [% ELSE %]
-                                                <div class="hint">Enter item barcode:</div>
+                                                <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" placeholder="Enter item barcode" />
                                             [% END %]
+                                        [% END %]
 
-                                            [% IF NEEDSCONFIRMATION %]
-                                                <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" />
-                                            [% ELSE %]
-                                                <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" />
-                                            [% END %]
+                                        <div id="show-circ-settings">
+                                            <a href="#" title="Checkout settings"><i class="fa fa-sliders"></i></a>
+                                        </div>
 
-                                            <button type="submit" class="btn btn-default">Check out</button>
+                                        <button type="submit" class="btn btn-primary">Check out</button>
 
-                                            <div id="show-circ-settings">
-                                                <a href="#"><i class="fa fa-caret-right circ-settings-icon"></i> Checkout settings</a>
-                                            </div>
+                                        <div class="circ-settings">
 
-                                            <div class="circ-settings">
-
-                                                    [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
-                                                        [% IF ( SpecifyDueDate ) %]
-                                                            <div id="specify-due-date" class="circ-setting">
-                                                                <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
-                                                                [% IF ( duedatespec ) %]
-                                                                    <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" />
-                                                                [% ELSE %]
-                                                                    <input type="text" size="20" id="duedatespec" name="duedatespec" value="" />
-                                                                [% END %]
-                                                                <label for="stickyduedate"> Remember for session:</label>
-                                                                [% IF ( stickyduedate ) %]
-                                                                    <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
-                                                                [% ELSE %]
-                                                                    <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" />
-                                                                [% END %]
-                                                            </div>
-                                                        [% END %]
+                                                [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
+                                                    [% IF ( SpecifyDueDate ) %]
+                                                        <div id="specify-due-date" class="circ-setting">
+                                                            <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
+                                                            [% IF ( duedatespec ) %]
+                                                                <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
+                                                            [% ELSE %]
+                                                                <input type="text" size="20" id="duedatespec" name="duedatespec" value="" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
+                                                            [% END %]
+                                                            <label for="stickyduedate"> Remember for session:</label>
+                                                            [% IF ( stickyduedate ) %]
+                                                                <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
+                                                            [% ELSE %]
+                                                                <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" />
+                                                            [% END %]
+                                                        </div>
                                                     [% END %]
+                                                [% END %]
 
-                                                    [% UNLESS ( noissues ) %]
+                                                [% UNLESS ( noissues ) %]
+                                                    [% IF Koha.Preference('AllowSetAutomaticRenewal') %]
                                                         <div id="set-automatic-renewal" class="circ-setting">
                                                             [% IF NEEDSCONFIRMATION %]
                                                                 [% IF auto_renew %]
 
                                                             <label for="auto_renew">Automatic renewal</label>
                                                         </div>
-                                                        [% IF Koha.Preference('decreaseLoanHighHolds') %]
-                                                            <div id="set_high_holds_overrride" class="circ-setting">
-                                                                [% IF NEEDSCONFIRMATION %]
-                                                                    [% IF override_high_holds %]
-                                                                        <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled" checked="checked"/>
-                                                                    [% ELSE %]
-                                                                        <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled"/>
-                                                                    [% END %]
+                                                    [% END %]
+                                                    [% IF Koha.Preference('decreaseLoanHighHolds') %]
+                                                        <div id="set_high_holds_overrride" class="circ-setting">
+                                                            [% IF NEEDSCONFIRMATION %]
+                                                                [% IF override_high_holds %]
+                                                                    <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled" checked="checked"/>
                                                                 [% ELSE %]
-                                                                    [% IF override_high_holds %]
-                                                                        <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" />
-                                                                    [% ELSE %]
-                                                                        <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" />
-                                                                    [% END %]
+                                                                    <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled"/>
                                                                 [% END %]
-                                                                <label for="override_high_holds">Don't decrease checkout length based on holds</label>
-                                                            </div>
-                                                        [% END %]
-                                                    [% END %]
-
-                                                    [% IF Koha.Preference('OnSiteCheckouts') %]
-                                                        <div id="onsite_checkout-select" class="circ-setting">
-                                                            [% IF noissues %]
-                                                                <div class="onsite-checkout-only">
-                                                                    <input type="checkbox" id="onsite_checkout" name="onsite_checkout_forced" checked="checked" disabled="disabled" /> <label for="onsite_checkout">On-site checkouts only. Automatic due date: </label>
-                                                                    <input type="text" name="duedatespec" id="duedatespec" />
-                                                                    <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
-                                                                </div>
                                                             [% ELSE %]
-                                                                [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %]
-                                                                <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label>
+                                                                [% IF override_high_holds %]
+                                                                    <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" />
                                                                 [% ELSE %]
-                                                                <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
+                                                                    <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" />
                                                                 [% END %]
                                                             [% END %]
+                                                            <label for="override_high_holds">Don't decrease checkout length based on holds</label>
                                                         </div>
                                                     [% END %]
+                                                [% END %]
 
-                                                </div> <!-- /.circ-settings -->
-
-                                                <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
-                                                <input type="hidden" name="branch" value="[% branch | html %]" />
-                                                <input type="hidden" name="debt_confirmed" value="[% debt_confirmed | html %]" />
-                                                [% IF ( CHARGES ) %]
-                                                        <input type="hidden" name="charges" value="yes" />
+                                                [% IF Koha.Preference('OnSiteCheckouts') %]
+                                                    <div id="onsite_checkout-select" class="circ-setting">
+                                                        [% IF noissues %]
+                                                            <div class="onsite-checkout-only">
+                                                                <input type="checkbox" id="onsite_checkout" name="onsite_checkout_forced" checked="checked" disabled="disabled" /> <label for="onsite_checkout">On-site checkouts only. Automatic due date: </label>
+                                                                <input type="text" name="duedatespec" id="duedatespec" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
+                                                                <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
+                                                            </div>
+                                                        [% ELSE %]
+                                                            [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %]
+                                                            <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label>
+                                                            [% ELSE %]
+                                                            <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
+                                                            [% END %]
+                                                        [% END %]
+                                                    </div>
                                                 [% END %]
-                                            </fieldset> <!-- /#circ_circulation_issue -->
 
-                                            [% IF ( issue ) %]
-                                                <div class="lastchecked">
-                                                    <p><strong>Checked out: </strong>[% issue.item.biblio.title | html %] ([% issue.item.barcode | html %]). Due on [% issue.date_due | $KohaDates as_due_date => 1 %]</p>
-                                                </div>
+                                            </div> <!-- /.circ-settings -->
+
+                                            <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
+                                            <input type="hidden" name="branch" value="[% branch | html %]" />
+                                            <input type="hidden" name="debt_confirmed" value="[% debt_confirmed | html %]" />
+                                            [% IF ( CHARGES ) %]
+                                                    <input type="hidden" name="charges" value="yes" />
                                             [% END %]
-                                        </form> <!-- /#mainform -->
-                                    </div> <!-- /.col-sm-6 -->
+                                        </fieldset> <!-- /#circ_circulation_issue -->
 
-                                [% END #/IF !noissues %]
+                                        [% IF ( issue ) %]
+                                            <div class="lastchecked">
+                                                <p>
+                                                    <strong>Checked out: </strong>
+                                                    [% issue.item.biblio.title | html %] ([% issue.item.barcode | html %]).
 
-                                [% IF ( noissues ) %]
-                                    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
-                                        <div class="col-sm-6">
-                                    [% ELSE %]
-                                        <div>
-                                    [% END %]
-                                [% ELSE %]
-                                    <div class="col-sm-6">
-                                [% END %]
+                                                    [% IF issue.item.is_bundle %]
+                                                        [% SET bundle_items_count = issue.item.bundle_items.count %]
+                                                        [% tnx('Bundle of {count} item', 'Bundle of {count} items', bundle_items_count, { count = bundle_items_count }) | html %].
+                                                    [% END %]
 
-                                [% IF ( noissues ) %]
-                                    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
-                                        <div id="circmessages" class="circmessage attention">
-                                    [% ELSE %]
-                                        <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
-                                        <div id="circmessages" class="circmessage warning">
-                                    [% END %]
-                                    <h3>
-                                        Cannot check out!
-                                        [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
-                                            <span class="circ-hlt">Only on-site checkouts are allowed</span>
+                                                    Due on [% issue.date_due | $KohaDates as_due_date => 1 %]
+                                                </p>
+                                            </div>
                                         [% END %]
-                                    </h3>
-                                [% ELSE %]
-                                    <div id="circmessages" class="circmessage attention">
-                                [% END %]
-
-                                [% INCLUDE 'patron_messages.inc' %]
+                                    </form> <!-- /#mainform -->
+                                </div> <!-- /.col-sm-6 -->
 
-                            </div> <!-- /#circmessages -->
-                        </div> <!-- /div or div.col-sm-6 -->
-                    </div> <!-- /.row -->
+                            [% END #/IF !noissues %]
 
-                    <div id="patronlists" class="toptabs">
-                        <ul>
-                            <li>
-                                [% IF ( issuecount ) %]
-                                    <a href="#checkouts">[% issuecount | html %] Checkout(s)</a>
+                            [% IF ( noissues ) %]
+                                [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
+                                    <div class="col-sm-6">
                                 [% ELSE %]
-                                    <a href="#checkouts">0 Checkouts</a>
+                                    <div>
                                 [% END %]
-                            </li>
-
-                            [% IF relatives_issues_count %]
-                                <li><a id="relatives-issues-tab" href="#relatives-issues">[% relatives_issues_count | html %] Relatives' checkouts</a></li>
+                            [% ELSE %]
+                                <div class="col-sm-6">
                             [% END %]
 
-                            <li>
-                                [% IF ( holds_count ) %]
-                                    <a href="#reserves" id="holds-tab">[% holds_count | html %] Hold(s)</a>
+                            [% IF ( noissues ) %]
+                                [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
+                                    <div id="circmessages" class="circmessage attention">
                                 [% ELSE %]
-                                    <a href="#reserves" id="holds-tab">0 Holds</a>
+                                    <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
+                                    <div id="circmessages" class="circmessage warning">
                                 [% END %]
+                                <h3>
+                                    Cannot check out!
+                                    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
+                                        <span class="circ-hlt">Only on-site checkouts are allowed</span>
+                                    [% END %]
+                                </h3>
+                            [% ELSE %]
+                                <div id="circmessages" class="circmessage attention">
+                            [% END %]
+
+                            [% INCLUDE 'patron_messages.inc' %]
+
+                        </div> <!-- /#circmessages -->
+                    </div> <!-- /div or div.col-sm-6 -->
+                </div> <!-- /.row -->
+
+                <div id="patronlists" class="toptabs">
+                    <ul class="nav nav-tabs" role="tablist">
+                        <li role="presentation" class="active">
+                            <a href="#checkouts" aria-controls="checkouts" role="tab" data-toggle="tab">Checkouts ([% issuecount || 0 | html %])</a>
+                        </li>
+
+                        [% IF relatives_issues_count %]
+                            <li role="presentation">
+                                <a id="relatives-issues-tab" href="#relatives-issues" aria-controls="relatives-issues" role="tab" data-toggle="tab">Relatives' checkouts ([% relatives_issues_count | html %])</a>
                             </li>
+                        [% END %]
 
-                            [% IF Koha.Preference('ArticleRequests') %]
-                                [% SET current_article_requests = Context.Scalar( Context.Scalar( patron, 'article_requests' ), 'filter_by_current' ) %]
-                                <li>
-                                    <a href="#article-requests" id="article-requests-tab"> [% current_article_requests.count | html %] Article requests</a>
-                                </li>
-                            [% END %]
+                        <li role="presentation">
+                            <a href="#reserves" id="holds-tab" aria-controls="reserves" role="tab" data-toggle="tab">Holds ([% holds_count || 0 | html %])</a>
+                        </li>
 
-                            [% IF Koha.Preference('ClaimReturnedLostValue') %]
-                                <li>
-                                    [% IF ( patron.return_claims.count ) %]
-                                        <a href="#return-claims" id="return-claims-tab">
-                                            Claim(s)
-                                            [% IF patron.return_claims.resolved.count == 0 %]
-                                                <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
-                                            [% ELSE %]
-                                                <span title="Resolved claims" class="label label-success" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
-                                            [% END %]
-                                            [% IF patron.return_claims.unresolved.count == 0 %]
-                                                <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
-                                            [% ELSE %]
-                                                <span title="Unresolved claims" class="label label-warning" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
-                                            [% END %]
-                                        </a>
-                                    [% ELSE %]
-                                        <a href="#return-claims" id="return-claims-tab">
-                                            Claim(s)
-                                            <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">0</span>
-                                            <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">0</span>
-                                        </a>
-                                    [% END %]
-                                </li>
-                            [% END %]
+                        [% IF Koha.Preference('UseRecalls') %]
+                            <li role="presentation">
+                                <a href="#recalls" id="recalls-tab" aria-controls="recalls" role="tab" data-toggle="tab">Recalls ([% recalls.count || 0 | html %])</a>
+                            </li>
+                        [% END %]
 
-                            <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.count | html %] Restrictions</a></li>
+                        [% IF Koha.Preference('ArticleRequests') %]
+                            [% SET current_article_requests = Context.Scalar( Context.Scalar( patron, 'article_requests' ), 'filter_by_current' ) %]
+                            <li role="presentation">
+                                <a href="#article-requests" id="article-requests-tab" aria-controls="article-requests" role="tab" data-toggle="tab">Article requests ([% current_article_requests.count || 0 | html %])</a>
+                            </li>
+                        [% END %]
 
-                            [% SET enrollments = patron.get_club_enrollments(1) %]
-                            [% SET enrollable  = patron.get_enrollable_clubs(0,1) %]
-                            [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
-                                <li>
-                                    <a id="clubs-tab-link" href="#clubs-tab">
-                                        Clubs ([% enrollments.count | html %]/[% enrollable.count | html %])
+                        [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
+                            <li role="presentation">
+                                [% IF ( patron.return_claims.count ) %]
+                                    <a href="#return-claims" id="return-claims-tab" aria-controls="return-claims" role="tab" data-toggle="tab">
+                                        Claims
+                                        ([% IF patron.return_claims.resolved.count == 0 %]
+                                            <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
+                                        [% ELSE %]
+                                            <span title="Resolved claims" class="label label-success" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
+                                        [% END %]
+                                        [% IF patron.return_claims.unresolved.count == 0 %]
+                                            <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
+                                        [% ELSE %]
+                                            <span title="Unresolved claims" class="label label-warning" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
+                                        [% END %])
                                     </a>
-                                </li>
-                            [% END %]
-                        </ul>
+                                [% ELSE %]
+                                    <a href="#return-claims" id="return-claims-tab" aria-controls="return-claims" role="tab" data-toggle="tab">
+                                        Claims
+                                        (<span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">0</span>
+                                        <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">0</span>)
+                                    </a>
+                                [% END %]
+                            </li>
+                        [% END %]
+
+                        <li role="presentation">
+                            <a id="debarments-tab-link" href="#reldebarments" aria-controls="reldebarments" role="tab" data-toggle="tab">Restrictions ([% patron.restrictions.count || 0 | html %])</a>
+                        </li>
+
+                        [% SET enrollments = patron.get_club_enrollments %]
+                        [% SET enrollable  = patron.get_enrollable_clubs(0) %] <!-- 0 => not OPAC -->
+                        [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
+                            <li role="presentation">
+                                <a id="clubs-tab-link" href="#clubs-tab" aria-controls="clubs-tab" role="tab" data-toggle="tab">
+                                    Clubs ([% enrollments.count | html %]/[% enrollable.count | html %])
+                                </a>
+                            </li>
+                        [% END %]
+                    </ul>
 
+                    <div class="tab-content">
                         <!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
 
                         [% INCLUDE "checkouts-table.inc" %]
                         [% INCLUDE "relatives-issues-table.inc" %]
 
                         [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
-                            <div id="clubs-tab">
+                            <div id="clubs-tab" role="tabpanel" class="tab-pane">
                                 Loading...
                             </div> <!-- /#clubs-tab -->
                         [% END %]
 
-                        [% INCLUDE borrower_debarments.inc %]
+                        [% INCLUDE "patron-restrictions-tab.inc" %]
 
-                        <div id="reserves">
+                        <div id="reserves" role="tabpanel" class="tab-pane">
                             [% IF ( holds_count ) %]
                                 <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
                                     <input type="hidden" name="from" value="circ" />
                                                 <th>Hold date</th>
                                                 <th>Title</th>
                                                 <th>Call number</th>
+                                                <th>Item type</th>
                                                 <th>Barcode</th>
                                                 <th>Pickup at</th>
                                                 <th>Expiration</th>
                                         <input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
 
                                         [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
-                                        [% IF hold_cancellation %]
+                                        [% IF hold_cancellation.count %]
                                             <select name="cancellation-reason">
                                                 <option value="">No reason given</option>
                                                 [% FOREACH reason IN hold_cancellation %]
                                         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
                                             <input type="hidden" name="from" value="circ" />
                                             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
-                                            <input type="submit" value="Suspend all holds" />
+                                            <input type="submit" class="btn btn-primary" value="Suspend all holds" />
 
                                             [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
                                             <label for="suspend_until">until</label>
-                                            <input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr futuredate"/>
+                                            <input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr" data-flatpickr-futuredate="true" />
                                             <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
-                                             [% END %]
+                                            [% END %]
                                         </form>
                                     </fieldset>
 
                                             <input type="hidden" name="from" value="circ" />
                                             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
                                             <input type="hidden" name="suspend" value="0" />
-                                            <input type="submit" value="Resume all suspended holds" />
+                                            <input type="submit" class="btn btn-primary" value="Resume all suspended holds" />
                                         </form>
                                     </fieldset>
                                 [% END # /IF SuspendHoldsIntranet %]
                             [% END # /IF holds_count %]
                         </div> <!-- /#reserves -->
 
-                        [% IF Koha.Preference('ClaimReturnedLostValue') %]
+                        [% IF Koha.Preference('UseRecalls') %]
+                            <div id="recalls" role="tabpanel" class="tab-pane">
+                                [% INCLUDE 'recalls.inc' %]
+                            </div>
+                        [% END %]
+
+                        [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
                             [% INCLUDE 'patron-return-claims.inc' %]
                         [% END %]
 
                         [% IF Koha.Preference('ArticleRequests') %]
                             [% INCLUDE 'patron-article-requests.inc' %]
                         [% END %]
-
-                    </div> <!-- /#patronlists -->
-                    [% ELSIF borrowernumber # IF patron %]
-                        <div class="dialog message">Patron not found. <a href="/cgi-bin/koha/members/members-home.pl">Return to search</a></div>
-                    [% END # /IF patron %]
-
-                [% END #/IF borrowers %]
+                    </div> <!-- /.tab-content -->
+                </div> <!-- /#patronlists -->
+                [% ELSIF borrowernumber # IF patron %]
+                    <div class="dialog message">Patron not found. <a href="/cgi-bin/koha/members/members-home.pl">Return to search</a></div>
+                [% END # /IF patron %]
 
                 </div> <!-- /.col-sm-10.col-sm-push-2 -->
 
                 [% IF Koha.Preference('CircSidebar') %]
-                    [% UNLESS ( borrowers ) %]
-                        [% IF not( borrowernumber and patron ) %]
-                            <div class="col-sm-2 col-sm-pull-10">
-                                <aside>
-                                    [% INCLUDE 'circ-nav.inc' %]
-                                </aside>
-                            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
-                        [% END %]
+                    [% IF not( borrowernumber and patron ) %]
+                        <div class="col-sm-2 col-sm-pull-10">
+                            <aside>
+                                [% INCLUDE 'circ-nav.inc' %]
+                            </aside>
+                        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
                     [% END %]
                 [% END %]
 
-                [% UNLESS ( borrowers ) %]
-                    [% IF borrowernumber and patron %]
-                            <div class="col-sm-2 col-sm-pull-10">
-                                <aside>
-                            [% INCLUDE 'circ-menu.inc' %]
-                                </aside>
-                            </div> <!-- /.col-sm-2 col-sm-pull-10 -->
-                    [% END %]
+                [% IF borrowernumber and patron %]
+                        <div class="col-sm-2 col-sm-pull-10">
+                            <aside>
+                        [% INCLUDE 'circ-menu.inc' %]
+                            </aside>
+                        </div> <!-- /.col-sm-2 col-sm-pull-10 -->
                 [% END %]
 
             </div> <!-- /.row -->
         </main>
 
+        [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
+            [% INCLUDE 'modals/resolve_return_claim.inc' %]
+        [% END %]
+
 <!-- Modal -->
 <div id="barcodeSubmittedModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true">
     <div class="modal-dialog">
 </div> <!-- /#barcodeSubmittedModal -->
 
 [% MACRO jsinclude BLOCK %]
-    [% INCLUDE 'calendar.inc' %]
     [% INCLUDE 'datatables.inc' %]
     [% INCLUDE 'columns_settings.inc' %]
-    [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
-    [% INCLUDE 'timepicker.inc' %]
     [% INCLUDE 'select2.inc' %]
     [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
+    [% PROCESS 'modal-claims.inc' %]
+    [% PROCESS 'modal-claims-js' %]
+
     <script>
         /* Set some variable needed in circulation.js */
         var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
     </script>
     [% Asset.js("js/pages/circulation.js") | $raw %]
     [% Asset.js("js/checkouts.js") | $raw %]
+    [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
+        [% Asset.js("js/resolve_claim_modal.js") | $raw %]
+    [% END %]
     [% Asset.js("js/holds.js") | $raw %]
-    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
+    [% INCLUDE 'calendar.inc' %]
     <script>
-        columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
-        columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
+        table_settings_issues_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
+        table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'relatives-issues-table', 'json' ) | $raw %]
+        table_settings_borrowers_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
 
         [% IF borrowernumber and patron %]
             if( Cookies.get("holdfor") != [% patron.borrowernumber | html %]){
             Cookies.remove("holdfor", { path: '/' });
         [% END %]
 
-        [% UNLESS ( patron.borrowernumber ) %][% UNLESS ( borrowers ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
+        [% UNLESS ( patron.borrowernumber ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %]
 
         // On-site checkout
         function toggle_onsite_checkout(){
     </script>
     [% INCLUDE 'str/members-menu.inc' %]
     [% Asset.js("js/members-menu.js") | $raw %]
+    [% Asset.js("js/recalls.js") | $raw %]
 [% END %]
 
 [% INCLUDE 'intranet-bottom.inc' %]