Bug 15758: Koha::Libraries - Remove GetBranches
[srvgit] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / returns.tt
index 769e4c0..8e1849a 100644 (file)
@@ -2,12 +2,31 @@
 [% USE Branches %]
 [% USE Koha %]
 [% USE Borrowers %]
+[% USE ItemTypes %]
 [% USE AuthorisedValues %]
+[% USE ColumnsSettings %]
+
+[% BLOCK display_bormessagepref %]
+    [% IF ( bormessagepref ) %]
+        <li>Patron notification:
+            [% FOREACH mtt IN bormessagepref.keys %]
+                [%~ IF ( mtt == 'email' ) %] Email[% END ~%]
+                [%~ IF ( mtt == 'phone' ) %] Phone[% END ~%]
+                [%~ IF ( mtt == 'sms' ) %] SMS[% END ~%]
+                [%~ UNLESS loop.last %], [% ELSE %].[% END ~%]
+            [% END %]
+        </li>
+           [% ELSE %]
+        <li>Patron is not notified.</li>
+    [% END %]
+[% END %]
 
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Circulation &rsaquo; Check in [% title |html %]</title>
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
 [% INCLUDE 'doc-head-close.inc' %]
-
+[% INCLUDE 'datatables.inc' %]
+[% INCLUDE 'columns_settings.inc' %]
 [% INCLUDE 'calendar.inc' %]
 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
 [% INCLUDE 'timepicker.inc' %]
@@ -19,17 +38,37 @@ function Dopop(link) {
     $("#barcode").focus();
 }
 $(document).ready(function () {
+    $(".modal").modal({ backdrop: 'static' }).on('shown', function() {
+        $("#barcode").prop("disabled", true);
+    }).on('hidden', function() {
+        $("#barcode").prop("disabled", false).focus();
+    });
 
     [% IF print_slip %]
         Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&amp;biblionumber=[% biblionumber %]');
     [% END %]
 
+    var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %]
+    var returns_table = KohaTable("#checkedintable", {
+            "bFilter":false,
+            "bPaginate":false,
+            "bInfo":false,
+            "bSort":false,
+            "dom": 'B<"clearfix">t',
+            }, columns_settings);
+
     $("#return_date_override").datetimepicker({
-        onClose: function(dateText, inst) { $("#barcode").focus(); },
+        onClose: function(dateText, inst) {
+            if (validate_date(dateText, inst) ) {
+                $("#barcode").focus();
+            }
+        },
         defaultDate: -1,
         hour: 23,
         minute: 59,
         maxDate: 0
+    }).on("change", function(e, value) {
+        if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
     });
     $("#return_date_override").on("blur", function() {
             check_valid_return_date();
@@ -68,13 +107,13 @@ $(document).ready(function () {
             $("#barcode").addClass("alert");
             $("#dropboxmode").show();
 
-            $("#return_date_override_fields :input").attr("disabled", true);
+            $("#return_date_override_fields :input").prop('disabled', true);
             $("#return_date_override").datetimepicker("disable");
         } else {
             $("#barcode").removeClass("alert");
             $("#dropboxmode").hide();
 
-            $("#return_date_override_fields :input").attr("disabled", false);
+            $("#return_date_override_fields :input").prop('disabled', false);
             $("#return_date_override").datetimepicker("enable");
         }
         $("#barcode").focus();
@@ -90,7 +129,7 @@ $(document).ready(function () {
         $("#barcode").focus();
     });
     [% IF(overduecharges) %] $("#barcode").focus(function () {
-        if (($("#exemptcheck").attr("checked") == true) || ($("#dropboxcheck").attr("checked") == true)) {
+        if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
             $("#barcode").addClass("alert");
         } else {
             $("#barcode").removeClass("alert");
@@ -100,11 +139,16 @@ $(document).ready(function () {
         $("#barcode").removeClass("alert");
     });
     [% END %]
+    $('.openWin').on("click",function(e){
+        e.preventDefault();
+        Dopop( $(this).data("url") );
+    });
 });
 //]]>
 </script>
 </head>
 <body id="circ_returns" class="circ">
+<span class="audio-alert-success"></span>
 
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'checkin-search.inc' %]
@@ -117,10 +161,11 @@ $(document).ready(function () {
        <div id="yui-main">
 
 <div class="yui-g">
-[% IF !Koha.Preference('AnonymousPatron') %]
-    [% IF Koha.Preference('OPACPrivacy') %]
-        <div class="dialog alert"><strong>Error:</strong> The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.</div>
-    [% END %]
+
+[% IF 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>
+[% ELSIF NOT Koha.Preference('AnonymousPatron') AND Koha.Preference('OPACPrivacy') %]
+    <div class="dialog alert"><strong>Error:</strong> The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.</div>
 [% END %]
 
 [% IF additional_materials %]
@@ -130,7 +175,12 @@ $(document).ready(function () {
 [% END %]
 
 [% IF ( collectionItemNeedsTransferred ) %]
- <div id="rotating-collection" class="dialog message">This item is part of a rotating collection and needs to be transferred to [% collectionBranch %]</div>
+ <div id="rotating-collection" class="dialog message">
+        <h3>Please transfer item to: [% Branches.GetName( collectionBranch ) %]</h3>
+            <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
+            <p>This item is part of a rotating collection.</p>
+            <p><button type="button" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;branchcode=[% collectionBranch %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button></p>
+</div>
 [% END %]
 
 <!-- Patron has fines -->
@@ -162,11 +212,20 @@ $(document).ready(function () {
 [% END %]
 
 [% IF ( wrongbranch ) %]
-<div class="dialog alert"><h3>Cannot check in</h3><p>This item must be checked in at its home library. <strong>NOT CHECKED IN</strong></p>
-</div>
+    <div class="dialog alert"><h3>Cannot check in</h3>
+        <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
+        </p><strong>NOT CHECKED IN</strong></p>
+        <p>This item must be checked in at following library: <strong>[% Branches.GetName( rightbranch ) %]</strong></p>
+    </div>
 [% END %]
 <!-- case of a mistake in transfer loop -->
-[% IF ( WrongTransfer ) %]<div id="return2" class="dialog message"><!-- WrongTransfer --><h3>Please return <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title |html %]</a> to [% Branches.GetName( TransferWaitingAt ) %]</h3><h3><a href="#" onclick="Dopop('transfer-slip.pl?transferitem=[% itemnumber %]&amp;&amp;branchcode=[% homebranch %]&amp;op=slip'); return true;">Print slip</a> or <a href="/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber %]&amp;canceltransfer=1">Cancel transfer</a></h3>
+[% IF ( WrongTransfer ) %]
+    <div id="return2" class="dialog message">
+        <!-- WrongTransfer -->
+        <h3>Please return item to: [% Branches.GetName( TransferWaitingAt ) %]</h3>
+            <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
+        <button type="submit" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;&amp;branchcode=[% homebranch %]&amp;op=slip"><i class="fa fa-print"></i> Print transfer slip</button>
+        <button class="deny" type="submit" onclick="window.location.href='/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber %]&amp;canceltransfer=1'"><i class="fa fa-times"></i> Cancel transfer</button>
 [% IF ( wborcnum ) %]<h5>Hold for:</h5>
         <ul><li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
             [% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
@@ -181,11 +240,11 @@ $(document).ready(function () {
             <input type="hidden" name="WT-itemNumber" value="[% WrongTransferItem %]" />
             <input type="hidden" name="WT-waitingAt" value="[% TransferWaitingAt %]" />
             <input type="hidden" name="WT-From" value="[% wtransfertFrom %]" />
-            <input type="submit" class="approve" value="Confirm" />
+            <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
             <input type="hidden" name="print_slip" value="0" />
             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
             <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
-            <input type="submit" value="Print slip and confirm" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();" />
+            <button type="submit" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();"><i class="fa fa-print"></i> Print slip and confirm</button>
         <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
         <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
     </form>
@@ -193,68 +252,104 @@ $(document).ready(function () {
 [% END %]
 
 [% IF ( found ) %]
-<!-- found -->
-<!-- case of a reservation found, and display info -->
     [% IF ( waiting ) %]
-       <!-- waiting -->
+        <div id="hold-found1" class="modal fade audio-alert-action">
+            <form method="post" action="returns.pl" class="confirm">
+                <div class="modal-header">
+                    <h3>
+                        Hold found (item is already waiting):
+                        <br/>
+                        <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">
+                            [% itembarcode |html %]: [% title |html %]
+                        </a>
+                    </h3>
+                </div>
+
+                <div class="modal-body">
+                    [% IF ( reservenotes ) %]
+                        <h4>Notes: [% reservenotes %]</h4>
+                    [% END %]
 
-[% IF ( soundon ) %]
-<audio src="[% interface %]/[% theme %]/sound/ending.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio>
-[% END %]
+                    <h4>Hold for:</h4>
 
-<div id="hold-found1" class="dialog message">
-        <h3>Hold found (item is already waiting):  <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber %]">[% title |html %]</a></h3>
-        [% IF ( reservenotes ) %]<h4>Notes: [% reservenotes %]</h4>[% END %]
-        <h4>Hold for:</h4>
-                       <ul>
-            <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
-            <li>[% borstnum %] [% boraddress %]<br />
-                       [% IF ( boraddress2 ) %][% boraddress2 %]<br />[% END %]
-            [% borcity %] [% borzip %]</li>
-           [% IF ( borphone ) %]<li> [% borphone %]</li>[% END %]
-                  [% IF ( boremail ) %]<li><a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a></li>[% END %]
-[% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
-[% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]</ul>
-               [% IF ( transfertodo ) %]
-            <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
-               [% ELSE %]
-               <h4><strong>Hold at</strong> [% destbranchname %]</h4>
-        [% END %]
-        <form method="post" action="returns.pl" class="confirm">
-            <input type="hidden" name="cancel_reserve" value="0" />
-            <input type="submit" class="deny" value="Cancel" onclick="this.form.cancel_reserve.value = 1; this.form.submit();" />
+                    <li>
+                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])
+                    </li>
 
-            <input type="submit" class="approve" value="Confirm" />
+                    <li>
+                        [% borstnum %] [% boraddress %]<br />
+                        [% IF ( boraddress2 ) %]
+                            [% boraddress2 %]<br />
+                        [% END %]
+                        [% borcity %] [% borzip %]
+                    </li>
 
-            <input type="hidden" name="print_slip" value="0" />
-            <input type="submit" value="Print and confirm" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();" />
-            [% FOREACH inputloo IN inputloop %]
-                <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
-                <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
-                <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
-            [% END %]
-                <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
-                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
-                <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
-                <input type="hidden" name="resbarcode" value="[% barcode %]" />
-                <input type="hidden" name="diffBranch" value="[% destbranch %]" />
-                <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
-                <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
-                <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
-
-                <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
-                <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
-                </form>
-       </div>
+                    [% IF ( borphone ) %]
+                        <li> [% borphone %]</li>
+                    [% END %]
+
+                    [% IF ( boremail ) %]
+                        <li><a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a></li>
+                    [% END %]
+
+                    [% IF ( debarred ) %]
+                        <li class="error">Patron is RESTRICTED</li>
+                    [% END %]
+
+                    [% IF ( gonenoaddress ) %]
+                        <li class="error">Patron's address is in doubt</li>
+                    [% END %]
+
+                    [% IF ( transfertodo ) %]
+                        <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) %]</h4>
+                    [% ELSE %]
+                        <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) %]</h4>
+                    [% END %]
+
+                    [% FOREACH inputloo IN inputloop %]
+                        <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
+                        <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
+                        <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
+                    [% END %]
+
+                    <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
+                    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+                    <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
+                    <input type="hidden" name="reserve_id" value="[% reserve_id %]" />
+                    <input type="hidden" name="diffBranch" value="[% destbranch %]" />
+                    <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
+                    <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
+                    <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
+
+                    <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
+                    <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
+                </div>
+
+                <div class="modal-footer">
+                    <input type="hidden" name="cancel_reserve" value="0" />
+
+                    <button type="submit" class="btn approve">
+                        <i class="fa fa-check"></i> Confirm
+                    </button>
+
+                    <input type="hidden" name="print_slip" value="0" />
+                    <button type="submit" class="btn print" onclick="this.form.print_slip.value = 1; this.form.submit();">
+                        <i class="fa fa-print"></i> Print and confirm
+                    </button>
+
+                    <button type="submit" class="btn deny" onclick="this.form.cancel_reserve.value = 1; this.form.submit();">
+                        <i class="fa fa-times"></i> Cancel hold
+                    </button>
+                </div>
+            </form>
+        </div>
     [% END %]
 
     [% IF ( diffbranch ) %]
                <!-- diffbranch -->
-        [% IF ( soundon ) %]
-        <audio src="[% interface %]/[% theme %]/sound/opening.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio>
-        [% END %]
-        <div id="transfer-needed" class="dialog message">
-               <h3>Hold needing transfer found: <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber %]">[% title |html %]</a></h3>
+        <div id="transfer-needed" class="dialog message audio-alert-action">
+            <h3>Hold needing transfer found</h3>
+                <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
                 <h4>Hold for: </h4>
                     <ul>
                         <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
@@ -266,18 +361,18 @@ $(document).ready(function () {
 [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
 [% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]
                     </ul>
-               [% IF ( transfertodo ) %]
-            <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
-               [% ELSE %]
-               <h4><strong>Hold at</strong> [% destbranchname %]</h4>
+        [% IF ( transfertodo ) %]
+            <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) %]</h4>
+        [% ELSE %]
+            <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) %]</h4>
         [% END %]
 
         <form method="post" action="returns.pl" class="confirm">
-            <input type="submit" class="approve" value="Confirm" />
+            <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
             <input type="hidden" name="print_slip" value="0" />
             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
             <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
-            <input type="submit" value="Print slip and confirm" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();" />
+            <button type="submit" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();"><i class="fa fa-print"></i> Print slip and continue</button>
             [% FOREACH inputloo IN inputloop %]
                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
@@ -297,27 +392,23 @@ $(document).ready(function () {
 
     [% IF ( transfer ) %]
     <!-- transfer: item with no reservation, must be returned according to home library circulation rules -->
-       <div id="return1" class="dialog message">
-            <h3>Please return <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title or "item" |html %]</a> to [% Branches.GetName( returnbranch ) %]<br/>( <a href="#" onclick="Dopop('transfer-slip.pl?transferitem=[% itemnumber %]&amp;branchcode=[% returnbranch %]&amp;op=slip'); return true;">Print slip</a> )</h3>
+        <div id="return1" class="dialog message audio-alert-action">
+            <h3>Please return item to: [% Branches.GetName( returnbranch ) %]</h3>
+            <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
+            <p><button type="button" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;branchcode=[% returnbranch %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button></p>
         </div>
-        [% IF ( soundon ) %]
-        <audio src="[% interface %]/[% theme %]/sound/opening.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio>
-        [% END %]
     [% END %]
 
     [% IF ( needstransfer ) %]
        <!-- needstransfer -->
-        [% IF ( soundon ) %]
-        <audio src="[% interface %]/[% theme %]/sound/opening.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio>
-        [% END %]
-    <div id="item-transfer" class="dialog message"><h3> This item needs to be transferred to [% Branches.GetName( returnbranch ) %]</h3>
+    <div id="item-transfer" class="dialog message audio-alert-action"><h3> This item needs to be transferred to [% Branches.GetName( returnbranch ) %]</h3>
     Transfer now?<br />
     <form method="post" action="returns.pl" name="mainform" id="mainform">
     [% IF itemnumber %]
-        <input type="submit" name="dotransfer" value="Yes, Print slip" class="print" onclick="Dopop('transfer-slip.pl?transferitem=[% itemnumber %]&amp;&amp;branchcode=[% returnbranch %]&amp;op=slip'); return true;" />
+        <button type="submit" name="dotransfer" class="print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;&amp;branchcode=[% returnbranch %]&amp;op=slip"><i class="fa fa-print"></i> Yes, print slip</button>
     [% END %]
-       <input type="submit" name="dotransfer" value="Yes" class="submit" />
-       <input type="submit" name="notransfer" value="No" class="submit" />
+       <button type="submit" name="dotransfer" class="submit"><i class="fa fa-check"></i> Yes</button>
+       <button type="submit" name="notransfer" class="submit"><i class="fa fa-times"></i> No</button>
     <input type="hidden" name="tobranch" value="[% returnbranch %]" />
        <input type="hidden" name="transferitem" value="[% itemnumber %]" />
         <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
@@ -336,10 +427,7 @@ $(document).ready(function () {
 
     [% IF ( diffbranch ) %]
        <!-- diffbranch -->
-        [% IF ( soundon ) %]
-        <audio src="[% interface %]/[% theme %]/sound/opening.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio>
-        [% END %]
-        <h3>Item consigned:</h3>
+        <h3 class="audio-alert-action">Item consigned:</h3>
         <table>
         <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title |html %]</a></caption>
         <tr>
@@ -367,87 +455,146 @@ $(document).ready(function () {
     <!-- case of simple return no issue or transfer but with a reservation  -->
     [% IF ( reserved ) %]
        <!--  reserved  -->
+        <div id="hold-found2" class="modal fade audio-alert-action">
+            <form method="post" action="returns.pl" class="confirm">
+                <div class="modal-header">
+                    <h3>
+                        Hold found:
+                        <br/>
+                        <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">
+                            [% itembarcode |html %]: [% title |html %]
+                        </a>
+                </div>
+
+                <div class="modal-body">
+                    [% IF ( reservenotes ) %]
+                        <h4>Notes: [% reservenotes %]</h4>
+                    [% END %]
+                    <h5>Hold for:</h5>
+
+                        <li>
+                            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
+                                [% borsurname %], [% borfirstname %]
+                            </a>
+                            ([% borcnum %])
+                        </li>
+
+                        <li>
+                            [% borstnum %] [% boraddress %]<br />
+                            [% IF ( boraddress2 ) %]
+                                [% boraddress2 %]<br />
+                            [% END %]
+                            [% borcity %] [% borzip %]
+                        </li>
 
-        [% IF ( soundon ) %]
-        <audio src="[% interface %]/[% theme %]/sound/opening.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio>
-        [% END %]
+                        [% IF ( borphone ) %]
+                            <li>[% borphone %]</li>
+                        [% END %]
 
-       <div id="hold-found2" class="dialog message">
-      <h3>Hold found: <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber %]">[% title |html %]</a></h3>
-        [% IF ( reservenotes ) %]<h4>Notes: [% reservenotes %]</h4>[% END %]
-        <h5>Hold for:</h5>
-               <ul>
-            <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
-                [% borsurname %], [% borfirstname %]
-            </a> ([% borcnum %])</li>
-            <li>[% borstnum %] [% boraddress %]<br />
-                       [% IF ( boraddress2 ) %][% boraddress2 %]<br />[% END %]
-                       [% borcity %] [% borzip %]</li>
-            [% IF ( borphone ) %]<li>[% borphone %]</li>[% END %]
-            [% IF ( boremail ) %]<li>[% IF ( transfertodo ) %][% boremail %][% ELSE %]<a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>[% END %]</li>[% END %]
-[% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
-[% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]
-        </ul>
-        [% IF ( transfertodo ) %]
-            <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
-               [% ELSE %]
-               <h4><strong>Hold at</strong> [% destbranchname %]</h4>
-        [% END %]
-        <form method="post" action="returns.pl" class="confirm">
-            <input type="hidden" name="print_slip" value="0" />
-            [% IF ( transfertodo ) %]
-                <input type="submit" class="approve" value="Confirm hold and transfer" />
-                <input type="submit" value="Print slip, transfer, and confirm" class="print" onclick="this.form.print_slip.value = 1; this.form.submit()" />
-            [% ELSE %]
-                <input type="submit" class="approve" value="Confirm hold" />
-                <input type="submit" value="Print slip and confirm" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();" />
-            [% END %]
-                <input type="submit" class="deny" value="Ignore" onclick="$('.dialog:visible').hide('slow'); $('#barcode').focus(); return false;" />
-            [% FOREACH inputloo IN inputloop %]
-       <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
-       <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
-       <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />[% END %]
-            <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
-            <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
-            <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
-            <input type="hidden" name="resbarcode" value="[% barcode %]" />
-            <input type="hidden" name="diffBranch" value="[% destbranch %]" />
-            <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
-            <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
-            <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
-            <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
-            <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
-        </form>
-       </div>
+                        [% IF ( boremail ) %]
+                            <li>
+                                [% IF ( transfertodo ) %]
+                                    [% boremail %]
+                                [% ELSE %]
+                                    <a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>
+                                [% END %]
+                            </li>
+                        [% END %]
+
+                        [% UNLESS ( transfertodo) %]
+                            [% INCLUDE display_bormessagepref %]
+                        [% END %]
+
+                        [% IF ( debarred ) %]
+                            <li class="error">Patron is RESTRICTED</li>
+                        [% END %]
+
+                        [% IF ( gonenoaddress ) %]
+                            <li class="error">Patron's address is in doubt</li>
+                        [% END %]
+
+                    [% IF ( transfertodo ) %]
+                        <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) %]</h4>
+                    [% ELSE %]
+                        <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) %]</h4>
+                    [% END %]
+
+                    <input type="hidden" name="print_slip" value="0" />
+
+
+                    [% FOREACH inputloo IN inputloop %]
+                        <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
+                        <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
+                        <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
+                    [% END %]
+
+                    <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
+                    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+                    <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
+                    <input type="hidden" name="reserve_id" value="[% reserve_id %]" />
+                    <input type="hidden" name="diffBranch" value="[% destbranch %]" />
+                    <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
+                    <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
+                    <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
+                    <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
+                    <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
+                </div>
+
+                <div class="modal-footer">
+                    [% IF ( transfertodo ) %]
+                        <button type="submit" class="btn approve">
+                            <i class="fa fa-check"></i> Confirm hold and transfer
+                        </button>
+                        <button type="submit" class="btn print" onclick="this.form.print_slip.value = 1; this.form.submit()">
+                            <i class="fa fa-print"></i> Print slip, transfer, and confirm
+                        </button>
+                    [% ELSE %]
+                        <button type="submit" class="btn approve">
+                            <i class="fa fa-check"></i> Confirm hold
+                        </button>
+                        <button type="submit" class="btn print" onclick="this.form.print_slip.value = 1; this.form.submit();">
+                            <i class="fa fa-print"></i> Print slip and confirm
+                        </button>
+                    [% END %]
+
+                    <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;">
+                        <i class="fa fa-times"></i> Ignore
+                    </button>
+                </div>
+            </form>
+        </div>
     [% END %]
 [% END %]
 
 [% IF ( errmsgloop ) %]
-    <div class="dialog alert">
+    <div class="dialog alert audio-alert-warning">
         <h3>Check in message</h3>
+        [% IF itembiblionumber %]
+            <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
+        [% END %]
         [% FOREACH errmsgloo IN errmsgloop %]
                     [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
                         <p class="problem">
-                            Not for loan status updated
-                            from
+                            Not for loan status updated.
+                            <br />Old value:
                             [% IF errmsgloo.NotForLoanStatusUpdated.from %]
-                                [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %]
+                                [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %].
                             [% ELSE %]
-                                being available for loan
+                                Available for loan.
                             [% END %]
-                            to
+                            <br />New value:
                             [% IF errmsgloo.NotForLoanStatusUpdated.to %]
-                                [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) %]
+                                [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) %].
                             [% ELSE %]
-                                being available for loan
+                                Available for loan.
                             [% END %]
                         </p>
                     [% END %]
                     [% IF ( errmsgloo.badbarcode ) %]
-                        <p class="problem">No item with barcode: [% errmsgloo.msg %]</p>
+                        <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
                     [% END %]
                     [% IF ( errmsgloo.ispermanent ) %]
-                        <p class="problem">Please return to  [% errmsgloo.msg %]</p>
+                        <p class="problem">Please return item to: [% Branches.GetName( errmsgloo.msg ) %]</p>
                     [% END %]
                     [% IF ( errmsgloo.notissued ) %]
                         <p class="problem">Not checked out.</p>
@@ -460,35 +607,30 @@ $(document).ready(function () {
                         [% IF ( LostItemFeeRefunded ) %]
                             <p class="problem">A refund has been applied to the borrowing patron's account.</p>
                         [% ELSE %]
-                            <p class="problem">Any lost item fees for this item will remain on the patron's account</p>
+                            <p class="problem">Any lost item fees for this item will remain on the patron's account.</p>
                         [% END %]
                     [% END %]
                     [% IF ( errmsgloo.withdrawn ) %]
                         [% IF BlockReturnOfWithdrawnItems %]
                            <h5>Cannot check in</h5>
-                           <p class="problem">Item is withdrawn. <strong>NOT CHECKED IN</strong></p>
+                           <p><strong>NOT CHECKED IN</strong></p>
+                           <p class="problem">Item is withdrawn.</p>
                         [% ELSE %]
                            <p class="problem">Item is withdrawn.</p>
                         [% END %]
                     [% END %]
                     [% IF ( errmsgloo.debarred ) %]
-                        <p class="problem"><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% errmsgloo.debarborrowernumber %]">[% errmsgloo.debarname %]([% errmsgloo.debarcardnumber %])</a> is now debarred until [% errmsgloo.debarred | $KohaDates %] </p>
+                        <p class="problem"><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% errmsgloo.debarborrowernumber %]">[% errmsgloo.debarname %]([% errmsgloo.debarcardnumber %])</a> is now debarred until [% errmsgloo.debarred | $KohaDates %].</p>
                     [% END %]
                     [% IF ( errmsgloo.prevdebarred ) %]
-                        <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %]</p>
+                        <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %].</p>
                     [% END %]
                     [% IF ( errmsgloo.foreverdebarred ) %]
-                        <p class="problem"><b>Reminder: </b>Patron has an indefinite restriction</p>
+                        <p class="problem"><b>Reminder: </b>Patron has an indefinite restriction.</p>
                     [% END %]
 
             [% END %]
-[% IF ( soundon ) %]
-<audio src="[% interface %]/[% theme %]/sound/critical.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio>
-[% END %]
         [% ELSE %]
-[% IF ( soundon ) %]
-<audio src="[% interface %]/[% theme %]/sound/beep.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio>
-[% END %]
         [% END %]
     </div>
 
@@ -591,7 +733,7 @@ $(document).ready(function () {
 [% IF ( riloop ) %]
     <h2>Checked-in items</h2>
     <table id="checkedintable">
-    <tr><th class="ci-duedate">Due date</th><th class="ci-title">Title</th><th class="ci-author">Author</th><th class="ci-barcode">Barcode</th><th class="ci-homelibrary">Home library</th><th class="ci-holdinglibrary">Holding library</th><th class="ci-shelvinglocation">Shelving location</th><th class="ci-callnumber">Call number</th><th class="ci-type">Type</th><th class="ci-patron">Patron</th><th class="ci-note">Note</th></tr>
+    <thead><tr><th class="ci-duedate">Due date</th><th class="ci-title">Title</th><th class="ci-author">Author</th><th class="ci-barcode">Barcode</th><th class="ci-homelibrary">Home library</th><th class="ci-holdinglibrary">Holding library</th><th class="ci-shelvinglocation">Shelving location</th><th class="ci-callnumber">Call number</th><th class="ci-dateaccessioned">Date acquired</th><th class="ci-type">Type</th><th class="ci-patron">Patron</th><th class="ci-note">Note</th></tr></thead>
 
         [% FOREACH riloo IN riloop %]
             <tr>
@@ -604,21 +746,30 @@ $(document).ready(function () {
                 [% END %]
             </td>
             <td class="ci-title"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber %]">
-                    [% riloo.itemtitle |html %]</a></td>
+                    [% riloo.itemtitle |html %]
+                </a>
+                [% IF ( riloo.enumchron ) %]
+                    <br/>
+                    <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron %]</span>
+                [% END %]
+            </td>
             <td class="ci-author">[% riloo.itemauthor %]</td>
             <td class="ci-barcode"><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% riloo.itembiblionumber %]&amp;itemnumber=[% riloo.itemnumber %]#item[% riloo.itemnumber %]">[% riloo.barcode %]</a></td>
-            <td class="ci-homelibrary">[% riloo.homebranch %]</td>
-            <td class="ci-holdinglibrary">[% riloo.holdingbranch %]</td>
+            <td class="ci-homelibrary">[% Branches.GetName( riloo.homebranch ) %]</td>
+            <td class="ci-holdinglibrary">[% Branches.GetName( riloo.holdingbranch ) %]</td>
             <td class="ci-shelvinglocation">[% riloo.location %]</td>
             <td class="ci-callnumber">[% riloo.itemcallnumber %]</td>
-            <td class="ci-type">[% riloo.itemtype %] [% riloo.ccode %]</td>
+            <td class="ci-dateaccessioned">[% riloo.dateaccessioned | $KohaDates %]</td>
+            <td class="ci-type">[% ItemTypes.GetDescription( riloo.itemtype ) %] [% AuthorisedValues.GetByCode('CCODE', riloo.ccode) %]</td>
             <td class="ci-patron">[% IF ( riloo.duedate ) %]
                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% riloo.borrowernumber %]">
                     [% riloo.borsurname %], [% riloo.borfirstname %] ([% riloo.borcategorycode %])
                 </a>
             [% ELSE %]Not checked out[% END %]</td>
-            <td class="ci-note">[% IF ( riloo.bornote ) %]<span class="circ-hlt">[% riloo.bornote %]<br /></span>[% END %]
-            [% IF ( riloo.itemnote ) %]<span class="circ-hlt">[% riloo.itemnote %]</span>[% END %]
+            <td class="ci-note">
+                [% IF ( riloo.bornote ) %]<p><span class="circ-hlt patron-note">[% riloo.bornote %]</p></span>[% END %]
+                [% IF ( riloo.itemnote ) %]<p><span class="circ-hlt item-note-public">[% riloo.itemnote %]</p></span>[% END %]
+                [% IF ( riloo.itemnotes_nonpublic ) %]<p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic %]</p></span>[% END %]
             </td>
            </tr>
         [% END %]