Bug 30952: Staff interface redesign (header)
[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     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
31         <ol>
32             <li>
33                 <a href="/cgi-bin/koha/mainpage.pl"><i class="fa fa-home"></i></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                         <div id="patron_messages" class="circmessage attention">
98                             [% INCLUDE 'patron_messages.inc' moremember = 1 %]
99                         </div>
100
101                         <h1>[% INCLUDE 'patron-title.inc' no_html = 1 %]</h1>
102
103                         [% IF patron.pronouns %]
104                             <div class="patronpronouns">([% patron.pronouns | html %])</div>
105                         [% END %]
106
107                         <div class="col-sm-6">
108
109                             <div id="patron-information" class="patroninfo-section">
110
111                                 <div class="patroninfo-heading">
112                                     <h3>Contact information</h3>
113                                     [% IF ( guarantor.borrowernumber ) %]
114                                         <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>
115                                     [% ELSE %]
116                                         <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>
117                                     [% END %]
118                                 </div>
119
120                                 [% IF ( patron.othernames ) %]<div>&ldquo;[% patron.othernames | html %]&rdquo;</div>[% END %]
121
122                                 <div class="address">
123                                     <ul>
124                                         [% PROCESS 'display-address-style' %]
125                                     </ul>
126                                 </div>
127
128                                 <div class="rows">
129                                     <ol>
130                                         [% IF ( patron.phone ) %]
131                                             <li>
132                                                 <span class="label">Primary phone: </span>
133                                                 <a href="tel:[% patron.phone | uri %]">[% patron.phone | html %]</a>
134                                             </li>
135                                         [% END %]
136                                         [% IF ( patron.phonepro ) %]
137                                             <li>
138                                                 <span class="label">Secondary phone: </span>
139                                                 <a href="tel:[% patron.phonepro | uri %]">[% patron.phonepro | html %]</a>
140                                             </li>
141                                         [% END %]
142                                         [% IF ( patron.mobile ) %]
143                                             <li>
144                                                 <span class="label">Other phone: </span>
145                                                 <a href="tel:[% patron.mobile | uri %]">[% patron.mobile | html %]</a>
146                                             </li>
147                                         [% END %]
148                                         [% IF ( patron.fax ) %]
149                                             <li>
150                                                 <span class="label">Fax: </span>
151                                                 [% patron.fax | html %]
152                                             </li>
153                                         [% END %]
154                                         [% IF ( patron.email ) %]
155                                             <li class="email">
156                                                 <span class="label">Primary email:</span>
157                                                 <a title="[% patron.email | html %]" href="mailto:[% patron.email | url %]">[% patron.email | html %]</a>
158                                             </li>
159                                         [% END %]
160                                         [% IF ( patron.emailpro ) %]
161                                             <li class="email">
162                                                 <span class="label">Secondary email: </span>
163                                                 <a title="[% patron.emailpro | html %]" href="mailto:[% patron.emailpro | url %]">[% patron.emailpro | html %]</a>
164                                             </li>
165                                         [% END %]
166                                         [% UNLESS ( I ) %]
167                                             [% IF ( patron.initials ) %]
168                                                 <li>
169                                                     <span class="label">Initials: </span>
170                                                     [% patron.initials | html %]
171                                                 </li>
172                                             [% END %]
173                                             [% IF ( patron.dateofbirth ) %]
174                                                 <li>
175                                                     <span class="label">Date of birth:</span>
176                                                     [% INCLUDE 'patron-age.inc' %]
177                                                 </li>
178                                             [% END %]
179                                             [% IF ( patron.sex ) %]
180                                                 <li>
181                                                     <span class="label">Gender:</span>
182                                                     [% 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 %]
183                                                 </li>
184                                             [% END %]
185                                         [% END %]
186                                          <li id="patron-privacyguarantor">
187                                             <span class="label">Show checkouts to guarantor</span>
188                                             [% IF patron.privacy_guarantor_checkouts %]
189                                                 Yes
190                                             [% ELSE %]
191                                                 No
192                                             [% END %]
193                                         </li>
194
195                                         <li id="patron-privacy_guarantor_fines">
196                                             <span class="label">Show fines to guarantor</span>
197                                             [% IF patron.privacy_guarantor_fines %]
198                                                 Yes
199                                             [% ELSE %]
200                                                 No
201                                             [% END %]
202                                         </li>
203
204                                         [% IF guarantees %]
205                                             <li>
206                                                 <span class="label">Guarantees:</span>
207                                                 <ul>
208                                                     [% FOREACH guarantee IN guarantees %]
209                                                         [% IF logged_in_user.can_see_patron_infos( guarantee ) %]
210                                                             <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber | uri %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></li>
211                                                         [% ELSE %]
212                                                             <li>[% guarantee.firstname | html %] [% guarantee.surname | html %]</li>
213                                                         [% END %]
214                                                     [% END %]
215                                                 </ul>
216                                             </li>
217                                         [% ELSIF guarantor_relationships.count > 0 OR ( patron.contactfirstname OR patron.contactname ) %]
218                                                 <li>
219                                                 [% IF guarantor_relationships.count > 1 OR guarantor_relationships.count == 0 AND ( patron.contactfirstname OR patron.contactname ) %]
220                                                     <span class="label">Guarantors:</span>
221                                                 [% ELSE %]
222                                                     <span class="label">Guarantor:</span>
223                                                 [% END %]
224                                                     <ul>
225                                                     [% FOREACH gr IN guarantor_relationships %]
226                                                         [% SET guarantor = gr.guarantor %]
227                                                         [% IF logged_in_user.can_see_patron_infos( guarantor ) %]
228                                                             <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>
229                                                         [% END %]
230                                                     [% END %]
231                                                     [% IF patron.contactfirstname OR patron.contactname %]
232                                                         <li>[% patron.contactfirstname | html %] [% patron.contactname | html %][% IF patron.relationship %] ([% patron.relationship | html %])[% END %]</li>
233                                                     [% END %]
234                                                     </ul>
235                                                 </li>
236                                         [% END %]
237
238                                         [% IF ( patron.primary_contact_method ) %]
239                                             <li>
240                                                 <span class="label">Main contact method: </span>
241                                                 [% SWITCH patron.primary_contact_method %]
242                                                     [% CASE 'phone' %]
243                                                         <span>Primary phone</span>
244                                                     [% CASE 'phonepro' %]
245                                                         <span>Secondary phone</span>
246                                                     [% CASE 'mobile' %]
247                                                         <span>Other phone</span>
248                                                     [% CASE 'email' %]
249                                                         <span>Primary email</span>
250                                                     [% CASE 'emailpro' %]
251                                                         <span>Secondary email</span>
252                                                     [% CASE 'fax' %]
253                                                         <span>Fax</span>
254                                                 [% END %]
255                                             </li>
256                                         [% END %]
257                                     </ol>
258                                 </div> [% # /div.rows %]
259                             </div> [% # /div#patron-information %]
260
261                             [% IF Koha.Preference('HouseboundModule') %]
262                                 <div id="houseboundroles" class="patroninfo-section">
263                                     [% IF ( housebound_role.housebound_chooser == 1 OR housebound_role.housebound_deliverer == 1 ) %]
264                                         <div class="patroninfo-heading">
265                                             <h3>Housebound roles</h3>
266                                             <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>
267                                         </div>
268                                         <div class="rows">
269                                             <ol>
270                                                 <li>
271                                                     <span class="label">Chooser:</span>
272                                                     [% IF ( housebound_role.housebound_chooser == 1 ) %]
273                                                         Yes
274                                                     [% ELSE %]
275                                                         No
276                                                     [% END %]
277                                                 </li>
278                                                 <li>
279                                                     <span class="label">Deliverer:</span>
280                                                     [% IF ( housebound_role.housebound_deliverer == 1 ) %]
281                                                         Yes
282                                                     [% ELSE %]
283                                                         No
284                                                     [% END %]
285                                                 </li>
286                                             </ol>
287                                         </div>
288                                     [% ELSE %]
289                                         <div class="patroninfo-heading">
290                                             <h3>Housebound roles</h3>
291                                             <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>
292                                         </div>
293                                     [% END %]
294                                 </div> [% #/ div#houseboundroles %]
295                             [% END %]
296
297                             [% IF Koha.Preference('ExtendedPatronAttributes') %]
298                                 [% UNLESS ( no_patron_attribute_types ) %]
299                                     <div id="patron-extended-attributes" class="patroninfo-section">
300                                         [% IF ( attributes_loop ) %]
301                                             <div class="patroninfo-heading">
302                                                 <h3>Additional attributes and identifiers</h3>
303                                                 <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>
304                                             </div>
305                                             [% FOREACH attribute IN attributes_loop %]
306                                                 [% IF attribute.class %]
307                                                     <div id="aai_[% attribute.class | html %]" class="rows">
308                                                 [% ELSE %]
309                                                     <div id="aai" class="rows">
310                                                 [% END %]
311                                                     <h4>[% attribute.lib | html %]</h4>
312                                                     <ol>
313                                                         [% FOREACH item IN attribute.items %]
314                                                             <li>
315                                                                 <span class="label">[% item.type.description | html %]: </span>
316                                                                 [% item.description | html_line_break %]
317                                                             </li>
318                                                         [% END %]
319                                                     </ol>
320                                                 </div>
321                                             [% END %]
322                                             <div class="action">
323                                             </div>
324                                         [% ELSE %]
325                                             <div class="patroninfo-heading">
326                                                 <h3>Additional attributes and identifiers</h3>
327                                                 <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>
328                                             </div>
329                                         [% END %]
330                                     </div> [% # /div#patron-extended-attributes %]
331                                 [% END %]
332                             [% END %]
333
334                             [% IF ( EnhancedMessagingPreferences ) %]
335                                 <div id="patron-messaging-prefs" class="patroninfo-section">
336                                     <div class="patroninfo-heading">
337                                         <h3>Patron messaging preferences</h3>
338                                         <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>
339                                     </div>
340                                     [% INCLUDE 'messaging-preference-form.inc' %]
341                                     [% IF Koha.Preference('SMSSendDriver') %]
342                                         <div class="rows">
343                                             <ol>
344                                                 <li>
345                                                     <span class="label">SMS number:</span>
346                                                     <a href="sms:[% patron.smsalertnumber | uri %]">[% patron.smsalertnumber | html %]</a>
347                                                 </li>
348                                                 [% IF Koha.Preference( 'SMSSendDriver') == 'Email' %]
349                                                 <li>
350                                                     <span class="label">SMS provider:</span>
351                                                     [% patron.sms_provider.name | html %]
352                                                 </li>
353                                                 [% END %]
354                                             </ol>
355                                         </div>
356                                     [% END %]
357                                 </div> [% # /div#patron-messaging-prefs %]
358                             [% END %]
359
360                         </div> <!-- /.col-sm-6 -->
361
362                         <div class="col-sm-6">
363                             <div id="patron-library-details" class="patroninfo-section">
364                                 <div class="patroninfo-heading">
365                                     <h3>Library use</h3>
366                                     <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>
367                                 </div>
368                                 <div class="rows">
369                                     <ol>
370                                         <li id="patron-cardnumber">
371                                             <span class="label">Card number: </span>
372                                             [% patron.cardnumber | html %]
373                                         </li>
374                                         <li id="patron-borrowernumber">
375                                             <span class="label">Borrowernumber: </span>
376                                             [% patron.borrowernumber | html %]
377                                         </li>
378                                         <li id="patron-categorydescription">
379                                             <span class="label">Category: </span>
380                                             [% patron.category.description | html %] ([% patron.categorycode | html %])
381                                         </li>
382                                         <li id="patron-dateenrolled">
383                                             <span class="label">Registration date: </span>
384                                             [% patron.dateenrolled | $KohaDates %]
385                                         </li>
386
387                                         [% IF ( patron.date_renewed ) %]
388                                             <li id="patron-daterenewed">
389                                                 <span class="label">Renewal date: </span>
390                                                 [% patron.date_renewed | $KohaDates %]
391                                             </li>
392                                         [% END %]
393
394                                         <li id="patron-expirationdate">
395                                             <span class="label">Expiration date: </span>
396                                             [% IF ( was_renewed ) %]
397                                                 <strong class="reregistrinfo">[% patron.dateexpiry | $KohaDates %]</strong>
398                                             [% ELSIF ( patron.is_expired ) %]
399                                                 <span class="blocker">
400                                                     [% patron.dateexpiry | $KohaDates %]
401                                                     <strong><em>Expired</em></strong>
402                                                     <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% patron.borrowernumber | uri %]&amp;reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]">Edit details</a>
403                                                 </span>
404                                             [% ELSIF ( patron.is_going_to_expire ) %]
405                                                 [% patron.dateexpiry | $KohaDates %]
406                                                 <strong><em>Patron expires soon</em></strong>
407                                                 <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>
408                                             [% ELSE %]
409                                                 [% patron.dateexpiry | $KohaDates %]
410                                             [% END %]
411                                         </li>
412                                         <li id="patron-branchname">
413                                             <span class="label">Library: </span>
414                                             [% Branches.GetName( patron.branchcode ) | html %]
415                                         </li>
416
417                                         [% IF Koha.Preference( 'OPACPrivacy') %]
418                                             <li id="patron-privacypref">
419                                                 <span class="label">Privacy pref:</span>
420                                                     [% IF ( patron.privacy == 0 ) %]<span>Forever</span>[% END %]
421                                                     [% IF ( patron.privacy == 1 ) %]<span>Default</span>[% END %]
422                                                     [% IF ( patron.privacy == 2 ) %]<span>Never</span>[% END %]
423                                             </li>
424                                         [% END %]
425
426                                         [% IF ( patron.sort1 ) %]
427                                             <li id="patron-sort1">
428                                                 <span class="label">Sort field 1:</span>
429                                                 [% AuthorisedValues.GetByCode('Bsort1', patron.sort1) | html %]
430                                             </li>
431                                         [% END %]
432                                         [% IF ( patron.sort2 ) %]
433                                             <li id="patron-sort2">
434                                                 <span class="label">Sort field 2:</span>
435                                                 [% AuthorisedValues.GetByCode('Bsort2', patron.sort2) | html %]
436                                             </li>
437                                         [% END %]
438                                         [% UNLESS ( patron.autorenew_checkouts ) %]
439                                             <li id="patron-autorenew_checkouts">
440                                                 <span class="label">Auto-renewal:</span>
441                                                 Patron has opted out
442                                             </li>
443                                         [% END %]
444                                         <li id="patron-username">
445                                             <span class="label">Username: </span>
446                                             [% patron.userid | html %]
447                                         </li>
448                                         <li id="patron-password">
449                                             <span class="label">Password: </span>
450                                             [% IF ( patron.password ) %]
451                                                 *******
452                                             [% ELSE %]
453                                                 <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>
454                                             [% END %]
455                                         </li>
456                                         [% IF CAN_user_superlibrarian %]
457                                             <li id="patron-password_expiration_date">
458                                                 <span class="label">Password expires:</span>
459                                                 [% IF ( patron.password_expiration_date ) %]
460                                                     [% patron.password_expiration_date | $KohaDates %]
461                                                 [% ELSE %]
462                                                     <span>Never</span>
463                                                 [% END %]
464                                             </li>
465                                         [% END %]
466
467                                         [% IF ( patron.borrowernotes ) %]
468                                             <li id="patron-borrowernotes">
469                                                 <span class="label">Circulation note: </span><br />
470                                                 [% patron.borrowernotes | $raw | html_line_break %]
471                                             </li>
472                                         [% END %]
473
474                                         [% IF ( patron.opacnote ) %]
475                                             <li id="patron-opacnote">
476                                                 <span class="label">OPAC note:</span><br />
477                                                 [% patron.opacnote | html | html_line_break %]
478                                             </li>
479                                         [% END %]
480
481                                         [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
482                                             <li id="patron-checkprev">
483                                                 <span class="label">Check previous checkouts: </span>
484                                                 [% IF ( patron.checkprevcheckout == 'yes' ) %]
485                                                     <span>Yes</span>
486                                                 [% ELSIF ( patron.checkprevcheckout == 'no' ) %]
487                                                     <span>No</span>
488                                                 [% ELSE %]
489                                                     <span>Inherited</span>
490                                                 [% END %]
491                                             </li>
492                                         [% END %]
493
494                                         [% IF Koha.Preference('TranslateNotices') %]
495                                             <li id="patron-translatenotices">
496                                                 <span class="label">Preferred language for notices: </span>
497                                                 [% translated_language | html %]
498                                             </li>
499                                         [% END %]
500                                     </ol>
501                                 </div> [% # /div.rows %]
502                             </div> [% # /div#patron-library-details %]
503
504                             <div id="patron-alternate-address" class="patroninfo-section">
505                                 [% IF ( patron.B_phone || patron.B_email || patron.contactnote || patron.B_address || patron.B_address2 || patron.B_city || patron.B_zipcode || patron.B_country ) %]
506                                     <div class="patroninfo-heading">
507                                         <h3>Alternate address</h3>
508                                         <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>
509                                     </div>
510                                     <div class="address">
511                                         <ul>
512                                             [% PROCESS 'display-alt-address-style' %]
513                                         </ul>
514                                     </div>
515                                     <div class="rows">
516                                         <ol>
517                                             [% IF ( patron.B_phone ) %]
518                                                 <li id="patron-bphone">
519                                                     <span class="label">Phone: </span>
520                                                     <a href="tel:[% patron.B_phone | uri %]">[% patron.B_phone |html  %]</a>
521                                                 </li>
522                                             [% END %]
523
524                                             [% IF ( patron.B_email ) %]
525                                                 <li id="patron-bemail" class="email">
526                                                     <span class="label">Email: </span>
527                                                     <a title="[% patron.B_email | html %]" href="mailto:[% patron.B_email | url %]">[% patron.B_email |html %]</a>
528                                                 </li>
529                                             [% END %]
530
531                                             [% IF ( patron.contactnote ) %]
532                                                 <li id="patron-contactnote">
533                                                     <span class="label">Contact note: </span>
534                                                     [% patron.contactnote |html %]
535                                                 </li>
536                                             [% END %]
537                                         </ol>
538                                     </div>
539                                 [% ELSE %]
540                                     <div class="patroninfo-heading">
541                                       <h3 class="inline">Alternate address</h3>
542                                         <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>
543                                     </div>
544                                 [% END %]
545                             </div> [% # /div#patron-alternate-address %]
546
547                             <div id="patron-alternative-contact" class="patroninfo-section">
548                                 [% IF ( patron.altcontactsurname || patron.altcontactfirstname || patron.altcontactaddress1 || patron.altcontactaddress2 || patron.altcontactaddress3 || patron.altcontactstate || patron.altcontactzipcode || patron.altcontactcountry || patron.altcontactphone ) %]
549                                     <div class="patroninfo-heading">
550                                         <h3>Alternative contact</h3>
551                                         <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>
552                                     </div>
553                                     <div class="rows">
554                                         <ol>
555                                             [% IF ( patron.altcontactsurname ) %]
556                                                 <li id="patron-altcontactsurname">
557                                                     <span class="label">Surname: </span>
558                                                     [% patron.altcontactsurname | html %]
559                                                 </li>
560                                             [% END %]
561                                             [% IF ( patron.altcontactfirstname ) %]
562                                                 <li id="patron-altcontactfirstname">
563                                                     <span class="label">First name: </span>
564                                                     [% patron.altcontactfirstname | html %]
565                                                 </li>
566                                             [% END %]
567                                             [% IF ( patron.altcontactaddress1 ) %]
568                                                 <li id="patron-altcontactaddress1">
569                                                     <span class="label">Address: </span>
570                                                     [% patron.altcontactaddress1 | html %]
571                                                 </li>
572                                             [% END %]
573                                             [% IF ( patron.altcontactaddress2 ) %]
574                                                 <li id="patron-altcontactaddress2">
575                                                     <span class="label">Address 2: </span>
576                                                     [% patron.altcontactaddress2 | html %]
577                                                 </li>
578                                             [% END %]
579                                             [% IF ( patron.altcontactaddress3 ) %]
580                                                 <li id="patron-altcontactaddress3">
581                                                     <span class="label">City: </span>
582                                                     [% patron.altcontactaddress3 | html %]
583                                                 </li>
584                                             [% END %]
585
586                                             [% IF ( patron.altcontactstate ) %]
587                                                 <li id="patron-altcontactstate">
588                                                     <span class="label">State: </span>
589                                                     [% patron.altcontactstate | html %]
590                                                 </li>
591                                             [% END %]
592                                             [% IF ( patron.altcontactzipcode ) %]
593                                                 <li id="patron-altcontactzipcode">
594                                                     <span class="label">ZIP/Postal code: </span>
595                                                     [% patron.altcontactzipcode | html %]
596                                                 </li>
597                                             [% END %]
598                                             [% IF ( patron.altcontactcountry ) %]
599                                                 <li id="patron-altcontactcountry">
600                                                     <span class="label">Country: </span>
601                                                     [% patron.altcontactcountry | html %]
602                                                 </li>
603                                             [% END %]
604                                             [% IF ( patron.altcontactphone ) %]
605                                                 <li id="patron-altcontactphone">
606                                                     <span class="label">Phone: </span>
607                                                     <a href="tel:[% patron.altcontactphone | url %]">[% patron.altcontactphone | html %]</a>
608                                                 </li>
609                                             [% END %]
610                                         </ol>
611                                     </div> [% # /div.rows %]
612                                 [% ELSE %]
613                                     <div class="patroninfo-heading">
614                                         <h3>Alternative contact</h3>
615                                         <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>
616                                     </div>
617                                 [% END %]
618                             </div> [% # /div#patron-alternative-contact %]
619
620                             [% IF Koha.Preference('EnableBorrowerFiles') %]
621                                 <div id="patron-files" class="patroninfo-section">
622                                     <div class="patroninfo-heading">
623                                         <h3>Files</h3>
624                                         <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>
625
626                                         [% IF ( files ) %]
627                                             <div class="rows">
628                                                 <ol>
629                                                     [% FOREACH f IN files %]
630                                                         <li>
631                                                             <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>
632                                                             [% IF ( f.file_description ) %]
633                                                                 - [% f.file_description | html %]
634                                                             [% END %]
635                                                         </li>
636                                                     [% END # /FOREACH f %]
637                                                 </ol>
638                                             </div>
639                                         [% END # /IF files %]
640
641                                     </div> <!-- /.patroninfo-heading -->
642                                 </div> <!-- /#patron-files -->
643                             [% END # /IF EnableBorrowerFiles %]
644
645                         </div> <!-- /div.col-sm-6 -->
646                     </div> <!-- /div.row -->
647
648                     <div id="finesholdsissues" class="toptabs">
649                         <ul>
650                             <li>
651                                 <a href="#checkouts">Checkouts ([% issuecount || 0 | html %])</a>
652                             </li>
653                             [% IF relatives_issues_count %]
654                                 <li>
655                                     <a href="#relatives-issues" id="relatives-issues-tab">Relatives' checkouts ([% relatives_issues_count | html %])</a>
656                                 </li>
657                             [% END %]
658                             [% IF ( fines ) %]
659                                 <li id="finestab">
660                                     <a href="#finesandcharges">Charges ([% fines | $Price %])</a>
661                                 </li>
662                             [% END %]
663                             [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
664                                 <li>
665                                         <a href="#reserves" id="holds-tab">Holds ([% holds_count || 0 | html %])</a>
666                                 </li>
667                             [% END %]
668
669                             [% IF Koha.Preference('UseRecalls') %]
670                                 <li>
671                                     <a href="#recalls" id="recalls-tab">Recalls ([% recalls.count || 0 | html %])</a>
672                                 </li>
673                             [% END %]
674
675                             [% IF Koha.Preference('ArticleRequests') %]
676                                 [% SET article_requests = Context.Scalar( Context.Scalar( patron, 'article_requests' ), 'filter_by_current') %]
677                                 <li>
678                                     <a href="#article-requests" id="article-requests-tab">Article requests ([% article_requests.count || 0 | html %])</a>
679                                 </li>
680                             [% END %]
681
682                             [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
683                                 <li>
684                                     [% IF ( patron.return_claims.count ) %]
685                                         <a href="#return-claims" id="return-claims-tab">
686                                             Claims
687                                             ([% IF patron.return_claims.resolved.count == 0 %]
688                                                 <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
689                                             [% ELSE %]
690                                                 <span title="Resolved claims" class="label label-success" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
691                                             [% END %]
692                                             [% IF patron.return_claims.unresolved.count == 0 %]
693                                                 <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
694                                             [% ELSE %]
695                                                 <span title="Unresolved claims" class="label label-warning" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
696                                             [% END %])
697                                         </a>
698                                     [% ELSE %]
699                                         <a href="#return-claims" id="return-claims-tab">
700                                             Claims
701                                             (<span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">0</span>
702                                             <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">0</span>)
703                                         </a>
704                                     [% END %]
705                                 </li>
706                             [% END %]
707
708                             <li>
709                                 <a id="debarments-tab-link" href="#reldebarments">Restrictions ([% debarments.size || 0 | html %])</a>
710                             </li>
711
712                             [% SET enrollments = patron.get_club_enrollments %]
713                             [% SET enrollable  = patron.get_enrollable_clubs(0) %] <!-- 0 => not OPAC -->
714                             [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
715                                 <li>
716                                     <a id="clubs-tab-link" href="#clubs-tab">
717                                         Clubs ([% enrollments.count | html %]/[% enrollable.count | html %])
718                                     </a>
719                                 </li>
720                             [% END %]
721                         </ul>
722
723                         [% INCLUDE "checkouts-table.inc" %]
724
725                         [% INCLUDE "relatives-issues-table.inc" %]
726
727                         [% IF ( fines ) %]
728                             <div id="finesandcharges">
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">
739                                 Loading...
740                             </div>
741                         [% END %]
742
743                         [% INCLUDE borrower_debarments.inc %]
744
745                         [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
746                             <div id="reserves">
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" 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" 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">
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
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').tabs({
898                 // Correct table sizing for tables hidden in tabs
899                 // http://www.datatables.net/examples/api/tabs_and_scrolling.html
900                 "show": function(event, ui) {
901                     var oTable = $('div.dataTables_wrapper>table', ui.panel).dataTable();
902                     if ( oTable.length > 0 ) {
903                         oTable.fnAdjustColumnSizing();
904                     }
905                 },
906                 "activate": function( event, ui ) {
907                     $("a", ui.newTab ).click();
908                 }
909             } );
910
911             $("#view_restrictions").on("click",function(){
912                 $('#debarments-tab-link').click();
913             });
914          });
915         function uncheck_sibling(me){
916             nodename=me.getAttribute("name");
917             if (nodename =="barcodes[]"){
918                 var Node=me.parentNode.previousSibling;
919                 while (Node.nodeName!="TD"){Node=Node.previousSibling}
920                 var Nodes=Node.childNodes;
921                 for (var i=0;i < Nodes.length;i++){
922                     if (Nodes[i].nodeName=="INPUT" && Nodes[i].getAttribute("type")=="checkbox"){
923                         Nodes[i].checked=false;
924                     }
925                 }
926             } else {
927                 var Node=me.parentNode.nextSibling;
928                 while (Node.nodeName!="TD"){Node=Node.nextSibling}
929                 var Nodes=Node.childNodes;
930                 for (var i=0;i<Nodes.length;i++){
931                     if (Nodes[i].nodeName=="INPUT" && Nodes[i].getAttribute("type")=="checkbox"){
932                       Nodes[i].checked=false;
933                     }
934                }
935             }
936         }
937     </script>
938 [% END %]
939
940 [% INCLUDE 'intranet-bottom.inc' %]