Bug 12461 - Add patron clubs feature
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / circulation.tt
index d8d2943..c0a6572 100644 (file)
@@ -5,9 +5,6 @@
 [% USE ColumnsSettings %]
 [% USE ItemTypes %]
 [% USE Price %]
-[% IF Koha.Preference('ExportRemoveFields') OR Koha.Preference('ExportWithCsvProfile') %]
-   [% SET exports_enabled = 1 %]
-[% END %]
 [% USE AuthorisedValues %]
 [% INCLUDE 'doc-head-open.inc' %]
 [% SET destination = "circ" %]
@@ -38,7 +35,7 @@ var interface = "[% interface %]";
 var theme = "[% theme %]";
 var borrowernumber = "[% borrowernumber %]";
 var branchcode = "[% branch %]";
-var exports_enabled = "[% exports_enabled %]";
+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";
@@ -97,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() {
@@ -241,7 +245,11 @@ $(document).ready(function() {
 [% 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 ) %]
@@ -279,7 +287,7 @@ $(document).ready(function() {
 [% END %]
 
 [% IF PREVISSUE %]
-    <li>This item has previously been checked out to this patron.  Check out anyway?</li>
+    <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 %]
@@ -602,7 +610,7 @@ No patron matched <span class="ex">[% message | html %]</span>
     [% 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>
 
     <div id="show-checkout-settings">
         <a href="#"><i class="fa fa-caret-right checkout-settings-icon"></i> Checkout settings</a>
@@ -625,7 +633,7 @@ No patron matched <span class="ex">[% message | html %]</span>
                     [% ELSE %]
                         <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" />
                     [% 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>
+                    <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 %]
@@ -778,10 +786,10 @@ No patron matched <span class="ex">[% message | html %]</span>
                     </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>
@@ -856,19 +864,21 @@ No patron matched <span class="ex">[% message | html %]</span>
                         <span class="circ-hlt">
                     [% ELSE %]
                         <span>
-                    [% END %]>
+                    [% END %]
                         [% message.message_date | $KohaDates %]
                         [% Branches.GetName( message.branchcode ) %]
-                        ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% message.manager_id %]">[% message.get_column('manager_firstname') %] [% message.get_column('manager_surname') %]</a> )
+                        [% 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 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>]
+                        <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" data-toggle="modal"><i class="fa fa-plus"></i> Add a new message</a>
+        <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>
@@ -885,6 +895,16 @@ No patron matched <span class="ex">[% message | html %]</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 %]
@@ -933,6 +953,12 @@ No patron matched <span class="ex">[% message | html %]</span>
     </div>
 [% END %]
 
+[% IF CAN_user_clubs && ( enrollable || enrollments ) %]
+    <div id="clubs-tab">
+        Loading...
+    </div>
+[% END %]
+
 [% INCLUDE borrower_debarments.inc %]
 
 <div id="reserves">
@@ -999,15 +1025,29 @@ No patron matched <span class="ex">[% message | html %]</span>
 [% 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 and borrower %]<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>
@@ -1015,5 +1055,7 @@ No patron matched <span class="ex">[% message | html %]</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' %]