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