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