Bug 30695: (QA follow-up) Catch moremember.tt too
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / moremember.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Context %]
4 [% USE Koha %]
5 [% USE Branches %]
6 [% USE ItemTypes %]
7 [% USE KohaDates %]
8 [% USE AuthorisedValues %]
9 [% USE TablesSettings %]
10 [% USE Price %]
11 [% PROCESS 'member-display-address-style.inc' %]
12 [% PROCESS 'member-display-alt-address-style.inc' %]
13 [% SET footerjs = 1 %]
14 [% INCLUDE 'doc-head-open.inc' %]
15 [% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %]
16 <title>
17     [% UNLESS blocking_error %]
18         Patron details for [% INCLUDE 'patron-title.inc' no_html = 1 %]
19     [% END %] &rsaquo; Patrons &rsaquo; Koha
20 </title>
21 [% INCLUDE 'doc-head-close.inc' %]
22 </head>
23
24 <body id="pat_moremember" class="pat">
25     [% INCLUDE 'header.inc' %]
26     [% INCLUDE 'patron-search-header.inc' %]
27
28     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
29         <ol>
30             <li>
31                 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
32             </li>
33
34             [% IF blocking_error %]
35                 <li>
36                     <a href="#" aria-current="page">
37                         Patrons
38                     </a>
39                 </li>
40             [% ELSE %]
41                 <li>
42                     <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
43                 </li>
44                 <li>
45                     <a href="#" aria-current="page">
46                         Patron details for [% INCLUDE 'patron-title.inc' %]
47                     </a>
48                 </li>
49             [% END %]
50         </ol>
51     </nav>
52
53     <div class="main container-fluid">
54         <div class="row">
55             <div class="col-sm-10 col-sm-push-2">
56                 <main>
57
58
59                     [% INCLUDE 'members-toolbar.inc' %]
60
61                     [% IF ( error ) %]
62                         <div class="dialog alert">
63                             [% IF ( error == 'CANT_DELETE_STAFF' ) %]
64                                 <h3>Unable to delete staff user</h3>
65                                 <p>Insufficient privileges.</p>
66                             [% END %]
67                             [% IF ( error == 'CANT_DELETE_YOURSELF' ) %]
68                                 <h3>Not allowed to delete own account</h3>
69                                 <p>Deleting your own account would lock you out of Koha.</p>
70                             [% END %]
71                             [% IF ( error == 'CANT_DELETE_OTHERLIBRARY' ) %]
72                                 <h3>Unable to delete patrons from other libraries with current settings</h3>
73                                 <p>Insufficient privileges.</p>
74                             [% END %]
75                             [% IF ( error == 'CANT_DELETE_ANONYMOUS_PATRON' ) %]
76                                 <h3>Unable to delete patron that is set as AnonymousPatron</h3>
77                                 <p>This patron cannot be deleted while set as AnonymousPatron in the system preferences.</p>
78                             [% END %]
79                             [% IF ( error == 'CANT_DELETE' ) %]
80                                 <h3>Unable to delete patron</h3>
81                                 <p>Insufficient privileges.</p>
82                             [% END %]
83                         </div>
84                     [% END %]
85
86                     <div class="row">
87
88                         [% IF ( was_renewed ) %]
89                             <div class="dialog message">
90                                 Patron's account has been renewed until [% patron.dateexpiry | $KohaDates %]
91                             </div>
92                         [% END %]
93
94                         <div id="patron_messages" class="circmessage attention">
95                             [% INCLUDE 'patron_messages.inc' %]
96                         </div>
97
98                         <h1>
99                             [% UNLESS ( I ) %]
100                                 [% patron.title | html %] [% patron.firstname | html %]
101                             [% END %]
102                             [% patron.surname | html %] ([% patron.cardnumber | html %])
103                         </h1>
104                         <div class="col-sm-6">
105
106                             <div id="patron-information" class="patroninfo-section">
107
108                                 <div class="patroninfo-heading">
109                                     <h3>Contact information</h3>
110                                     [% IF ( guarantor.borrowernumber ) %]
111                                         <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=1&amp;guarantorid=[% guarantor.borrowernumber | html %]"><i class="fa fa-pencil"></i> Edit</a>
112                                     [% ELSE %]
113                                         <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=1"><i class="fa fa-pencil"></i> Edit</a>
114                                     [% END %]
115                                 </div>
116
117                                 [% IF ( patron.othernames ) %]&ldquo;[% patron.othernames | html %]&rdquo;[% END %]
118
119                                 <div class="address">
120                                     <ul>
121                                         [% PROCESS 'display-address-style' %]
122                                     </ul>
123                                 </div>
124
125                                 <div class="rows">
126                                     <ol>
127                                         [% IF ( patron.phone ) %]
128                                             <li>
129                                                 <span class="label">Primary phone: </span>
130                                                 <a href="tel:[% patron.phone | uri %]">[% patron.phone | html %]</a>
131                                             </li>
132                                         [% END %]
133                                         [% IF ( patron.phonepro ) %]
134                                             <li>
135                                                 <span class="label">Secondary phone: </span>
136                                                 <a href="tel:[% patron.phonepro | uri %]">[% patron.phonepro | html %]</a>
137                                             </li>
138                                         [% END %]
139                                         [% IF ( patron.mobile ) %]
140                                             <li>
141                                                 <span class="label">Other phone: </span>
142                                                 <a href="tel:[% patron.mobile | uri %]">[% patron.mobile | html %]</a>
143                                             </li>
144                                         [% END %]
145                                         [% IF ( patron.fax ) %]
146                                             <li>
147                                                 <span class="label">Fax: </span>
148                                                 [% patron.fax | html %]
149                                             </li>
150                                         [% END %]
151                                         [% IF ( patron.email ) %]
152                                             <li class="email">
153                                                 <span class="label">Primary email:</span>
154                                                 <a title="[% patron.email | html %]" href="mailto:[% patron.email | url %]">[% patron.email | html %]</a>
155                                             </li>
156                                         [% END %]
157                                         [% IF ( patron.emailpro ) %]
158                                             <li class="email">
159                                                 <span class="label">Secondary email: </span>
160                                                 <a title="[% patron.emailpro | html %]" href="mailto:[% patron.emailpro | url %]">[% patron.emailpro | html %]</a>
161                                             </li>
162                                         [% END %]
163                                         [% UNLESS ( I ) %]
164                                             [% IF ( patron.initials ) %]
165                                                 <li>
166                                                     <span class="label">Initials: </span>
167                                                     [% patron.initials | html %]
168                                                 </li>
169                                             [% END %]
170                                             [% IF ( patron.dateofbirth ) %]
171                                                 <li>
172                                                     <span class="label">Date of birth:</span>
173                                                     [% INCLUDE 'patron-age.inc' %]
174                                                 </li>
175                                             [% END %]
176                                             [% IF ( patron.sex ) %]
177                                                 <li>
178                                                     <span class="label">Gender:</span>
179                                                     [% IF ( patron.sex == 'F' ) %]<span class="patronsex-female">Female</span>[% ELSIF ( patron.sex == 'M' ) %]<span class="patronsex-male">Male</span>[% ELSIF (patron.sex == 'O' ) %]<span class="patronsex-other">Other</span>[% ELSE %][% patron.sex | html %][% END %]
180                                                 </li>
181                                             [% END %]
182                                         [% END %]
183                                          <li id="patron-privacyguarantor">
184                                             <span class="label">Show checkouts to guarantor</span>
185                                             [% IF patron.privacy_guarantor_checkouts %]
186                                                 Yes
187                                             [% ELSE %]
188                                                 No
189                                             [% END %]
190                                         </li>
191
192                                         <li id="patron-privacy_guarantor_fines">
193                                             <span class="label">Show fines to guarantor</span>
194                                             [% IF patron.privacy_guarantor_fines %]
195                                                 Yes
196                                             [% ELSE %]
197                                                 No
198                                             [% END %]
199                                         </li>
200
201                                         [% IF guarantees %]
202                                             <li>
203                                                 <span class="label">Guarantees:</span>
204                                                 <ul>
205                                                     [% FOREACH guarantee IN guarantees %]
206                                                         [% IF logged_in_user.can_see_patron_infos( guarantee ) %]
207                                                             <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber | uri %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></li>
208                                                         [% ELSE %]
209                                                             <li>[% guarantee.firstname | html %] [% guarantee.surname | html %]</li>
210                                                         [% END %]
211                                                     [% END %]
212                                                 </ul>
213                                             </li>
214                                         [% ELSIF guarantor_relationships.count > 0 OR ( patron.contactfirstname OR patron.contactname ) %]
215                                                 <li>
216                                                 [% IF guarantor_relationships.count > 1 OR guarantor_relationships.count == 0 AND ( patron.contactfirstname OR patron.contactname ) %]
217                                                     <span class="label">Guarantors:</span>
218                                                 [% ELSE %]
219                                                     <span class="label">Guarantor:</span>
220                                                 [% END %]
221                                                     <ul>
222                                                     [% FOREACH gr IN guarantor_relationships %]
223                                                         [% SET guarantor = gr.guarantor %]
224                                                         [% IF logged_in_user.can_see_patron_infos( guarantor ) %]
225                                                             <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.id | uri %]">[% guarantor.firstname | html %] [% guarantor.surname | html %][% IF gr.relationship %] ([% gr.relationship | html %])[% END %]</a></li>
226                                                         [% END %]
227                                                     [% END %]
228                                                     [% IF patron.contactfirstname OR patron.contactname %]
229                                                         <li>[% patron.contactfirstname | html %] [% patron.contactname | html %][% IF patron.relationship %] ([% patron.relationship | html %])[% END %]</li>
230                                                     [% END %]
231                                                     </ul>
232                                                 </li>
233                                         [% END %]
234
235                                         [% IF ( patron.primary_contact_method ) %]
236                                             <li>
237                                                 <span class="label">Main contact method: </span>
238                                                 [% SWITCH patron.primary_contact_method %]
239                                                     [% CASE 'phone' %]
240                                                         <span>Primary phone</span>
241                                                     [% CASE 'phonepro' %]
242                                                         <span>Secondary phone</span>
243                                                     [% CASE 'mobile' %]
244                                                         <span>Other phone</span>
245                                                     [% CASE 'email' %]
246                                                         <span>Primary email</span>
247                                                     [% CASE 'emailpro' %]
248                                                         <span>Secondary email</span>
249                                                     [% CASE 'fax' %]
250                                                         <span>Fax</span>
251                                                 [% END %]
252                                             </li>
253                                         [% END %]
254                                     </ol>
255                                 </div> [% # /div.rows %]
256                             </div> [% # /div#patron-information %]
257
258                             [% IF Koha.Preference('HouseboundModule') %]
259                                 <div id="houseboundroles" class="patroninfo-section">
260                                     [% IF ( housebound_role.housebound_chooser == 1 OR housebound_role.housebound_deliverer == 1 ) %]
261                                         <div class="patroninfo-heading">
262                                             <h3>Housebound roles</h3>
263                                             <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=7"><i class="fa fa-pencil"></i> Edit</a>
264                                         </div>
265                                         <div class="rows">
266                                             <ol>
267                                                 <li>
268                                                     <span class="label">Chooser:</span>
269                                                     [% IF ( housebound_role.housebound_chooser == 1 ) %]
270                                                         Yes
271                                                     [% ELSE %]
272                                                         No
273                                                     [% END %]
274                                                 </li>
275                                                 <li>
276                                                     <span class="label">Deliverer:</span>
277                                                     [% IF ( housebound_role.housebound_deliverer == 1 ) %]
278                                                         Yes
279                                                     [% ELSE %]
280                                                         No
281                                                     [% END %]
282                                                 </li>
283                                             </ol>
284                                         </div>
285                                     [% ELSE %]
286                                         <div class="patroninfo-heading">
287                                             <h3>Housebound roles</h3>
288                                             <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=7"><i class="fa fa-plus"></i> Add</a>
289                                         </div>
290                                     [% END %]
291                                 </div> [% #/ div#houseboundroles %]
292                             [% END %]
293
294                             [% IF Koha.Preference('ExtendedPatronAttributes') %]
295                                 [% UNLESS ( no_patron_attribute_types ) %]
296                                     <div id="patron-extended-attributes" class="patroninfo-section">
297                                         [% IF ( attributes_loop ) %]
298                                             <div class="patroninfo-heading">
299                                                 <h3>Additional attributes and identifiers</h3>
300                                                 <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=4"><i class="fa fa-pencil"></i> Edit</a>
301                                             </div>
302                                             [% FOREACH attribute IN attributes_loop %]
303                                                 [% IF attribute.class %]
304                                                     <div id="aai_[% attribute.class | html %]" class="rows">
305                                                 [% ELSE %]
306                                                     <div id="aai" class="rows">
307                                                 [% END %]
308                                                     <h4>[% attribute.lib | html %]</h4>
309                                                     <ol>
310                                                         [% FOREACH item IN attribute.items %]
311                                                             <li>
312                                                                 <span class="label">[% item.type.description | html %]: </span>
313                                                                 [% item.description | html_line_break %]
314                                                             </li>
315                                                         [% END %]
316                                                     </ol>
317                                                 </div>
318                                             [% END %]
319                                             <div class="action">
320                                             </div>
321                                         [% ELSE %]
322                                             <div class="patroninfo-heading">
323                                                 <h3>Additional attributes and identifiers</h3>
324                                                 <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=4"><i class="fa fa-plus"></i> Add</a>
325                                             </div>
326                                         [% END %]
327                                     </div> [% # /div#patron-extended-attributes %]
328                                 [% END %]
329                             [% END %]
330
331                             [% IF ( EnhancedMessagingPreferences ) %]
332                                 <div id="patron-messaging-prefs" class="patroninfo-section">
333                                     <div class="patroninfo-heading">
334                                         <h3>Patron messaging preferences</h3>
335                                         <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=5"><i class="fa fa-pencil"></i> Edit</a>
336                                     </div>
337                                     [% INCLUDE 'messaging-preference-form.inc' %]
338                                     [% IF Koha.Preference('SMSSendDriver') %]
339                                         <div class="rows">
340                                             <ol>
341                                                 <li>
342                                                     <span class="label">SMS number:</span>
343                                                     <a href="sms:[% patron.smsalertnumber | uri %]">[% patron.smsalertnumber | html %]</a>
344                                                 </li>
345                                                 <li>
346                                                     <span class="label">SMS provider:</span>
347                                                     [% patron.sms_provider.name | html %]
348                                                 </li>
349                                             </ol>
350                                         </div>
351                                     [% END %]
352                                 </div> [% # /div#patron-messaging-prefs %]
353                             [% END %]
354
355                         </div> <!-- /.col-sm-6 -->
356
357                         <div class="col-sm-6">
358                             <div id="patron-library-details" class="patroninfo-section">
359                                 <div class="patroninfo-heading">
360                                     <h3>Library use</h3>
361                                     <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=3"><i class="fa fa-pencil"></i> Edit</a>
362                                 </div>
363                                 <div class="rows">
364                                     <ol>
365                                         <li id="patron-cardnumber">
366                                             <span class="label">Card number: </span>
367                                             [% patron.cardnumber | html %]
368                                         </li>
369                                         <li id="patron-borrowernumber">
370                                             <span class="label">Borrowernumber: </span>
371                                             [% patron.borrowernumber | html %]
372                                         </li>
373                                         <li id="patron-categorydescription">
374                                             <span class="label">Category: </span>
375                                             [% patron.category.description | html %] ([% patron.categorycode | html %])
376                                         </li>
377                                         <li id="patron-dateenrolled">
378                                             <span class="label">Registration date: </span>
379                                             [% patron.dateenrolled | $KohaDates %]
380                                         </li>
381
382                                         [% IF ( patron.date_renewed ) %]
383                                             <li id="patron-daterenewed">
384                                                 <span class="label">Renewal date: </span>
385                                                 [% patron.date_renewed | $KohaDates %]
386                                             </li>
387                                         [% END %]
388
389                                         <li id="patron-expirationdate">
390                                             <span class="label">Expiration date: </span>
391                                             [% IF ( was_renewed ) %]
392                                                 <strong class="reregistrinfo">[% patron.dateexpiry | $KohaDates %]</strong>
393                                             [% ELSIF ( patron.is_expired ) %]
394                                                 <span class="blocker">
395                                                     [% patron.dateexpiry | $KohaDates %]
396                                                     <strong><em>Expired</em></strong>
397                                                     <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% patron.borrowernumber | uri %]&amp;reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]">Edit details</a>
398                                                 </span>
399                                             [% ELSIF ( patron.is_going_to_expire ) %]
400                                                 [% patron.dateexpiry | $KohaDates %]
401                                                 <strong><em>Patron expires soon</em></strong>
402                                                 <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% patron.borrowernumber | uri %]&amp;reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]">Edit details</a>
403                                             [% ELSE %]
404                                                 [% patron.dateexpiry | $KohaDates %]
405                                             [% END %]
406                                         </li>
407                                         <li id="patron-branchname">
408                                             <span class="label">Library: </span>
409                                             [% Branches.GetName( patron.branchcode ) | html %]
410                                         </li>
411
412                                         [% IF Koha.Preference( 'OPACPrivacy') %]
413                                             <li id="patron-privacypref">
414                                                 <span class="label">Privacy pref:</span>
415                                                     [% IF ( patron.privacy == 0 ) %]Forever[% END %]
416                                                     [% IF ( patron.privacy == 1 ) %]Default[% END %]
417                                                     [% IF ( patron.privacy == 2 ) %]Never[% END %]
418                                             </li>
419                                         [% END %]
420
421                                         [% IF ( patron.sort1 ) %]
422                                             <li id="patron-sort1">
423                                                 <span class="label">Sort field 1:</span>
424                                                 [% AuthorisedValues.GetByCode('Bsort1', patron.sort1) | html %]
425                                             </li>
426                                         [% END %]
427                                         [% IF ( patron.sort2 ) %]
428                                             <li id="patron-sort2">
429                                                 <span class="label">Sort field 2:</span>
430                                                 [% AuthorisedValues.GetByCode('Bsort2', patron.sort2) | html %]
431                                             </li>
432                                         [% END %]
433                                         [% UNLESS ( patron.autorenew_checkouts ) %]
434                                             <li id="patron-autorenew_checkouts">
435                                                 <span class="label">Auto-renewal:</span>
436                                                 Patron has opted out
437                                             </li>
438                                         [% END %]
439                                         <li id="patron-username">
440                                             <span class="label">Username: </span>
441                                             [% patron.userid | html %]
442                                         </li>
443                                         <li id="patron-password">
444                                             <span class="label">Password: </span>
445                                             [% IF ( patron.password ) %]
446                                                 *******
447                                             [% ELSE %]
448                                                 <i class="fa fa-exclamation-circle problem" aria-hidden="true"></i> <a href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber | uri %]">Undefined</a>
449                                             [% END %]
450                                         </li>
451                                         [% IF CAN_user_superlibrarian %]
452                                             <li id="patron-password_expiration_date">
453                                                 <span class="label">Password expires:</span>
454                                                 [% IF ( patron.password_expiration_date ) %]
455                                                     [% patron.password_expiration_date | $KohaDates %]
456                                                 [% ELSE %]
457                                                     Never
458                                                 [% END %]
459                                             </li>
460                                         [% END %]
461
462                                         [% IF ( patron.borrowernotes ) %]
463                                             <li id="patron-borrowernotes">
464                                                 <span class="label">Circulation note: </span><br />
465                                                 [% patron.borrowernotes | $raw | html_line_break %]
466                                             </li>
467                                         [% END %]
468
469                                         [% IF ( patron.opacnote ) %]
470                                             <li id="patron-opacnote">
471                                                 <span class="label">OPAC note:</span><br />
472                                                 [% patron.opacnote | html | html_line_break %]
473                                             </li>
474                                         [% END %]
475
476                                         [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
477                                             <li id="patron-checkprev">
478                                                 <span class="label">Check previous checkouts: </span>
479                                                 [% IF ( patron.checkprevcheckout == 'yes' ) %]
480                                                     Yes
481                                                 [% ELSIF ( patron.checkprevcheckout == 'no' ) %]
482                                                     No
483                                                 [% ELSE %]
484                                                     Inherited
485                                                 [% END %]
486                                             </li>
487                                         [% END %]
488
489                                         [% IF Koha.Preference('TranslateNotices') %]
490                                             <li id="patron-translatenotices">
491                                                 <span class="label">Preferred language for notices: </span>
492                                                 [% translated_language | html %]
493                                             </li>
494                                         [% END %]
495                                     </ol>
496                                 </div> [% # /div.rows %]
497                             </div> [% # /div#patron-library-details %]
498
499                             <div id="patron-alternate-address" class="patroninfo-section">
500                                 [% IF ( patron.B_phone || patron.B_email || patron.contactnote || patron.B_address || patron.B_address2 || patron.B_city || patron.B_zipcode || patron.B_country ) %]
501                                     <div class="patroninfo-heading">
502                                         <h3>Alternate address</h3>
503                                         <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=6"><i class="fa fa-pencil"></i> Edit</a>
504                                     </div>
505                                     <div class="address">
506                                         <ul>
507                                             [% PROCESS 'display-alt-address-style' %]
508                                         </ul>
509                                     </div>
510                                     <div class="rows">
511                                         <ol>
512                                             [% IF ( patron.B_phone ) %]
513                                                 <li id="patron-bphone">
514                                                     <span class="label">Phone: </span>
515                                                     <a href="tel:[% patron.B_phone | uri %]">[% patron.B_phone |html  %]</a>
516                                                 </li>
517                                             [% END %]
518
519                                             [% IF ( patron.B_email ) %]
520                                                 <li id="patron-bemail" class="email">
521                                                     <span class="label">Email: </span>
522                                                     <a title="[% patron.B_email | html %]" href="mailto:[% patron.B_email | url %]">[% patron.B_email |html %]</a>
523                                                 </li>
524                                             [% END %]
525
526                                             [% IF ( patron.contactnote ) %]
527                                                 <li id="patron-contactnote">
528                                                     <span class="label">Contact note: </span>
529                                                     [% patron.contactnote |html %]
530                                                 </li>
531                                             [% END %]
532                                         </ol>
533                                     </div>
534                                 [% ELSE %]
535                                     <div class="patroninfo-heading">
536                                       <h3 class="inline">Alternate address</h3>
537                                         <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=6"><i class="fa fa-plus"></i> Add</a>
538                                     </div>
539                                 [% END %]
540                             </div> [% # /div#patron-alternate-address %]
541
542                             <div id="patron-alternative-contact" class="patroninfo-section">
543                                 [% IF ( patron.altcontactsurname || patron.altcontactfirstname || patron.altcontactaddress1 || patron.altcontactaddress2 || patron.altcontactaddress3 || patron.altcontactstate || patron.altcontactzipcode || patron.altcontactcountry || patron.altcontactphone ) %]
544                                     <div class="patroninfo-heading">
545                                         <h3>Alternative contact</h3>
546                                         <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=2"><i class="fa fa-pencil"></i> Edit</a>
547                                     </div>
548                                     <div class="rows">
549                                         <ol>
550                                             [% IF ( patron.altcontactsurname ) %]
551                                                 <li id="patron-altcontactsurname">
552                                                     <span class="label">Surname: </span>
553                                                     [% patron.altcontactsurname | html %]
554                                                 </li>
555                                             [% END %]
556                                             [% IF ( patron.altcontactfirstname ) %]
557                                                 <li id="patron-altcontactfirstname">
558                                                     <span class="label">First name: </span>
559                                                     [% patron.altcontactfirstname | html %]
560                                                 </li>
561                                             [% END %]
562                                             [% IF ( patron.altcontactaddress1 ) %]
563                                                 <li id="patron-altcontactaddress1">
564                                                     <span class="label">Address: </span>
565                                                     [% patron.altcontactaddress1 | html %]
566                                                 </li>
567                                             [% END %]
568                                             [% IF ( patron.altcontactaddress2 ) %]
569                                                 <li id="patron-altcontactaddress2">
570                                                     <span class="label">Address 2: </span>
571                                                     [% patron.altcontactaddress2 | html %]
572                                                 </li>
573                                             [% END %]
574                                             [% IF ( patron.altcontactaddress3 ) %]
575                                                 <li id="patron-altcontactaddress3">
576                                                     <span class="label">City: </span>
577                                                     [% patron.altcontactaddress3 | html %]
578                                                 </li>
579                                             [% END %]
580
581                                             [% IF ( patron.altcontactstate ) %]
582                                                 <li id="patron-altcontactstate">
583                                                     <span class="label">State: </span>
584                                                     [% patron.altcontactstate | html %]
585                                                 </li>
586                                             [% END %]
587                                             [% IF ( patron.altcontactzipcode ) %]
588                                                 <li id="patron-altcontactzipcode">
589                                                     <span class="label">ZIP/Postal code: </span>
590                                                     [% patron.altcontactzipcode | html %]
591                                                 </li>
592                                             [% END %]
593                                             [% IF ( patron.altcontactcountry ) %]
594                                                 <li id="patron-altcontactcountry">
595                                                     <span class="label">Country: </span>
596                                                     [% patron.altcontactcountry | html %]
597                                                 </li>
598                                             [% END %]
599                                             [% IF ( patron.altcontactphone ) %]
600                                                 <li id="patron-altcontactphone">
601                                                     <span class="label">Phone: </span>
602                                                     <a href="tel:[% patron.altcontactphone | url %]">[% patron.altcontactphone | html %]</a>
603                                                 </li>
604                                             [% END %]
605                                         </ol>
606                                     </div> [% # /div.rows %]
607                                 [% ELSE %]
608                                     <div class="patroninfo-heading">
609                                         <h3>Alternative contact</h3>
610                                         <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=2"><i class="fa fa-plus"></i> Add</a>
611                                     </div>
612                                 [% END %]
613                             </div> [% # /div#patron-alternative-contact %]
614
615                             [% IF Koha.Preference('EnableBorrowerFiles') %]
616                                 <div id="patron-files" class="patroninfo-section">
617                                     <div class="patroninfo-heading">
618                                         <h3>Files</h3>
619                                         <a class="btn btn-default btn-xs" href="/cgi-bin/koha/members/files.pl?borrowernumber=[% patron.borrowernumber | uri %]"><i class="fa fa-list"></i> Manage</a>
620
621                                         [% IF ( files ) %]
622                                             <div class="rows">
623                                                 <ol>
624                                                     [% FOREACH f IN files %]
625                                                         <li>
626                                                             <a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% patron.borrowernumber | uri %]&amp;op=download&amp;file_id=[% f.file_id | uri %]">[% f.file_name | html %]</a>
627                                                             [% IF ( f.file_description ) %]
628                                                                 - [% f.file_description | html %]
629                                                             [% END %]
630                                                         </li>
631                                                     [% END # /FOREACH f %]
632                                                 </ol>
633                                             </div>
634                                         [% END # /IF files %]
635
636                                     </div> <!-- /.patroninfo-heading -->
637                                 </div> <!-- /#patron-files -->
638                             [% END # /IF EnableBorrowerFiles %]
639
640                         </div> <!-- /div.col-sm-6 -->
641                     </div> <!-- /div.row -->
642
643                     <div id="finesholdsissues" class="toptabs">
644                         <ul>
645                             <li>
646                                 <a href="#checkouts">Checkouts ([% issuecount || 0 | html %])</a>
647                             </li>
648                             [% IF relatives_issues_count %]
649                                 <li>
650                                     <a href="#relatives-issues" id="relatives-issues-tab">Relatives' checkouts ([% relatives_issues_count | html %])</a>
651                                 </li>
652                             [% END %]
653                             [% IF ( fines ) %]
654                                 <li id="finestab">
655                                     <a href="#finesandcharges">Charges ([% fines | $Price %])</a>
656                                 </li>
657                             [% END %]
658                             [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
659                                 <li>
660                                         <a href="#reserves" id="holds-tab">Holds ([% holds_count || 0 | html %])</a>
661                                 </li>
662                             [% END %]
663
664                             [% IF Koha.Preference('UseRecalls') %]
665                                 <li>
666                                     <a href="#recalls" id="recalls-tab">Recalls ([% recalls.count || 0 | html %])</a>
667                                 </li>
668                             [% END %]
669
670                             [% IF Koha.Preference('ArticleRequests') %]
671                                 [% SET article_requests = Context.Scalar( Context.Scalar( patron, 'article_requests' ), 'filter_by_current') %]
672                                 <li>
673                                     <a href="#article-requests" id="article-requests-tab">Article requests ([% article_requests.count || 0 | html %])</a>
674                                 </li>
675                             [% END %]
676
677                             [% IF Koha.Preference('ClaimReturnedLostValue') %]
678                                 <li>
679                                     [% IF ( patron.return_claims.count ) %]
680                                         <a href="#return-claims" id="return-claims-tab">
681                                             Claims
682                                             ([% IF patron.return_claims.resolved.count == 0 %]
683                                                 <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
684                                             [% ELSE %]
685                                                 <span title="Resolved claims" class="label label-success" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
686                                             [% END %]
687                                             [% IF patron.return_claims.unresolved.count == 0 %]
688                                                 <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
689                                             [% ELSE %]
690                                                 <span title="Unresolved claims" class="label label-warning" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
691                                             [% END %])
692                                         </a>
693                                     [% ELSE %]
694                                         <a href="#return-claims" id="return-claims-tab">
695                                             Claims
696                                             (<span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">0</span>
697                                             <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">0</span>)
698                                         </a>
699                                     [% END %]
700                                 </li>
701                             [% END %]
702
703                             <li>
704                                 <a id="debarments-tab-link" href="#reldebarments">Restrictions ([% debarments.size || 0 | html %])</a>
705                             </li>
706
707                             [% SET enrollments = patron.get_club_enrollments %]
708                             [% SET enrollable  = patron.get_enrollable_clubs(0) %] <!-- 0 => not OPAC -->
709                             [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
710                                 <li>
711                                     <a id="clubs-tab-link" href="#clubs-tab">
712                                         Clubs ([% enrollments.count | html %]/[% enrollable.count | html %])
713                                     </a>
714                                 </li>
715                             [% END %]
716                         </ul>
717
718                         [% INCLUDE "checkouts-table.inc" %]
719
720                         [% INCLUDE "relatives-issues-table.inc" %]
721
722                         [% IF ( fines ) %]
723                             <div id="finesandcharges">
724                                 [% IF ( fines ) %]
725                                     <p>Total due: [% fines | $Price %]</p>
726                                 [% ELSE %]
727                                     <p>No outstanding charges</p>
728                                 [% END %]
729                             </div>
730                         [% END %]
731
732                         [% IF CAN_user_clubs && ( enrollments.count || enrollable.count ) %]
733                             <div id="clubs-tab">
734                                 Loading...
735                             </div>
736                         [% END %]
737
738                         [% INCLUDE borrower_debarments.inc %]
739
740                         [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
741                             <div id="reserves">
742                                 [% IF ( holds_count ) %]
743                                     <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
744                                         <input type="hidden" name="from" value="circ" />
745                                         <table id="holds-table" style="width: 100% !Important;">
746                                             <thead>
747                                                 <tr>
748                                                     <th>Hold date</th>
749                                                     <th>Title</th>
750                                                     <th>Call number</th>
751                                                     <th>Item type</th>
752                                                     <th>Barcode</th>
753                                                     <th>Pickup at</th>
754                                                     <th>Expiration</th>
755                                                     <th>Priority</th>
756                                                     <th>Delete?</th>
757                                                     <th>Suspend?</th>
758                                                     <th>Status</th>
759                                                 </tr>
760                                             </thead>
761                                         </table>
762
763                                         <fieldset class="action">
764                                             <input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
765
766                                             [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
767                                             [% IF hold_cancellation.count %]
768                                                 <label for="cancellation-reason">Cancellation reason:</label>
769                                                 <select name="cancellation-reason">
770                                                     <option value="">No reason given</option>
771                                                     [% FOREACH reason IN hold_cancellation %]
772                                                         <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
773                                                     [% END %]
774                                                 </select>
775                                             [% END %]
776                                         </fieldset>
777                                     </form>
778
779                                     [% IF Koha.Preference('SuspendHoldsIntranet') %]
780                                         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
781                                             <fieldset class="action">
782                                                 <input type="hidden" name="from" value="borrower" />
783                                                 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
784                                                 <input type="submit" value="Suspend all holds" />
785
786                                                 [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
787                                                     <label for="suspend_until">until</label>
788                                                     <input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr" data-flatpickr-futuredate="true"/>
789                                                     <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
790                                                 [% END %]
791                                             </fieldset>
792                                         </form>
793
794                                         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
795                                             <fieldset class="action">
796                                                 <input type="hidden" name="from" value="borrower" />
797                                                 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
798                                                 <input type="hidden" name="suspend" value="0" />
799                                                 <input type="submit" value="Resume all suspended holds" />
800                                             </fieldset>
801                                         </form>
802                                     [% END # IF SuspendHoldsIntranet %]
803
804                                 [% ELSE %]
805                                     <p>Patron has nothing on hold.</p>
806                                 [% END %]
807                             </div> [% # /div#reserves %]
808                         [% END %]
809
810                         [% IF Koha.Preference('UseRecalls') %]
811                             <div id="recalls">
812                                 [% INCLUDE 'recalls.inc' %]
813                             </div>
814                         [% END %]
815
816                         [% IF Koha.Preference('ClaimReturnedLostValue') %]
817                             [% INCLUDE 'patron-return-claims.inc' %]
818                         [% END %]
819
820                         [% IF Koha.Preference('ArticleRequests') %]
821                             [% INCLUDE 'patron-article-requests.inc' %]
822                         [% END %]
823
824                     </div> <!-- /div#finesholdsissues -->
825                 </main>
826             </div> <!-- /.col-sm-10.col-sm-push-2 -->
827
828             <div class="col-sm-2 col-sm-pull-10">
829                 <aside>
830                     [% INCLUDE 'circ-menu.inc' %]
831                 </aside>
832             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
833         </div> <!-- /.row -->
834
835         [% IF Koha.Preference('ClaimReturnedLostValue') %]
836             [% INCLUDE 'modals/resolve_return_claim.inc' %]
837         [% END %]
838
839 [% MACRO jsinclude BLOCK %]
840     [% INCLUDE 'datatables.inc' %]
841     [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
842     [% INCLUDE 'columns_settings.inc' %]
843     [% INCLUDE 'select2.inc' %]
844     [% INCLUDE 'js-date-format.inc' %]
845     <script>
846         /* Set some variable needed in circulation.js */
847         var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
848         var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
849         var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
850         var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
851         var UnseenRenewals = "[% Koha.Preference('UnseenRenewals') | html %]";
852         var interface = "[% interface | html %]";
853         var theme = "[% theme | html %]";
854         var borrowernumber = "[% patron.borrowernumber | html %]";
855         var branchcode = "[% Branches.GetLoggedInBranchcode() | html %]";
856         var exports_enabled = "[% Koha.Preference('ExportCircHistory') | html %]";
857         var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 | html %]
858         var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 | html %];
859         var AllowRenewalOnHoldOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalOnHoldOverride') )? 1: 0 | html %];
860         var script = "moremember";
861         var relatives_borrowernumbers = new Array();
862         [% FOREACH b IN relatives_borrowernumbers %]
863             relatives_borrowernumbers.push("[% b | html %]");
864         [% END %]
865         var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
866     </script>
867     [% Asset.js("js/pages/circulation.js") | $raw %]
868     [% Asset.js("js/checkouts.js") | $raw %]
869     [% IF Koha.Preference('ClaimReturnedLostValue') %]
870         [% Asset.js("js/resolve_claim_modal.js") | $raw %]
871     [% END %]
872     [% Asset.js("js/holds.js") | $raw %]
873     [% INCLUDE 'calendar.inc' %]
874     [% INCLUDE 'str/members-menu.inc' %]
875     [% Asset.js("js/members-menu.js") | $raw %]
876     [% Asset.js("js/recalls.js") | $raw %]
877     <script>
878
879         table_settings_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'issues-table', 'json' ) | $raw %]
880
881         $(document).ready(function() {
882             $("#info_digests").tooltip();
883
884             if ( $('#clubs-tab').length ) {
885                 $('#clubs-tab-link').on('click', function() {
886                     $('#clubs-tab').text(_("Loading..."));
887                     $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% patron.borrowernumber | html %]');
888                 });
889             }
890
891             $('#finesholdsissues').tabs({
892                 // Correct table sizing for tables hidden in tabs
893                 // http://www.datatables.net/examples/api/tabs_and_scrolling.html
894                 "show": function(event, ui) {
895                     var oTable = $('div.dataTables_wrapper>table', ui.panel).dataTable();
896                     if ( oTable.length > 0 ) {
897                         oTable.fnAdjustColumnSizing();
898                     }
899                 },
900                 "activate": function( event, ui ) {
901                     $("a", ui.newTab ).click();
902                 }
903             } );
904
905             $("#view_restrictions").on("click",function(){
906                 $('#debarments-tab-link').click();
907             });
908          });
909         function uncheck_sibling(me){
910             nodename=me.getAttribute("name");
911             if (nodename =="barcodes[]"){
912                 var Node=me.parentNode.previousSibling;
913                 while (Node.nodeName!="TD"){Node=Node.previousSibling}
914                 var Nodes=Node.childNodes;
915                 for (var i=0;i < Nodes.length;i++){
916                     if (Nodes[i].nodeName=="INPUT" && Nodes[i].getAttribute("type")=="checkbox"){
917                         Nodes[i].checked=false;
918                     }
919                 }
920             } else {
921                 var Node=me.parentNode.nextSibling;
922                 while (Node.nodeName!="TD"){Node=Node.nextSibling}
923                 var Nodes=Node.childNodes;
924                 for (var i=0;i<Nodes.length;i++){
925                     if (Nodes[i].nodeName=="INPUT" && Nodes[i].getAttribute("type")=="checkbox"){
926                       Nodes[i].checked=false;
927                     }
928                }
929             }
930         }
931     </script>
932 [% END %]
933
934 [% INCLUDE 'intranet-bottom.inc' %]