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