Bug 20794: Hide holds tab on details when user lacks circulate_remaining_permissions
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / moremember.tt
1 [% USE Asset %]
2 [% USE Koha %]
3 [% USE Branches %]
4 [% USE KohaDates %]
5 [% USE AuthorisedValues %]
6 [% USE ColumnsSettings %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha &rsaquo; Patrons &rsaquo;
10 [% UNLESS blocking_error %]
11     Patron details for [% INCLUDE 'patron-title.inc' no_html = 1 %]
12 [% END %]
13 </title>
14 [% INCLUDE 'doc-head-close.inc' %]
15 [% Asset.css("css/datatables.css") %]
16 </head>
17
18 <body id="pat_moremember" class="pat">
19 [% INCLUDE 'header.inc' %]
20 [% INCLUDE 'patron-search.inc' %]
21
22 <div id="breadcrumbs">
23          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
24 &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
25 &rsaquo; [% UNLESS blocking_error %]Patron details for [% INCLUDE 'patron-title.inc' %][% END %]
26 </div>
27
28 <div id="doc3" class="yui-t2">
29    
30    <div id="bd">
31         <div id="yui-main">
32         <div class="yui-b">
33
34 [% INCLUDE 'members-toolbar.inc' %]
35
36 [% IF ( error ) %]
37 <div class="dialog alert">
38     [% IF ( error == 'CANT_DELETE_STAFF' ) %]
39         <h3>Unable to delete staff user</h3>
40         <p>Insufficient privileges.</p>
41     [% END %]
42     [% IF ( error == 'CANT_DELETE_YOURSELF' ) %]
43         <h3>Not allowed to delete own account</h3>
44         <p>Deleting your own account would lock you out of Koha.</p>
45     [% END %]
46     [% IF ( error == 'CANT_DELETE_OTHERLIBRARY' ) %]
47         <h3>Unable to delete patrons from other libraries with current settings</h3>
48         <p>Insufficient privileges.</p>
49     [% END %]
50     [% IF ( error == 'CANT_DELETE' ) %]
51         <h3>Unable to delete patron</h3>
52         <p>Insufficient privileges.</p>
53     [% END %]
54 </div>
55 [% END %]
56 <div class="yui-g">
57
58     [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% patron.dateexpiry | $KohaDates %]</div>[% END %]
59
60     [% IF fines %]
61     <div id="circmessages" class="circmessage attention">
62       <ul>
63         [% INCLUDE 'blocked-fines.inc' %]
64       </ul>
65     </div>
66     [% END %]
67
68     [% IF ( patron_messages ) %]
69         <div id="messages" class="circmessage">
70             <h4>Messages:</h4>
71             <ul>
72                 [% FOREACH patron_message IN patron_messages %]
73                     <li>
74                         [% IF(patron_message.message_type == "L") %]
75                             <span class="circ-hlt">
76                         [% ELSE %]
77                             <span>
78                         [% END %]
79                             [% patron_message.message_date | $KohaDates %]
80                             [% Branches.GetName( patron_message.branchcode ) %]
81                             [% IF patron_message.manager_id %]
82                                 ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron_message.manager_id %]">[% patron_message.get_column('manager_firstname') %] [% patron_message.get_column('manager_surname') %]</a> )
83                             [% END %]
84                             <i>"[% patron_message.message | html %]"</i>
85                         </span>
86                         [% IF patron_message.branchcode == branchcode OR Koha.Preference('AllowAllMessageDeletion') %]
87                             <a class="btn btn-link btn-sm" href="/cgi-bin/koha/circ/del_message.pl?message_id=[% patron_message.message_id %]&amp;borrowernumber=[% patron_message.borrowernumber %]&amp;from=moremember" onclick="return confirm(MSG_CONFIRM_DELETE_MESSAGE);"><i class="fa fa-trash"></i> Delete</a>
88                         [% END %]
89                     </li>
90                 [% END %]
91             </ul>
92             <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>
93         </div>
94     [% END %]
95
96     [% IF ( flagged ) %]
97     <div id="circmessages" class="circmessage attention">
98         <ul>
99         [% IF ( userdebarred ) %]
100             <li class="blocker">Patron's account is restricted
101                [% IF ( userdebarreddate ) %]
102                    until [% userdebarreddate %]
103                [% END %]
104
105                [% IF ( debarredcomment ) %]
106                    with the explanation: <i>
107                    [% IF debarredcomment.search('OVERDUES_PROCESS') %]
108                        Restriction added by overdues process [% debarredcomment.remove('OVERDUES_PROCESS ') | html_line_break %]
109                    [% ELSE %]
110                        [% debarredcomment | html_line_break %]
111                    [% END %]
112                     </i>
113                [% END %]
114                 <a href="#reldebarments" id="view_restrictions">View restrictions</a>
115             </li>
116         [% END %]
117         [% IF ( patron.gonenoaddress ) %]<li class="blocker">Patron's address is in doubt.</li>[% END %]
118         [% IF ( lost ) %]<li class="blocker">Patron's card has been reported lost.</li>[% END %]
119         </ul>
120     </div>
121     [% END %]
122 <h3>[% UNLESS ( I ) %]
123    [% patron.title | html %] [% patron.firstname | html %] [% END %] [% patron.surname | html %] ([% patron.cardnumber | html %])</h3>
124  <div class="yui-u first">
125 <div id="patron-information" style="padding : .5em;">
126
127     [% IF ( patron.othernames ) %]&ldquo;[% patron.othernames | html %]&rdquo;[% END %]
128
129     <div class = "address">
130         [% IF Koha.Preference( 'AddressFormat' ) %]
131             [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
132         [% ELSE %]
133             [% INCLUDE 'member-display-address-style-us.inc' %]
134         [% END %]
135     </div>
136                     
137         <div class="rows">
138     <ol>
139         [% IF ( patron.phone ) %]<li><span class="label">Primary phone: </span><a href="tel:[% patron.phone %]">[% patron.phone | html %]</a></li>[% END %]
140         [% IF ( patron.phonepro ) %]<li><span class="label">Secondary phone: </span><a href="tel:[% patron.phonepro %]">[% patron.phonepro | html %]</a></li>[% END %]
141         [% IF ( patron.mobile ) %]<li><span class="label">Other phone: </span><a href="tel:[% patron.mobile %]">[% patron.mobile | html %]</a></li>[% END %]
142         [% IF ( patron.fax ) %]<li><span class="label">Fax: </span>[% patron.fax |html %]</li>[% END %]
143         [% IF ( patron.email ) %]<li class="email"><span class="label">Primary email:</span><a title="[% patron.email %]" href="mailto:[% patron.email | url %]">[% patron.email | html %]</a></li>[% END %]
144         [% IF ( patron.emailpro ) %]<li class="email"><span class="label">Secondary email: </span><a title="[% patron.emailpro %]" href="mailto:[% patron.emailpro | url %]">[% patron.emailpro | html %]</a></li>[% END %]
145         [% UNLESS ( I ) %]
146             [% IF ( patron.initials ) %]<li><span class="label">Initials: </span>[% patron.initials | html %]</li>[% END %]
147             [% IF ( patron.dateofbirth ) %]<li><span class="label">Date of birth:</span>[% patron.dateofbirth | $KohaDates %] ([% age %] years)</li>[% END %]
148             [% IF ( patron.sex ) %]<li><span class="label">Gender:</span>
149                 [% IF ( patron.sex == 'F' ) %]Female[% ELSIF ( patron.sex == 'M' ) %]Male[% ELSE %][% patron.sex %][% END %]
150             </li>[% END %]
151         [% END %]
152         [% IF guarantees %]
153             <li>
154                 <span class="label">Guarantees:</span>
155                 <ul>
156                     [% FOREACH guarantee IN guarantees %]
157                         [% IF logged_in_user.can_see_patron_infos( guarantee ) %]
158                             <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></li>
159                         [% ELSE %]
160                             <li>[% guarantee.firstname | html %] [% guarantee.surname | html %]</li>
161                         [% END %]
162                     [% END %]
163                 </ul>
164             </li>
165         [% ELSIF guarantor %]
166             <li>
167                 <span class="label">Guarantor:</span>
168                 [% IF guarantor.borrowernumber AND logged_in_user.can_see_patron_infos( guarantor ) %]
169                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber %]">[% guarantor.firstname | html %] [% guarantor.surname | html %]</a>
170                 [% ELSE %]
171                     [% guarantor.firstname | html %] [% guarantor.surname | html %]
172                 [% END %]
173             </li>
174         [% END %]
175     </ol>
176 </div>
177       <div class="action">
178         [% IF ( guarantor.borrowernumber ) %]
179         <a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=1&amp;guarantorid=[% guarantor.borrowernumber %]">Edit</a>
180         [% ELSE %]
181         <a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=1">Edit</a>
182         [% END %]</div>
183
184 </div>
185
186 <!-- Begin Upload Patron Image Section -->
187
188 <div id="manage-patron-image">
189 [% IF ( patronimages ) %]
190     [% IF ( CAN_user_tools_batch_upload_patron_images ) %]
191         <form method="post" action="/cgi-bin/koha/tools/picture-upload.pl" enctype="multipart/form-data">
192             <fieldset class="brief">
193             [% IF ( patron.image ) %]
194                 <legend>Manage patron image</legend>
195                 <div class="hint">To update the image for [% patron.title | html %] [% patron.surname | html %], select a new image file and click 'Upload.' <br />Click the 'Delete' button to remove the current image.
196             [% ELSE %]
197                 <legend>Upload patron image</legend>
198                 <div class="hint">[% patron.title %] [% patron.firstname | html %] [% patron.surname | html %] does not currently have an image available. To import an image for [% patron.title %] [% patron.surname | html %], enter the name of an image file to upload.
199             [% END %]
200                     <br />Only PNG, GIF, JPEG, XPM formats are supported.
201                 </div>
202                 <input type="hidden" id="image" name="filetype" value="image" />
203                 <input type="hidden" id="cardnumber" name="cardnumber" value="[% patron.cardnumber | html %]" />
204                 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
205                 <ol>
206                     <li>
207                        <label for="uploadfile">Select the file to upload: </label><input type="file" id="uploadfile" name="uploadfile" />
208                     </li>
209                 </ol>
210                 <fieldset class="action">
211                     <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
212                     <input type="submit" value="Upload" class="submit" />
213                     <input name="op" type="hidden" value="Upload" />
214                     [% IF ( patron.image ) %]<a id="delpicture" href="/cgi-bin/koha/tools/picture-upload.pl?op=Delete&amp;borrowernumber=[% patron.borrowernumber %]&amp;csrf_token=[% csrf_token %]" class="delete">Delete</a>[% END %]
215                 </fieldset>
216             </fieldset>
217         </form>
218     [% END %]
219 [% END %]
220 </div>
221
222 <!-- End Upload Patron Image Section -->
223
224 [% IF Koha.Preference('HouseboundModule') %]
225 <div id="houseboundroles">
226 <h3>Housebound roles</h3>
227 <div class="rows">
228   <ol>
229     <li>
230       <span class="label">Chooser:</span>
231       [% IF ( housebound_role.housebound_chooser == 1 ) %]
232         Yes
233       [% ELSE %]
234         No
235       [% END %]
236     </li>
237     <li>
238       <span class="label">Deliverer:</span>
239       [% IF ( housebound_role.housebound_deliverer == 1 ) %]
240         Yes
241       [% ELSE %]
242         No
243       [% END %]
244     </li>
245   </ol>
246 </div>
247 </div>
248 <div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=4">Edit</a></div>
249 [% END %]
250
251 [% IF ( ExtendedPatronAttributes ) %]
252 [% UNLESS ( no_patron_attribute_types ) %]
253 <div id="patron-extended-attributes" style="padding-top: 1em;">
254 <h3>Additional attributes and identifiers</h3>
255 [% FOREACH attribute IN attributes_loop %]
256     [% IF attribute.class %]
257         <div id="aai_[% attribute.class %]" class="rows">
258     [% ELSE %]
259         <div id="aai" class="rows">
260     [% END %]
261         <h4>[% attribute.lib %]</h4>
262         <ol>
263         [% FOREACH item IN attribute.items %]
264             <li>
265                 <span class="label">[% item.description %]: </span>
266                 [% IF ( item.value_description ) %]
267                     [% item.value_description %]
268                 [% ELSE %]
269                     [% item.value| html_line_break %]
270                 [% END %]
271             </li>
272         [% END %]
273         </ol>
274     </div>
275 [% END %]
276 </div>
277 <div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=4">Edit</a></div>
278 [% END %]
279 [% END %]
280
281
282 [% IF ( EnhancedMessagingPreferences ) %]
283 <div id="patron-messaging-prefs" style="padding-top: 1em;">
284 <h3>Patron messaging preferences</h3>
285 [% INCLUDE 'messaging-preference-form.inc' %]
286  [% IF ( SMSSendDriver ) %]
287       <div class="rows"> <ol><li><span class="label">SMS number:</span><a href="sms:[% patron.smsalertnumber %]">[% patron.smsalertnumber %]</a>
288      </li></ol></div>
289  [% END %]
290 </div>
291 <div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=5">Edit</a></div>
292 [% END %]
293
294 </div>
295  <div class="yui-u"> 
296  <div id="patron-library-details">
297  <h3>Library use</h3>
298 <div class="rows"> 
299 <ol>
300     <li><span class="label">Card number: </span>[% patron.cardnumber %]</li>
301     <li><span class="label">Borrowernumber: </span> [% patron.borrowernumber %]</li>
302     <li><span class="label">Category: </span>[% patron.category.description %] ([% patron.categorycode %])</li>
303     <li><span class="label">Registration date: </span>[% patron.dateenrolled | $KohaDates %]</li>
304
305     <li><span class="label">Expiration date: </span>
306     [% IF ( was_renewed ) %]
307             <strong class="reregistrinfo">[% patron.dateexpiry | $KohaDates %]</strong>
308     [% ELSE %]
309             [% patron.dateexpiry | $KohaDates %]
310     [% END %]
311     </li>
312     
313     <li><span class="label">Library: </span>[% branchname %]</li>
314
315     [% IF ( OPACPrivacy ) %]<li><span class="label">Privacy Pref:</span>
316          [% IF ( privacy0 ) %]Forever[% END %]
317          [% IF ( privacy1 ) %]Default[% END %]
318          [% IF ( privacy2 ) %]Never[% END %]
319     </li>[% END %]
320
321     <li>
322         <span class="label">Show checkouts to guarantor</span>
323         [% IF privacy_guarantor_checkouts %]
324             Yes
325         [% ELSE %]
326             No
327         [% END %]
328     </li>
329
330     [% IF ( patron.sort1 ) %]<li><span class="label">Sort field 1:</span>[% AuthorisedValues.GetByCode('Bsort1', patron.sort1) |html %]</li>[% END %]
331     [% IF ( patron.sort2 ) %]<li><span class="label">Sort field 2:</span>[% AuthorisedValues.GetByCode('Bsort2', patron.sort2) |html %]</li>[% END %]
332     <li><span class="label">Username: </span>[% patron.userid |html  %]</li>
333     <li><span class="label">Password: </span>
334     [% IF ( patron.password ) %]
335         *******
336     [% ELSE %]
337         <span class="problem"><a href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber %]">Undefined</a></span>
338     [% END %] 
339     </li>
340     [% IF ( patron.borrowernotes ) %]<li><span class="label">Circulation note: </span>[% patron.borrowernotes |html %]</li>[% END %]
341     [% IF ( patron.opacnote ) %]<li><span class="label">OPAC note:</span>[% patron.opacnote |html %]</li>[% END %]
342     [% IF Koha.Preference( 'NorwegianPatronDBEnable' ) == 1 %]
343         [% IF ( sync == 1 ) %]
344             <li><span class="label">Activate sync: </span>Yes</li>
345             [% IF ( syncstatus ) %]<li><span class="label">Sync status: </span>[% syncstatus %]</li>[% END %]
346             [% IF ( lastsync ) %]<li><span class="label">Last sync: </span>[% lastsync | $KohaDates %]</li>[% END %]
347         [% ELSE %]
348             <li><span class="label">Activate sync: </span>No</li>
349         [% END %]
350     [% END %]
351     [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
352       <li><span class="label">Check previous checkouts: </span>
353         [% IF ( patron.checkprevcheckout == 'yes' ) %]
354         Yes
355         [% ELSIF ( patron.checkprevcheckout == 'no' ) %]
356         No
357         [% ELSE %]
358         Inherited
359         [% END %]
360       </li>
361     [% END %]
362     [% IF Koha.Preference('TranslateNotices') %]
363         <li>
364             <span class="label">Preferred language for notices: </span>
365             [% translated_language %]
366         </li>
367     [% END %]
368         </ol>
369         </div>
370  </div>
371     <div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=3">Edit</a></div>
372  
373  <div id="patron-alternate-address" style="padding-top: 1em;">
374     <h3>Alternate address</h3>
375
376     [% IF Koha.Preference( 'AddressFormat' ) %]
377         [% INCLUDE "member-display-alt-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
378     [% ELSE %]
379         [% INCLUDE 'member-display-alt-address-style-us.inc' %]
380     [% END %]
381
382     <div class="rows">  <ol>
383       [% IF ( patron.B_phone ) %]<li><span class="label">Phone: </span><a href="tel:[% patron.B_phone %]">[% patron.B_phone |html  %]</a></li>[% END %]
384       [% IF ( patron.B_email ) %]<li class="email"><span class="label">Email: </span><a title="[% patron.B_email %]" href="mailto:[% patron.B_email | url %]">[% B_email |html %]</a></li>[% END %]
385       [% IF ( patron.contactnote ) %]<li><span class="label">Contact note: </span> [% patron.contactnote |html %]</li>[% END %]
386       </ol>
387     </div>
388 </div>
389 <div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=6">Edit</a></div>
390
391  <div id="patron-alternative-contact" style="padding-top: 1em;">
392  <h3>Alternative contact</h3>
393    <div class="rows"> <ol><li><span class="label">Surname: </span>[% patron.altcontactsurname | html %]</li>
394     <li><span class="label">First name: </span>[% patron.altcontactfirstname | html %]</li>
395     <li><span class="label">Address: </span>[% patron.altcontactaddress1 | html %]</li>
396     <li><span class="label">Address 2: </span>[% patron.altcontactaddress2 | html %]</li>
397     <li><span class="label">City: </span>[% patron.altcontactaddress3 | html %]</li>
398     [% IF ( patron.altcontactstate ) %]<li><span class="label">State: </span>[% patron.altcontactstate | html %]</li>[% END %]
399     <li><span class="label">ZIP/Postal code: </span>[% patron.altcontactzipcode | html %]</li>
400     [% IF ( patron.altcontactcountry ) %]<li><span class="label">Country: </span>[% patron.altcontactcountry | html %]</li>[% END %]
401     [% IF ( patron.altcontactphone ) %]<li><span class="label">Phone: </span><a href="tel:[% patron.altcontactphone | url %]">[% patron.altcontactphone | html %]</a></li>[% END %]
402     </ol></div>
403 </div>
404 <div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=2">Edit</a></div>
405
406 </div>
407 </div>
408 <div id="finesholdsissues" class="toptabs">
409     <ul>
410         <li><a href="#checkouts">[% issuecount %] Checkout(s)</a></li>
411         [% IF relatives_issues_count %]
412             <li><a href="#relatives-issues" id="relatives-issues-tab">Relatives' checkouts</a></li>
413         [% END %]
414         <li><a href="#finesandcharges">Fines &amp; Charges</a></li>
415         [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
416         <li>
417             [% IF ( holds_count ) %]
418                 <a href="#reserves" id="holds-tab">[% holds_count %] Hold(s)</a>
419             [% ELSE %]
420                 <a href="#reserves" id="holds-tab">0 Holds</a>
421             [% END %]
422         </li>
423         [% END %]
424         [% IF Koha.Preference('ArticleRequests') %]
425             <li>
426                 <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count %] Article requests</a>
427             </li>
428         [% END %]
429         <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.size %] Restrictions</a></li>
430
431         [% SET enrollments = patron.get_club_enrollments(1) %]
432         [% SET enrollable  = patron.get_enrollable_clubs(0,1) %]
433         [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
434             <li>
435                 <a id="clubs-tab-link" href="#clubs-tab">
436                     Clubs ([% enrollments.count %]/[% enrollable.count %])
437                 </a>
438             </li>
439         [% END %]
440     </ul>
441
442 [% INCLUDE "checkouts-table.inc" %]
443
444 [% IF ( relatives_issues_count ) %]
445     <div id="relatives-issues">
446         <table id="relatives-issues-table" style="width: 100% !Important;">
447             <thead>
448                 <tr>
449                     <th scope="col">Due date hidden not formatted</th>
450                     <th scope="col">Due date</th>
451                     <th scope="col">Title</th>
452                     <th scope="col">Item type</th>
453                     <th scope="col">Location</th>
454                     <th scope="col">Checked out on</th>
455                     <th scope="col">Checked out from</th>
456                     <th scope="col">Call no</th>
457                     <th scope="col">Charge</th>
458                     <th scope="col">Fine</th>
459                     <th scope="col">Price</th>
460                     <th scope="col">Patron</th>
461                 </tr>
462             </thead>
463         </table>
464     </div>
465 [% END %]
466
467 <div id="finesandcharges">
468     [% IF ( totaldue_raw ) %]
469         <p>Total due: [% totaldue %]</p>
470     [% ELSE %]
471         <p>No outstanding charges</p>
472     [% END %]
473 </div>
474
475 [% IF CAN_user_clubs && ( enrollments.count || enrollable.count ) %]
476     <div id="clubs-tab">
477         Loading...
478     </div>
479 [% END %]
480
481 [% INCLUDE borrower_debarments.inc %]
482
483 [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
484 <div id="reserves">
485 [% IF ( holds_count ) %]
486     <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
487         <input type="hidden" name="from" value="circ" />
488         <table id="holds-table" style="width: 100% !Important;">
489             <thead>
490                 <tr>
491                     <th>Hold date</th>
492                     <th>Title</th>
493                     <th>Call number</th>
494                     <th>Barcode</th>
495                     <th>Pickup at</th>
496                     <th>Expiration</th>
497                     <th>Priority</th>
498                     <th>Delete?</th>
499                     <th>Suspend?</th>
500                 </tr>
501             </thead>
502         </table>
503
504         <fieldset class="action">
505             <input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
506         </fieldset>
507     </form>
508
509     [% IF Koha.Preference('SuspendHoldsIntranet') %]
510     <fieldset class="action">
511         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
512             <input type="hidden" name="from" value="borrower" />
513             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
514             <input type="submit" value="Suspend all holds" />
515
516             [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
517             <label for="suspend_until">until</label>
518             <input type="text" size="10" id="suspend_until" name="suspend_until" class="datepicker"/>
519             <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
520             [% END %]
521         </form>
522     </fieldset>
523
524     <fieldset class="action">
525         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
526             <input type="hidden" name="from" value="borrower" />
527             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
528             <input type="hidden" name="suspend" value="0" />
529             <input type="submit" value="Resume all suspended holds" />
530         </form>
531     </fieldset>
532     [% END # IF SuspendHoldsIntranet %]
533
534     [% ELSE %]<p>Patron has nothing on hold.</p>[% END %]
535         </div>
536 [% END %]
537
538 [% IF Koha.Preference('ArticleRequests') %]
539     [% INCLUDE 'patron-article-requests.inc' %]
540 [% END %]
541
542 </div>
543
544 </div>
545 </div>
546 <div class="yui-b">
547 [% INCLUDE 'circ-menu.inc' %]
548 </div>
549 </div>
550
551 [% MACRO jsinclude BLOCK %]
552     [% INCLUDE 'datatables.inc' %]
553     [% INCLUDE 'columns_settings.inc' %]
554     [% INCLUDE 'strings.inc' %]
555     [% INCLUDE 'calendar.inc' %]
556     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %]
557     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") %]
558     [% INCLUDE 'timepicker.inc' %]
559     [% Asset.js("lib/jquery/plugins/jquery.dataTables.rowGrouping.js") %]
560     [% Asset.js("js/pages/circulation.js") %]
561     [% Asset.js("js/checkouts.js") %]
562     [% Asset.js("js/holds.js") %]
563     [% Asset.js("js/members-menu.js") %]
564     [% Asset.js("js/messaging-preference-form.js") %]
565     <script type="text/javascript">
566         /* Set some variable needed in circulation.js */
567         var interface = "[% interface %]";
568         var theme = "[% theme %]";
569         var borrowernumber = "[% patron.borrowernumber %]";
570         var branchcode = "[% Branches.GetLoggedInBranchcode() %]";
571         var exports_enabled = "[% Koha.Preference('ExportCircHistory') %]";
572         var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 %]
573         var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 %];
574         var script = "moremember";
575         var relatives_borrowernumbers = new Array();
576         [% FOREACH b IN relatives_borrowernumbers %]
577             relatives_borrowernumbers.push("[% b %]");
578         [% END %]
579
580         var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
581         var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone.");
582
583         columns_settings = [% ColumnsSettings.GetColumns( 'members', 'moremember', 'issues-table', 'json' ) %]
584
585         $(document).ready(function() {
586             if ( $('#clubs-tab').length ) {
587                 $('#clubs-tab-link').on('click', function() {
588                     $('#clubs-tab').text(_("Loading..."));
589                     $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber %]');
590                 });
591             }
592
593             $('#finesholdsissues').tabs({
594                 // Correct table sizing for tables hidden in tabs
595                 // http://www.datatables.net/examples/api/tabs_and_scrolling.html
596                 "show": function(event, ui) {
597                     var oTable = $('div.dataTables_wrapper>table', ui.panel).dataTable();
598                     if ( oTable.length > 0 ) {
599                         oTable.fnAdjustColumnSizing();
600                     }
601                 },
602                 "activate": function( event, ui ) {
603                     $('#'+ui.newTab.context.id).click();
604                 }
605             } );
606             $("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, {
607                 "sDom": 't',
608                 "aoColumnDefs": [
609                     { "aTargets": [ -1,-2 ], "bSortable": false, "bSearchable": false }
610                 ],
611                 "aoColumns": [
612                     { "sType": "title-string" },{ "sType": "anti-the" },null,null,null,null,null,null
613                 ],
614                 "bPaginate": false
615             }));
616             [% IF ( patron.image ) %]
617                 $('#delpicture').click(function(){
618                      return confirm(_("Are you sure you want to delete this patron image? This cannot be undone."));
619                 });
620                 $('#manage-patron-image').find("input[value*=Upload]").click(function(){
621                     if($("#uploadfile").val() == ""){
622                         alert(_("Please choose a file to upload"));
623                         return false;
624                     }
625                     return confirm(_("Are you sure you want to replace the current patron image? This cannot be undone."));
626                 });
627             [% END %]
628
629             $("#suspend_until").datepicker({
630                 onClose: function(dateText, inst) {
631                     validate_date(dateText, inst);
632                 },
633                 minDate: 1, // require that hold suspended until date is after today
634             }).on("change", function(e, value) {
635                 if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
636             });
637
638             $("#view_restrictions").on("click",function(){
639                 $('#debarments-tab-link').click();
640             });
641          });
642         function uncheck_sibling(me){
643             nodename=me.getAttribute("name");
644             if (nodename =="barcodes[]"){
645                 var Node=me.parentNode.previousSibling;
646                 while (Node.nodeName!="TD"){Node=Node.previousSibling}
647                 var Nodes=Node.childNodes;
648                 for (var i=0;i < Nodes.length;i++){
649                     if (Nodes[i].nodeName=="INPUT" && Nodes[i].getAttribute("type")=="checkbox"){
650                         Nodes[i].checked=false;
651                     }
652                 }
653             } else {
654                 var Node=me.parentNode.nextSibling;
655                 while (Node.nodeName!="TD"){Node=Node.nextSibling}
656                 var Nodes=Node.childNodes;
657                 for (var i=0;i<Nodes.length;i++){
658                     if (Nodes[i].nodeName=="INPUT" && Nodes[i].getAttribute("type")=="checkbox"){
659                       Nodes[i].checked=false;
660                     }
661                }
662             }
663         }
664
665         function validate1(date) {
666             var today = new Date();
667             if ( date < today ) {
668                 return true;
669             } else {
670                 return false;
671             }
672         };
673     </script>
674 [% END %]
675
676 [% INCLUDE 'intranet-bottom.inc' %]