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