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