Bug 28975: (QA follow-up) Fix indentation, simplify if statement
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / members-toolbar.inc
1 [% INCLUDE 'blocking_errors.inc' %]
2 [% USE Koha %]
3 [% USE Branches %]
4 [% USE Categories %]
5 [% USE AuthorisedValues %]
6 [% USE scalar %]
7 <div id="toolbar" class="btn-toolbar">
8     [% IF CAN_user_borrowers_edit_borrowers %]
9         <a id="editpatron" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% patron.borrowernumber | html %]"><i class="fa fa-pencil"></i> Edit</a>
10     [% END %]
11
12     [% IF CAN_user_borrowers_edit_borrowers %]
13         [% IF patron.is_adult AND Koha.Preference("borrowerRelationship") %]
14             <a id="addchild" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantor_id=[% patron.borrowernumber | html %]"><i class="fa fa-plus"></i> Add guarantee</a>
15         [% END %]
16         <a id="changepassword" class="btn btn-default" href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber | html %]"><i class="fa fa-lock"></i> Change password</a>
17         <a id="duplicate" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=[% patron.borrowernumber | html %]"><i class="fa fa-copy"></i> Duplicate</a>
18     [% END %]
19
20     [% IF CAN_user_circulate_circulate_remaining_permissions %]
21     <div class="btn-group">
22         <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-print"></i> Print <span class="caret"></span></button>
23             <ul class="dropdown-menu">
24                 <li><a id="printsummary" href="#">Print summary</a></li>
25                 <li><a id="printslip" href="#">Print slip</a></li>
26                 <li><a id="printquickslip" href="#">Print quick slip</a></li>
27                 [% IF patron.account_balance != 0 %]
28                 <li><a id="printfineslip" target="_blank" href="/cgi-bin/koha/members/printnotice.pl?notice=ACCOUNTS_SUMMARY&borrowernumber=[% patron.borrowernumber | uri %]">Print account balance</a></li>
29                 [% END %]
30                 [% IF patron.has_overdues %]
31                     <li><a id="print_overdues" href="#">Print overdues</a></li>
32                 [% END %]
33                 <li><a id="printcheckinslip" href="#">Print checkin slip</a></li>
34             </ul>
35     </div>
36     [% END %]
37
38     [% IF ( CAN_user_reserveforothers ) %]
39         <a id="searchtohold" class="btn btn-default" href="#"><i class="fa fa-search"></i> Search to hold</a>
40     [% END %]
41
42     <a id="addnewmessageLabel" href="#add_message_form" data-toggle="modal" class="btn btn-default"><i class="fa fa-comment-o"></i> Add message</a>
43
44     [% IF Koha.Preference('CurbsidePickup') %]
45         <a id="curbsidePickupLabel" href="/cgi-bin/koha/circ/curbside_pickups.pl?op=find-patron&borrowernumber=[% patron.borrowernumber | html %]" class="btn btn-default"><i class="fa fa-refresh"></i> Schedule pickup</a>
46     [% END %]
47
48          <div class="btn-group">
49         <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">More <span class="caret"></span></button>
50             <ul class="dropdown-menu dropdown-menu-right">
51                 [% IF CAN_user_borrowers_edit_borrowers %]
52                     <li><a id="renewpatron" href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% patron.borrowernumber | html %]&amp;destination=[% destination | html %]&amp;reregistration=y">Renew patron</a></li>
53                 [% ELSE %]
54                     <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to renew patrons" id="renewpatron" href="#">Renew patron</a></li>
55                 [% END %]
56                 [% IF ( CAN_user_permissions ) %]
57                     <li><a id="patronflags" href="/cgi-bin/koha/members/member-flags.pl?member=[% patron.borrowernumber | html %]">Set permissions</a></li>
58                 [% ELSE %]
59                     <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to set permissions" id="patronflags" href="#">Set permissions</a></li>
60                 [% END %]
61
62                 [% IF ( Koha.Preference('TwoFactorAuthentication') == 'enforced' || Koha.Preference('TwoFactorAuthentication') == 'enabled' ) && logged_in_user.borrowernumber == patron.borrowernumber %]
63                     <li><a id="twofa" href="/cgi-bin/koha/members/two_factor_auth.pl">Manage two-factor authentication</a></li>
64                 [% END %]
65
66                 [% IF CAN_user_borrowers_edit_borrowers && useDischarge %]
67                     <li><a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% patron.borrowernumber | uri %]">Discharge</a></li>
68                 [% END %]
69
70                 [% IF Koha.Preference('RESTOAuth2ClientCredentials') %]
71                     [% IF CAN_user_superlibrarian OR loggedinusernumber == patron.borrowernumber %]
72                         <li><a id="apikeys" href="/cgi-bin/koha/members/apikeys.pl?patron_id=[% patron.borrowernumber | html %]">Manage API keys</a></li>
73                     [% ELSE %]
74                         <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to manage API keys" id="apikeys" href="#">Manage API keys</a></li>
75                     [% END %]
76                 [% END %]
77
78                 [% IF CAN_user_borrowers_edit_borrowers %]
79                     <li><a id="sendwelcome" href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% patron.borrowernumber | uri %]&op=send_welcome">Send welcome email</a></li>
80                 [% END %]
81
82                 [% IF CAN_user_borrowers_edit_borrowers && patron.category.effective_reset_password %]
83                     <li><a id="resetpassword" href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% patron.borrowernumber | uri %]&op=send_password_reset">Send password reset</a></li>
84                 [% END %]
85
86                 [% IF CAN_user_borrowers_delete_borrowers %]
87                     <li><a id="deletepatron" href="#">Delete</a></li>
88                 [% ELSE %]
89                     <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to delete patrons" id="deletepatron" href="#">Delete</a></li>
90                 [% END %]
91                 [% SET adult_categories = Categories.scalar.all(category_type => 'A') %]
92                 [% IF adult_categories.count > 0 %]
93                     [% IF patron.is_child %]
94                         <li><a id="updatechild" href="#">Update child to adult patron</a></li>
95                     [% ELSE %]
96                         <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="Patron is an adult" id="updatechild" href="#">Update child to adult patron</a></li>
97                     [% END %]
98                 [% END %]
99                 [% IF Koha.Preference('intranetreadinghistory') %]
100                     [%IF ( privacy == 2 ) %]
101                         <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="Not allowed by patron's privacy settings" id="exportbarcodes" href="#">Export today's checked in barcodes</a></li>
102                     [% ELSE %]
103                         <li><a id="exportcheckins" href="#">Export today's checked in barcodes</a></li>
104                     [% END %]
105                 [% END %]
106             </ul>
107     </div>
108 </div>
109
110 <!-- Modal -->
111 <div id="add_message_form" class="modal" tabindex="-1" role="dialog" aria-labelledby="addnewmessageLabel" aria-hidden="true">
112     <div class="modal-dialog">
113         <div class="modal-content">
114             <form method="post" action="/cgi-bin/koha/circ/add_message.pl" id="message_form" name="message_f">
115                 <div class="modal-header">
116                     <h3>Leave a message</h3>
117                 </div>
118                 <div class="modal-body">
119                     <div class="form-group">
120                         <label for="message_type">Add a message for:</label>
121                         <select name="message_type" id="message_type">
122                             <option value="L">Staff - Internal note</option>
123                             <option value="B">OPAC - [% patron.firstname | html %] [% patron.surname | html %]</option>
124                         </select>
125                     </div>
126                     [% bor_notes = AuthorisedValues.Get( 'BOR_NOTES' ) %]
127                     [% IF bor_notes %]
128                         <div class="form-group">
129                             <label for="select_patron_messages">Predefined notes: </label>
130                             <select name="type" id="select_patron_messages">
131                                 <option value="">Select note</option>
132                                 [% FOREACH bor_note IN bor_notes %]
133                                     <option value="[% bor_note.lib | html %]">[% bor_note.lib | html %]</option>
134                                 [% END %]
135                             </select>
136                         </div>
137                     [% END %]
138                     <div class="form-group">
139                         <textarea rows="3" class="modal-textarea" name="borrower_message" id="borrower_message" ></textarea>
140                     </div>
141                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
142                     <input type="hidden" name="batch" value="[% batch | html %]" />
143                     <input type="hidden" name="branchcode" value="[% Branches.GetLoggedInBranchcode | html %]" />
144                 </div>
145                 <div class="modal-footer">
146                     <button class="btn btn-default approve" type="submit"><i class="fa fa-check"></i> Save</button>
147                     <button class="btn btn-default deny cancel" href="#" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> Cancel</button>
148                 </div>
149             </form>
150         </div>
151     </div>
152 </div>