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