Bug 6906 - show 'Borrower has previously issued...
[srvgit] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / circulation.tt
index b1e4c9d..9e42153 100644 (file)
@@ -1,6 +1,7 @@
 [% USE Koha %]
 [% USE Branches %]
 [% USE KohaDates %]
+[% USE Categories %]
 [% USE ColumnsSettings %]
 [% USE ItemTypes %]
 [% USE Price %]
@@ -46,7 +47,6 @@ 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.");
 
@@ -91,10 +91,6 @@ $(document).ready(function() {
         }
     });
 
-    $(".clickable").click(function() {
-        window.document.location = $(this).data('url');
-    });
-
     [% IF !( CircAutoPrintQuickSlip == 'clear' ) %]
         // listen submit to trigger qslip on empty checkout
         $('#mainform').bind('submit',function() {
@@ -107,23 +103,6 @@ $(document).ready(function() {
     $("#onsite_checkout").click(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).prop('checked', 'true')
-        }
-    });
-
 });
 
 //]]>
@@ -160,43 +139,6 @@ $(document).ready(function() {
 [% 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 %]
@@ -217,6 +159,10 @@ $(document).ready(function() {
     <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">
 
@@ -318,6 +264,10 @@ $(document).ready(function() {
     <li>High demand item. Loan period shortened to [% HIGHHOLDS.duration %] days (due [% HIGHHOLDS.returndate %]). Check out anyway?</li>
 [% END %]
 
+[% IF PREVISSUE %]
+    <li>This item has previously been checked out to this patron.  Check out anyway?</li>
+[% END %]
+
 [% IF BIBLIO_ALREADY_ISSUED %]
   <li>
     Patron has already checked out another item from this record.
@@ -441,7 +391,7 @@ $(document).ready(function() {
 
 [% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
     [% UNLESS noissues %]
-        <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber %]&borrowernumber=[% borrowernumber %]'"><i class="fa fa-times-circle"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
+        <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>
@@ -551,6 +501,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 %]
@@ -591,41 +545,9 @@ No patron matched <span class="ex">[% message %]</span>
 [% 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" class="table_borrowers">
-        <thead>
-            <tr>
-                <th>Name</th>
-                <th>Cardnumber</th>
-                <th>Category</th>
-                <th>Library</th>
-                <th>Address</th>
-            </tr>
-        </thead>
-        <tbody>
-            [% FOREACH borrower IN borrowers %]
-            <tr class="clickable" data-url="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrower.borrowernumber %]">
-                <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 id="circ_circulation_selectborrower">
+    [% INCLUDE 'circ-patron-search-results.inc' destination = "circ" %]
 </fieldset>
-</form>
 [% ELSE %]
 
 <!-- BARCODE ENTRY -->
@@ -738,7 +660,6 @@ No patron matched <span class="ex">[% message %]</span>
 
           <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 ) %]
@@ -830,7 +751,12 @@ 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 %]
                    [% END %]
 
                    <br/>
@@ -925,6 +851,7 @@ No patron matched <span class="ex">[% message %]</span>
                 [% END %]</li>
             [% END %]
         </ul>
+        <a id="addnewmessageLabel" href="#add_message_form" data-toggle="modal">Add a new message</a>
     </div>
 
 </div>