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