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