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