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