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