Bug 12461 - Add patron clubs feature
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / circulation.tt
index 92bf41e..c0a6572 100644 (file)
@@ -1,23 +1,22 @@
 [% USE Koha %]
 [% USE Branches %]
 [% USE KohaDates %]
+[% USE Categories %]
 [% USE ColumnsSettings %]
 [% USE ItemTypes %]
-[% IF Koha.Preference('ExportRemoveFields') OR Koha.Preference('ExportWithCsvProfile') %]
-   [% SET exports_enabled = 1 %]
-[% END %]
+[% USE Price %]
 [% USE AuthorisedValues %]
 [% INCLUDE 'doc-head-open.inc' %]
 [% SET destination = "circ" %]
 <title>Koha &rsaquo; Circulation
-[% IF borrowernumber %]
+[% IF borrowernumber and borrower%]
   &rsaquo; Checking out to [% INCLUDE 'patron-title.inc' invert_name = 1 %]
 [% END %]
 </title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
 
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
 [% INCLUDE 'strings.inc' %]
 [% INCLUDE 'datatables.inc' %]
 [% INCLUDE 'columns_settings.inc' %]
@@ -25,9 +24,9 @@
 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
 [% INCLUDE 'timepicker.inc' %]
 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping.js"></script>
-<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
-<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script>
-<script type="text/javascript" src="[% themelang %]/js/holds.js"></script>
+<script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/circulation.js"></script>
+<script type="text/javascript" src="[% interface %]/[% theme %]/js/checkouts.js"></script>
+<script type="text/javascript" src="[% interface %]/[% theme %]/js/holds.js"></script>
 <script type="text/javascript">
 //<![CDATA[
 /* Set some variable needed in circulation.js */
@@ -36,8 +35,8 @@ var interface = "[% interface %]";
 var theme = "[% theme %]";
 var borrowernumber = "[% borrowernumber %]";
 var branchcode = "[% branch %]";
-var exports_enabled = "[% exports_enabled %]";
-var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && AllowRenewalLimitOverride)? 1: 0 %];
+var exports_enabled = "[% Koha.Preference('ExportCircHistory') %]";
+var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 %];
 var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 %];
 var script = "circulation";
 var relatives_borrowernumbers = new Array();
@@ -45,12 +44,12 @@ var relatives_borrowernumbers = new Array();
     relatives_borrowernumbers.push("[% b %]");
 [% END %]
 
-var MSG_ADD_MESSAGE = _("Add a new message");
 var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
+var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone.");
 
-columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ).raw %]
+columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %]
 
-[% IF ( borrowernumber ) %]
+[% IF borrowernumber and borrower %]
     if($.cookie("holdfor") != [% borrowernumber %]){
         $.removeCookie("holdfor", { path: '/' });
     }
@@ -62,16 +61,22 @@ columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues
 
 // On-site checkout
 function toggle_onsite_checkout(){
-    if ( $("#onsite_checkout").attr('checked') ) {
+    if ( $("#onsite_checkout").prop('checked') ) {
         $("#duedatespec").val("[% todaysdate | $KohaDates with_hours => 1%]")
         [% IF !Koha.Preference('SpecifyDueDate') %]
             $("#duedatespec").datetimepicker('destroy');
         [% END %]
     } else {
         $("#duedatespec").datetimepicker({
-            onClose: function(dateText, inst) { $("#barcode").focus(); },
+            onClose: function(dateText, inst) {
+                if (validate_date(dateText, inst) ) {
+                    $("#barcode").focus();
+                }
+            },
             hour: 23,
             minute: 59
+        }).on("change", function(e, value) {
+            if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
         });
     }
 }
@@ -89,6 +94,13 @@ $(document).ready(function() {
         }
     });
 
+    if ( $('#clubs-tab').length ) {
+        $('#clubs-tab-link').on('click', function() {
+            $('#clubs-tab').text(_("Loading..."));
+            $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber %]');
+        });
+    }
+
     [% IF !( CircAutoPrintQuickSlip == 'clear' ) %]
         // listen submit to trigger qslip on empty checkout
         $('#mainform').bind('submit',function() {
@@ -102,20 +114,11 @@ $(document).ready(function() {
         toggle_onsite_checkout();
     });
 
-    var table = $("#table_borrowers").dataTable($.extend(true, {}, dataTablesDefaults, {
-        "aoColumnDefs": [
-            { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
-        ],
-        "aaSorting": [ 2, "asc" ],
-        "sDom": "t",
-        "iDisplayLength": -1
-    }));
-    $(table).find('tbody tr').filter(':has(:radio:checked)').end().click(function(event) {
-        $('#table_borrowers tbody tr').removeClass('selected');
-        $(this).addClass('selected');
-        if (event.target.type !== 'radio') {
-            $(':radio', this).attr('checked', 'true')
-        }
+    $("#suspend_until").datepicker({
+        onClose: function(dateText, inst) {
+            validate_date(dateText, inst);
+        },
+        minDate: 1, // require that hold suspended until date is after today
     });
 
 });
@@ -129,7 +132,7 @@ $(document).ready(function() {
 [% 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 ) %]
+[% IF borrowernumber and borrower %]
     <a href="/cgi-bin/koha/circ/circulation.pl">Checkouts</a> &rsaquo; [% INCLUDE 'patron-title.inc' %]
 [% ELSE %]
     <strong>Checkouts</strong>
@@ -149,48 +152,11 @@ $(document).ready(function() {
        <div class="yui-b">
 [% END %]
 
-[% IF ( borrowernumber ) %]
+[% IF borrowernumber and borrower %]
 [% INCLUDE 'members-toolbar.inc' %]
 [% END %]
 
 <!--  INITIAL BLOC : PARAMETERS & BORROWER INFO -->
-<div style="display: none;" id="add_message_form">
-<form method="post" action="/cgi-bin/koha/circ/add_message.pl" id="message_form" name="message_f">
-<fieldset id="borrower_messages" class="brief">
-<legend>Leave a message</legend>
-       <ol>
-    <li>
-            <label for="message_type">Add a message for:</label>
-          <select name="message_type" id="message_type">
-            <option value="L">Staff - Internal note</option>
-            <option value="B">OPAC - [% firstname %] [% surname %]</option>
-        </select>
-    </li>
-    [% IF ( canned_bor_notes_loop ) %]
-        <li>
-                <label for="type">Predefined notes: </label>
-                <select name="type" id="type" onchange="this.form.borrower_message.value=this.options[this.selectedIndex].value;">
-                    <option value="">Select note</option>
-                    [% FOREACH canned_bor_notes_loo IN canned_bor_notes_loop %]
-                    <option value="[% canned_bor_notes_loo.lib %]">[% canned_bor_notes_loo.lib %]</option>
-                    [% END %]
-                </select>
-        </li>
-    [% END %]
-    <li>
-        <textarea rows="3" cols="60" name="borrower_message" id="borrower_message" ></textarea>
-    </li>
-       </ol>
-    <fieldset class="action">
-        <input type="submit" value="Save" /> <a href="#" class="cancel">Cancel</a>
-    </fieldset>
-
-        <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
-        <input type="hidden" name="branchcode" value="[% branch %]" />
-</fieldset>
-</form>
-</div>
-
 [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% expiry | $KohaDates %]</div>[% END %]
 
 [% IF additional_materials %]
@@ -207,6 +173,14 @@ $(document).ready(function() {
     <div class="dialog message">The patron has unpaid charges for holds, rentals etc of [% alert.OTHER_CHARGES %]</div>
 [% END %]
 
+[% IF alert.HIGHHOLDS %]
+    <div class="dialog message">High demand item. <b>Loan period was not shortened due to override.</b> Shortened due date would have been [% alert.HIGHHOLDS.returndate %] ([% alert.HIGHHOLDS.duration %] days).</div>
+[% END %]
+
+[% IF ( nopermission ) %]
+    <div class="dialog alert">Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.</div>
+[% END %]
+
 [% IF ( NEEDSCONFIRMATION ) %]
 <div class="yui-g">
 
@@ -229,6 +203,11 @@ $(document).ready(function() {
 [% IF ( DEBT ) %]
     <li>The patron has a debt of [% DEBT %].</li>
 [% END %]
+
+[% IF ( DEBT_GUARANTEES ) %]
+    <li>The patron's guarantees collectively have a debt of [% DEBT_GUARANTEES | $Price %].</li>
+[% END %]
+
 [% IF ( RENTALCHARGE && RENTALCHARGE > 0 ) %]
     <li>Rental charge for this item: [% RENTALCHARGE %]</li>
 [% END %]
@@ -238,11 +217,11 @@ $(document).ready(function() {
 [% END %]
 
 [% IF ( RESERVE_WAITING ) %]
-    <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber %]">[% resfirstname %] [% ressurname %]</a> ([% rescardnumber %]) at [% resbranchname %] since [% reswaitingdate | $KohaDates %]</li>
+    <li>Item <i>[% getTitleMessageIteminfo %]</i> ([% getBarcodeMessageIteminfo %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber %]">[% resfirstname %] [% ressurname %]</a> ([% rescardnumber %]) at [% Branches.GetName( resbranchcode ) %] since [% reswaitingdate | $KohaDates %]</li>
 [% 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 [% Branches.GetName( resbranchcode ) %] since [% resreservedate | $KohaDates %]</li>
 [% END %]
 
 [% IF ( ISSUED_TO_ANOTHER ) %]
@@ -262,11 +241,15 @@ $(document).ready(function() {
 [% END %]
 
 [% IF ( BORRNOTSAMEBRANCH ) %]
-    <li>This patron is from a different library ([% BORRNOTSAMEBRANCH %])</li>
+    <li>This patron is from a different library ([% Branches.GetName( BORRNOTSAMEBRANCH ) %])</li>
 [% END %]
 
 [% IF ( PATRON_CANT ) %]
-    <li>This patron can't check out this item per library circulation policy</li>
+    <li>This patron can't check out this item per library circulation policy.</li>
+[% END %]
+
+[% IF ( TOO_MANY and TOO_MANY == 'NO_RULE_DEFINED' ) %]
+    <li>No circulation rule is defined for this patron and itemtype combination.</li>
 [% END %]
 
 [% IF ( NOT_FOR_LOAN_FORCING ) %]
@@ -299,10 +282,14 @@ $(document).ready(function() {
     </li>
 [% END %]
 
-[% IF  HIGHHOLDS %]
+[% IF HIGHHOLDS %]
     <li>High demand item. Loan period shortened to [% HIGHHOLDS.duration %] days (due [% HIGHHOLDS.returndate %]). Check out anyway?</li>
 [% END %]
 
+[% IF PREVISSUE %]
+    <li>Patron has previously checked out this title: <b>[% item.title %] [% IF item.author %] by [% item.author %][% END %]</b>. Check out anyway?</li>
+[% END %]
+
 [% IF BIBLIO_ALREADY_ISSUED %]
   <li>
     Patron has already checked out another item from this record.
@@ -314,16 +301,24 @@ $(document).ready(function() {
 </ul>
 
 [% IF HIGHHOLDS %]
-       <script language="JavaScript" type="text/javascript">
-       $(document).ready(function() {
-            $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate %]');
-            if ('[% duedatespec %]' === '') {
-                $("input[name=restoreduedatespec]:hidden").val('highholds_empty');
-            } else {
-                $("input[name=restoreduedatespec]:hidden").val('[% duedatespec %]');
-            }
-       });
-       </script>
+<script language="JavaScript" type="text/javascript">
+$(document).ready(function() {
+    [% IF !override_high_holds %]
+        $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate %]');
+        if ('[% duedatespec %]' === '') {
+            $("input[name=restoreduedatespec]:hidden").val('highholds_empty');
+        } else {
+            $("input[name=restoreduedatespec]:hidden").val('[% duedatespec %]');
+        }
+    [% END %]
+
+    $("#override_high_holds_tmp").on( 'change', function() {
+        if ( this.checked ) {
+            $("input[name=duedatespec]:hidden").val('');
+        }
+    });
+});
+</script>
 [% END %]
 
 [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
@@ -332,6 +327,13 @@ $(document).ready(function() {
 
 [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
 
+[% IF HIGHHOLDS %]
+    <p class="circ-override-high-holds">
+    <input type="checkbox" name="override_high_holds_tmp" id="override_high_holds_tmp" value="1" />
+    <label for="override_high_holds_tmp">Don't decrease loan length based on holds</label>
+    </p>
+[% END %]
+
 [% IF ( RESERVED ) %]
     <p>
     <input type="checkbox" id="cancelreserve" name="cancelreserve" value="cancel" />
@@ -348,13 +350,14 @@ $(document).ready(function() {
 </p>
 [% END %]
 
-    <input type="hidden" name="barcode" value="[% barcode %]" />
+    <input type="hidden" name="barcode" value="[% barcode |html %]" />
     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
     <input type="hidden" name="issueconfirmed" value="1" />
+    <input type="hidden" name="override_high_holds" value="[% override_high_holds %]"/>
     [% IF ( DEBT ) %]<input type="hidden" name="debt_confirmed" value="1" />[% END %]
     [% IF ( INVALID_DATE ) %]
     <p>
-    <input type="text" size="13" id="duedatespec" name="duedatespec" readonly="readonly" value="[% duedatespec %]" />
+    <input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec %]" />
     <label for="duedatespec">Due date</label>
     </p>
     [% ELSE %]
@@ -363,9 +366,9 @@ $(document).ready(function() {
     <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
     <input type="hidden" name="branch" value="[% branch %]" />
     [% IF ( RENEW_ISSUE ) %]
-    <input type="submit" class="approve" value="Yes, renew (Y)" accesskey="y" />
+    <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, renew (Y)</button>
     [% ELSE %]
-    <input type="submit" class="approve" value="Yes, check out (Y)" accesskey="y" />
+    <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 %]" />
 </form>
@@ -377,7 +380,7 @@ $(document).ready(function() {
     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
     <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
     <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
-    <input class="print" type="submit" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% reserveborrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip');this.form.submit();" value="Don't check out and print slip (P)">
+    <button class="print" type="submit" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% reserveborrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
 </form>
 [% END %]
 
@@ -387,7 +390,7 @@ $(document).ready(function() {
     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
     <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
     <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
-    <input class="print" type="submit" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% reserveborrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip');this.form.submit();" value="Don't check out and print slip (P)">
+    <button class="print" type="submit" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% reserveborrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
 </form>
 [% END %]
 
@@ -399,18 +402,18 @@ $(document).ready(function() {
     <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
     [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
         [% IF ( RENEW_ISSUE ) %]
-        <input type="submit" class="deny" value="No, don't renew (N)" accesskey="n" />
+        <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't renew (N)</button>
         [% ELSE %]
-        <input type="submit" class="deny" value="No, don't check out (N)" accesskey="n" />
+        <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't check out (N)</button>
         [% END %]
     [% ELSE %]
-        <input type="submit" class="deny" value="Continue" />
+        <button type="submit" class="deny"><i class="fa fa-times"></i> Continue</button>
     [% END %]
 </form>
 
 [% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
-    [% UNLESS flagged && noissues %]
-        <div class="circ-checkoutplacehold"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber %]&borrowernumber=[% borrowernumber %]">Click here to place a hold for [% INCLUDE 'patron-title.inc' %]</a></div>
+    [% UNLESS noissues %]
+        <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber %]&borrowernumber=[% borrowernumber %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
     [% END %]
 [% END %]
 </div></div>
@@ -420,6 +423,9 @@ $(document).ready(function() {
 
 <div class="yui-g">
 <div id="circ_impossible" class="dialog alert audio-alert-warning">
+    [% IF ( UNKNOWN_BARCODE ) %]
+        <h3>Barcode not found</h3>
+    [% END %]
 <!-- RESULT OF ISSUING REQUEST -->
         <ul>
         [% IF ( STATS ) %]
@@ -431,10 +437,10 @@ $(document).ready(function() {
         [% END %]
 
         [% IF ( UNKNOWN_BARCODE ) %]
-            <li>The barcode was not found [% barcode %]
+            <li>The barcode was not found: <span class="ex">[% barcode |html %]</span>
            [% IF ( fast_cataloging ) %]
                [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
-            <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&amp;barcode=[% barcode |uri %]&amp;circborrowernumber=[% borrowernumber %]&amp;branch=[% branch %]&amp;duedatespec=[% duedatespec %]&amp;stickyduedate=[% stickyduedate %]">Fast cataloging</a>
+            <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&amp;barcode=[% barcode |uri %]&amp;circborrowernumber=[% borrowernumber %]&amp;branch=[% branch %]&amp;duedatespec=[% duedatespec %]&amp;stickyduedate=[% stickyduedate %]">Add record using fast cataloging</a>
                [% END %]
            [% END %]
 
@@ -451,7 +457,7 @@ $(document).ready(function() {
                         <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
                         <input type="hidden" name="branch" value="[% branch %]" />
                         <input type="hidden" name="barcode" value="[% book.barcode %]" />
-                        <input type="submit" name="x" value="Check out [% book.barcode %]: [% book.title %]" />
+                        <button type="submit" name="x"><i class="fa fa-check"></i> Check out [% book.barcode %]: [% book.title %]</button>
                     </form>
                 [% END %]
             [% ELSE %]
@@ -517,6 +523,10 @@ $(document).ready(function() {
             <li>This item belongs to [% Branches.GetName( itemhomebranch ) %] and cannot be checked out from this location.</li>
         [% END %]
 
+        [% IF RETURN_IMPOSSIBLE %]
+            <li>This item must be returned to [% Branches.GetName( branch_to_return ) %].</li>
+        [% END %]
+
         [% IF ( USERBLOCKEDWITHENDDATE ) %]
             <li>Patron has a restriction until [% USERBLOCKEDWITHENDDATE | $KohaDates %].</li>
         [% END %]
@@ -550,56 +560,21 @@ $(document).ready(function() {
 [% IF ( message ) %]
 [% INCLUDE 'patron-toolbar.inc' %]
 <h4>
-No patron matched <span class="ex">[% message %]</span>
+No patron matched <span class="ex">[% message | html %]</span>
 </h4>
 [% END %]
 
 [% IF ( borrowers ) %]
 [% INCLUDE 'patron-toolbar.inc' %]
 
-<form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
-    <input type="hidden" name="restoreduedatespec" />
-<fieldset id="circ_circulation_selectborrower" class="brief">
-    <legend>Patron selection</legend>
-
-[% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
-    <input type="hidden" name="branch" value="[% branch %]" />
-    <input type="hidden" name="printer" value="[% printer %]" />
-    <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
-    <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
-
-    <table id="table_borrowers">
-        <thead>
-            <tr>
-                <th></th>
-                <th>Name</th>
-                <th>Cardnumber</th>
-                <th>Category</th>
-                <th>Library</th>
-                <th>Address</th>
-            </tr>
-        </thead>
-        <tbody>
-            [% FOREACH borrower IN borrowers %]
-            <tr>
-                <td><input type="radio" name="borrowernumber" value="[% borrower.borrowernumber %]" /></td>
-                <td>[% borrower.surname %], [% borrower.firstname %]</td>
-                <td>[% borrower.cardnumber %]</td>
-                <td>[% borrower.categorycode %]</td>
-                <td>[% borrower.branchcode %]</td>
-                <td>[% borrower.address %]</td>
-            </tr>
-            [% END %]
-        </tbody>
-    </table>
-    <fieldset class="action"><input type="submit" value="Select" /></fieldset>
+<fieldset id="circ_circulation_selectborrower">
+    [% INCLUDE 'circ-patron-search-results.inc' destination = "circ" %]
 </fieldset>
-</form>
 [% ELSE %]
 
 <!-- BARCODE ENTRY -->
 
-[% IF ( borrowernumber ) %]
+[% IF borrowernumber and borrower %]
 <div class="yui-g">
 
 [% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
@@ -607,12 +582,7 @@ No patron matched <span class="ex">[% message %]</span>
 [% END %]
 
 [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
-[% IF ( flagged ) %]
 <div class="yui-u first">
-[% ELSE %]
-<div>
-
-[% END %]
 
 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
     <input type="hidden" name="restoreduedatespec" />
@@ -627,66 +597,95 @@ No patron matched <span class="ex">[% message %]</span>
 
     [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
 
-    <label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
+    <label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
 
-       <div class="hint">Enter item barcode:</div>
+        [% IF Koha.Preference('itemBarcodeFallbackSearch') %]
+            <div class="hint">Enter item barcode or keyword:</div>
+        [% ELSE %]
+            <div class="hint">Enter item barcode:</div>
+        [% 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 %]
-    <button type="submit" class="btn">Check out</button>
+    <button type="submit" class="btn btn-default">Check out</button>
 
-    [% UNLESS flagged and noissues %]
-        <div class="date-select">
-            [% IF NEEDSCONFIRMATION %]
-                <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
-            [% ELSE %]
-                <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" />
-            [% END %]
+    <div id="show-checkout-settings">
+        <a href="#"><i class="fa fa-caret-right checkout-settings-icon"></i> Checkout settings</a>
+    </div>
 
-            <label for="auto_renew">Automatic renewal</label>
-        </div>
-    [% END %]
+    <div class="checkout-settings">
 
-    [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
-        [% IF ( SpecifyDueDate ) %]
-            <div class="date-select">
-                <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
-                [% IF ( duedatespec ) %]
-                    <input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec %]" readonly="readonly" />
+        [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
+            [% IF ( SpecifyDueDate ) %]
+                <div id="specify-due-date" class="checkout-setting">
+                    <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
+                    [% 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 %]
+                    <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 %]
+                    <button class="btn btn-default btn-sm action" id="cleardate" name="cleardate" onclick="this.checked = false; this.form.duedatespec.value = ''; this.form.stickyduedate.checked = false; this.form.barcode.focus(); return false;" >Clear</button>
+                </div>
+            [% END %]
+        [% END %]
+
+        [% UNLESS ( noissues ) %]
+            <div id="set-automatic-renewal" class="checkout-setting">
+                [% IF NEEDSCONFIRMATION %]
+                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
                 [% ELSE %]
-                    <input type="text" size="13" id="duedatespec" name="duedatespec" value="" readonly="readonly" />
+                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" />
                 [% END %]
-                <label for="stickyduedate"> Remember for session:</label>
-                [% IF ( stickyduedate ) %]
-                    <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
+
+                <label for="auto_renew">Automatic renewal</label>
+            </div>
+            [% IF Koha.Preference('decreaseLoanHighHolds') %]
+                <div id="set_high_holds_overrride" class="checkout-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 %]
+                    [% ELSE %]
+                        [% IF override_high_holds %]
+                            <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" checked="checked" />
+                        [% ELSE %]
+                            <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" />
+                        [% END %]
+                    [% 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="checkout-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 %]
-                    <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" />
+                    <input type="checkbox" id="onsite_checkout" name="onsite_checkout" /> <label for="onsite_checkout">On-site checkout</label>
                 [% END %]
-                <button class="btn btn-small action" id="cleardate" name="cleardate" onclick="this.checked = false; this.form.duedatespec.value = ''; this.form.stickyduedate.checked = false; this.form.barcode.focus(); return false;" >Clear</button>
             </div>
         [% END %]
-    [% END %]
 
-    [% IF Koha.Preference('OnSiteCheckouts') %]
-        <div class="onsite_checkout-select">
-            [% 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" readonly="readonly" />
-                    <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
-                </div>
-            [% ELSE %]
-                <input type="checkbox" id="onsite_checkout" name="onsite_checkout" /> <label for="onsite_checkout">On-site checkout</label>
-            [% END %]
-        </div>
-    [% END %]
+    </div> <!-- /.checkout-settings -->
 
           <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" />
           <input type="hidden" name="branch" value="[% branch %]" />
-          <input type="hidden" name="printer" value="[% printer %]" />
           <input type="hidden" name="print" value="maybe" />
           <input type="hidden" name="debt_confirmed" value="[% debt_confirmed %]" />
                 [% IF ( CHARGES ) %]
@@ -713,7 +712,6 @@ No patron matched <span class="ex">[% message %]</span>
     <div class="yui-u">
 [% END %]
 
-    [% IF flagged %]
         [% IF ( noissues ) %]
             [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
                 <div id="circmessages" class="circmessage attention">
@@ -734,6 +732,14 @@ No patron matched <span class="ex">[% message %]</span>
 
                <ul>
 
+                   [% IF ( has_modifications ) %]
+                    <li><span class="circ-hlt">Pending modifications:</span> Patron has pending modifications.
+                            [% IF CAN_user_borrowers && ( !Koha.Preference('IndependentBranchesPatronModifications') || borrower.branch == branch ) %]
+                                    <a href="/cgi-bin/koha/members/members-update.pl">View all pending patron modifications</a>
+                            [% END %]
+                   </li>
+                  [% END %]
+
                        [% 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;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>
@@ -771,37 +777,48 @@ No patron matched <span class="ex">[% message %]</span>
                    [% END %]
 
                    [% IF ( debarredcomment ) %]
-                       with the explanation: <br/><i>[% debarredcomment | html_line_break %]</i>
+                       with the explanation: <br/><i>
+                          [% IF debarredcomment.search('OVERDUES_PROCESS') %]
+                              Restriction added by overdues process [% debarredcomment.remove('OVERDUES_PROCESS ') | html_line_break %]
+                          [% ELSE %]
+                              [% debarredcomment | html_line_break %]
+                          [% END %]
+                    </i>
                    [% END %]
-
                    <br/>
-                   <a class="btn btn-small" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
+                   <a class="btn btn-default btn-sm" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
                     [% IF (noissues && borrowernumber && CAN_user_circulate_force_checkout) %]
                         <span class="override_debarment">
-                            <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% borrowernumber %]" class="btn btn-small">Override restriction temporarily</a>
+                            <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% borrowernumber %]" class="btn btn-default btn-sm">Override restriction temporarily</a>
                         </span>
                     [% END %]
                </li>
             [% END %]
 
-                [% IF ( odues ) %]<li>[% IF ( nonreturns ) %]<span class="circ-hlt">Overdues: Patron has ITEMS OVERDUE</span>. See highlighted items <a href="#checkouts">below</a>[% END %]</li>
+                [% IF ( odues ) %]<li>[% IF ( nonreturns ) %]<span class="circ-hlt">Overdues: Patron has ITEMS OVERDUE.</span> <a href="#checkouts">See highlighted items below</a>[% END %]</li>
             [% END %]
 
-               [% IF ( charges ) %]
-                           <li>
-            <span class="circ-hlt">Fees &amp; Charges:</span> Patron has  <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Outstanding fees &amp; charges[% IF ( chargesamount ) %] of [% chargesamount %][% END %]</a>.
-                [% IF ( charges_is_blocker ) %]
-                    <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
-                [% END %]
-            <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]">Make payment</a> or
-            <a href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% borrowernumber %]">Pay all fines</a></li>
-                       [% END %]
+            [% IF ( charges ) %]
+                [% INCLUDE 'blocked-fines.inc'
+                    fines = chargesamount
+                %]
+            [% END %]
 
-               [% IF ( credits ) %]
-                       <li>
-                <span class="circ-hlt">Credits:</span> Patron has a credit[% IF ( creditsamount ) %] of [% creditsamount %][% END %]
-            </li>
-                       [% END %]
+            [% IF ( charges_guarantees ) %]
+                <li>
+                    <span class="circ-hlt">Fees &amp; Charges:</span> Patron's guarantees collectively owe [% chargesamount_guarantees %].
+                        [% IF ( charges_guarantees_is_blocker ) %]
+                            <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
+                        [% END %]
+                </li>
+            [% END %]
+
+
+            [% IF ( credits ) %]
+                <li>
+                    <span class="circ-hlt">Credits:</span> Patron has a credit[% IF ( creditsamount ) %] of [% creditsamount %][% END %]
+                </li>
+            [% END %]
 
                        </ul>
         </div>
@@ -812,16 +829,16 @@ No patron matched <span class="ex">[% message %]</span>
                     [% FOREACH w IN WaitingHolds %]
                         <ul>
                             <li>
-                                <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% w.biblio.biblionumber %]">[% w.biblio.title %]</a>
+                                <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% w.biblio.biblionumber %]">[% w.biblio.title | html %]</a>
                                 ([% ItemTypes.GetDescription( w.item.effective_itemtype ) %]),
-                                [% IF ( w.biblio.author ) %] by [% w.biblio.author %] [% END %]
+                                [% IF ( w.biblio.author ) %] by [% w.biblio.author | html %] [% END %]
                                 [% IF ( w.item.itemcallnumber ) %] [[% w.item.itemcallnumber %]] [% END %]
                                 Hold placed on [% w.reservedate | $KohaDates %].
 
                                 <br/>
                                 [% IF ( w.branch.branchcode == Branches.GetLoggedInBranchcode()  ) %]<strong class="waitinghere">[% ELSE %]<strong>[% END %]
                                     [% SET waiting_expires_on = w.waiting_expires_on %]
-                                    Waiting at [% w.branch.branchname %] [% IF waiting_expires_on %] until [% waiting_expires_on | $KohaDates %] [% END %]
+                                    Waiting at [% w.branch.branchname | html %] [% IF waiting_expires_on %] until [% waiting_expires_on | $KohaDates %] [% END %]
                                 </strong>
                             </li>
                         </ul>
@@ -838,38 +855,32 @@ No patron matched <span class="ex">[% message %]</span>
 
     <!-- /If notes -->[% END %]
 
-       <div id="messages" class="circmessage">
-               <h4>Messages:</h4>
-               <ul>
-                       [% FOREACH lib_messages_loo IN lib_messages_loop %]
-                               <li>
-                                       <span class="circ-hlt">
-                                               [% lib_messages_loo.message_date_formatted %]
-                                               [% lib_messages_loo.branchcode %]
-                                               <i>"[% lib_messages_loo.message %]"</i>
-                                       </span>
-                                       [% IF ( lib_messages_loo.can_delete ) %]
-                                               <a href="/cgi-bin/koha/circ/del_message.pl?message_id=[% lib_messages_loo.message_id %]&amp;borrowernumber=[% lib_messages_loo.borrowernumber %]">[Delete]</a>
-                                       [% ELSE %]
-                                               [% IF ( all_messages_del ) %]
-                                                       <a href="/cgi-bin/koha/circ/del_message.pl?message_id=[% lib_messages_loo.message_id %]&amp;borrowernumber=[% lib_messages_loo.borrowernumber %]">[Delete]</a>
-                                               [% END %]
-                                       [% END %]
-                               </li>
-                       [% END %]
-                       [% FOREACH bor_messages_loo IN bor_messages_loop %]
-                               <li><span class="">[% bor_messages_loo.message_date_formatted %] [% bor_messages_loo.branchcode %] <i>"[% bor_messages_loo.message %]"</i></span> [% IF ( bor_messages_loo.can_delete ) %]<a href="/cgi-bin/koha/circ/del_message.pl?message_id=[% bor_messages_loo.message_id %]&amp;borrowernumber=[% bor_messages_loo.borrowernumber %]">[Delete]</a>
-                [% ELSIF ( all_messages_del ) %]
-                    <a href="/cgi-bin/koha/circ/del_message.pl?message_id=[% bor_messages_loo.message_id %]&amp;borrowernumber=[% bor_messages_loo.borrowernumber %]">[Delete]</a>
-                [% END %]</li>
-                       [% END %]
-
-               </ul>
-       </div>  
-       
-     <!-- /If flagged -->[% END %]
+    <div id="messages" class="circmessage">
+        <h4>Messages:</h4>
+        <ul>
+            [% FOREACH message IN messages %]
+                <li>
+                    [% IF(message.message_type == "L") %]
+                        <span class="circ-hlt">
+                    [% ELSE %]
+                        <span>
+                    [% END %]
+                        [% message.message_date | $KohaDates %]
+                        [% Branches.GetName( message.branchcode ) %]
+                        [% IF message.manager_id %]
+                            ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% message.manager_id %]">[% message.get_column('manager_firstname') %] [% message.get_column('manager_surname') %]</a> )
+                        [% END %]
+                        <i>"[% message.message %]"</i>
+                    </span>
+                    [% IF message.branchcode == branch OR Koha.Preference('AllowAllMessageDeletion') %]
+                        <a class="btn btn-link btn-sm" href="/cgi-bin/koha/circ/del_message.pl?message_id=[% message.message_id %]&amp;borrowernumber=[% message.borrowernumber %]" onclick="return confirm(MSG_CONFIRM_DELETE_MESSAGE);"><i class="fa fa-trash"></i> Delete</a>
+                    [% END %]
+                </li>
+            [% END %]
+        </ul>
+        <a id="addnewmessageLabel" href="#add_message_form" class="btn btn-link btn-sm" data-toggle="modal"><i class="fa fa-plus"></i> Add a new message</a>
+    </div>
 
-       
 </div>
 </div>
 
@@ -884,6 +895,16 @@ No patron matched <span class="ex">[% message %]</span>
         [% END %]
     </li>
 
+    [% SET enrollments = patron.get_club_enrollments.size || 0 %]
+    [% SET enrollable  = patron.get_enrollable_clubs.size || 0 %]
+    [% IF CAN_user_clubs && ( enrollable || enrollments ) %]
+        <li>
+            <a id="clubs-tab-link" href="#clubs-tab">
+                Clubs ([% enrollments %]/[% enrollable %])
+            </a>
+        </li>
+    [% END %]
+
     [% IF relatives_issues_count %]
         <li><a id="relatives-issues-tab" href="#relatives-issues">Relatives' checkouts</a></li>
     [% END %]
@@ -894,6 +915,13 @@ No patron matched <span class="ex">[% message %]</span>
         [% ELSE %]
             <a href="#reserves" id="holds-tab">0 Holds</a>
         [% END %]
+    </li>
+
+    [% IF Koha.Preference('ArticleRequests') %]
+        <li>
+            <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count %] Article requests</a>
+        </li>
+    [% END %]
 
     <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.size %] Restrictions</a></li>
 </ul>
@@ -925,6 +953,12 @@ No patron matched <span class="ex">[% message %]</span>
     </div>
 [% END %]
 
+[% IF CAN_user_clubs && ( enrollable || enrollments ) %]
+    <div id="clubs-tab">
+        Loading...
+    </div>
+[% END %]
+
 [% INCLUDE borrower_debarments.inc %]
 
 <div id="reserves">
@@ -961,7 +995,7 @@ 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" class="datepicker" />
+            <input type="text" size="10" id="suspend_until" name="suspend_until datepicker" />
             <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
              [% END %]
         </form>
@@ -982,18 +1016,38 @@ No patron matched <span class="ex">[% message %]</span>
 [% END %]
 </div> <!-- reservesloop -->
 
-[% END %] <!-- borrowernumber -->
-</div></div>
+[% IF Koha.Preference('ArticleRequests') %]
+    [% INCLUDE 'patron-article-requests.inc' %]
 [% END %]
 
+[% ELSIF borrowernumber %]
+    <div class="dialog message">This patron does not exist. <a href="/cgi-bin/koha/members/members-home.pl">Find another patron?</a></div>
+[% END %] <!-- borrowernumber and borrower-->
+</div></div>
+[% END %]
+[% IF Koha.Preference('CircSidebar') %]
+[% UNLESS ( borrowers ) %]
+    [% IF not( borrowernumber and borrower ) %]
+        <div class="yui-b noprint">
+            [% INCLUDE 'circ-nav.inc' %]
+        </div>
+    [% END %]
+[% END %]
+[% END %]
 </div>
 </div>
-[% UNLESS ( borrowers ) %][% IF ( borrowernumber ) %]<div class="yui-b">
-[% INCLUDE 'circ-menu.inc' %]
-</div>[% END %][% END %]
+[% UNLESS ( borrowers ) %]
+    [% IF borrowernumber and borrower %]
+        <div class="yui-b">
+            [% INCLUDE 'circ-menu.inc' %]
+        </div>
+    [% END %]
+[% END %]
 </div>
 <!-- Modal -->
-<div id="barcodeSubmittedModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true">
+<div id="barcodeSubmittedModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true">
+    <div class="modal-dialog">
+    <div class="modal-content">
     <div class="modal-header">
         <h3 id="barcodeSubmittedModalLabel">Barcode submitted</h3>
     </div>
@@ -1001,5 +1055,7 @@ No patron matched <span class="ex">[% message %]</span>
     <div class="modal-body">
         <p>You have already submitted a barcode, please wait for the checkout to process...</p>
     </div>
+    </div>
+    </div>
 </div>
 [% INCLUDE 'intranet-bottom.inc' %]