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