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