Bug 29234: Further clean Z3950 Tests
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / en / includes / circ-menu.inc
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% PROCESS 'member-display-address-style.inc' %]
4 [% IF ( patron.borrowernumber ) %]
5 [% SET patron_is_staff = patron.has_permission({ 'catalogue' => 1 }) %]
6 [% SET patron_is_superlibrarian = patron.is_superlibrarian %]
7 [% SET patron_type_class = 'is-not-staff' %]
8 [% IF ( patron_is_superlibrarian ) %]
9     [% patron_type_class = 'is-staff is-superlibrarian' %]
10 [% ELSIF ( patron_is_staff ) %]
11     [% patron_type_class = 'is-staff' %]
12 [% END %]
13 <div class="patroninfo [% patron_type_class | html %]">
14
15 [% IF ( patronimages ) %]
16     <h5 class="text-center">
17 [% ELSE %]
18     <h5>
19 [% END %]
20         [% IF ( patron_is_staff ) %]
21             <i class="fa fa-shield fa-fw" title="Staff patron"></i>
22         [% END %]
23         [% IF ( patron_is_superlibrarian ) %]
24             <i class="fa fa-bolt fa-fw" title="Superlibrarian patron"></i>
25         [% END %]
26         [% INCLUDE 'patron-title.inc' %]
27     </h5>
28 [% IF Koha.Preference('showLastPatron') %]
29     <input type="hidden" id="hiddenborrowernumber" value="[% patron.borrowernumber | html %]">
30     <input type="hidden" id="hiddenborrowername" value="[% patron.surname | html %] [% patron.firstname | html %]">
31     <input type="hidden" id="hiddenborrowercard" value="[% patron.cardnumber | html %]">
32 [% END %]
33
34 [% IF ( patronimages ) %]
35     <div>
36         <div class="patronimage-container">
37             [% IF ( patron.image ) %]
38                 <img src="/cgi-bin/koha/members/patronimage.pl?borrowernumber=[% patron.borrowernumber | uri %]" class="patronimage" alt="[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])" />
39                 [% IF ( CAN_user_tools_batch_upload_patron_images ) %]
40                     <div class="patronimage-controls">
41                         <div class="patronimage-control"><a data-borrowernumber="[% patron.borrowernumber | uri %]" data-cardnumber="[% patron.cardnumber | html %]" class="btn btn-default edit-patronimage" title="Patron photo" href="#"><i class="fa fa-pencil"></i> Edit</a></div>
42                     </div>
43                 [% END %]
44             [% ELSE %]
45                 <div class="patronimage empty"></div>
46                 [% IF ( CAN_user_tools_batch_upload_patron_images ) %]
47                     <div class="patronimage-controls">
48                         <div class="patronimage-control"><a data-borrowernumber="[% patron.borrowernumber | uri %]" data-cardnumber="[% patron.cardnumber | html %]" class="btn btn-default edit-patronimage" title="Patron photo" href="#"><i class="fa fa-plus"></i> Add</a></div>
49                     </div>
50                 [% END %]
51             [% END %]
52         </div>
53     </div>
54 [% END %]
55
56 <ul class="patronbriefinfo">
57     [% IF !(Koha.Preference('HidePersonalPatronDetailOnCirculation')) %]
58         [% IF patron.pronouns %]
59             <li class="patronpronouns">([% patron.pronouns | html %])</li>
60         [% END %]
61
62         [% PROCESS 'display-address-style' %]
63
64         [% IF ( patron.phone || patron.mobile || patron.phonepro ) %]<li class="patronphone">
65         [% IF ( patron.phone ) %]
66             <a href="tel:[% patron.phone | url %]">[% patron.phone | html %]</a>
67         [% ELSE %]
68             [% IF ( patron.mobile ) %]
69                 <a href="tel:[% patron.mobile | url %]">[% patron.mobile | html %]</a>
70             [% ELSE %]
71                 [% IF ( patron.phonepro ) %]
72                     <a href="tel:[% patron.phonepro | url %]">[% patron.phonepro | html %]</a>
73                 [% END %]
74             [% END %]
75         [% END %]</li>[% END %]
76         [% IF ( patron.email ) %]
77             <li class="email"> <a href="mailto:[% patron.email | url %]" title="[% patron.email | html %]">[% patron.email | html %]</a></li>
78         [% ELSE %]
79             [% IF ( patron.emailpro ) %]
80                 <li class="email"> <a href="mailto:[% patron.emailpro | url %]" title="[% patron.emailpro | html %]">[% patron.emailpro | html %]</a></li>
81             [% END %]
82         [% END %]
83         [% IF ( patron.dateofbirth ) %]
84             <li class="patrondateofbirth">
85                 <span>Born:</span>
86                 [% INCLUDE 'patron-age.inc' %]
87             </li>
88         [% END %]
89
90         [% UNLESS ( patron.address or patron.address2 ) %]
91             <li><span class="empty" id="noaddressstored">No address stored.</span></li>
92         [% END %]
93         [% UNLESS ( patron.city ) %]
94             <li><span class="empty" id="nocitystored">No city stored.</span></li>
95         [% END %]
96         [% UNLESS ( patron.phone or patron.mobile or patron.phonepro) %]
97             <li> <span class="empty">No phone stored.</span></li>
98         [% END %]
99         [% UNLESS ( patron.email or patron.emailpro) %]
100             <li> <span class="empty">No email stored.</span></li>
101         [% END %]
102         [% UNLESS ( patron.dateofbirth ) %]
103             <li> <span class="empty">No date of birth stored.</span></li>
104         [% END %]
105
106     [% END %]
107
108     [% IF Koha.Preference('ExtendedPatronAttributes') %]
109         [% FOREACH extendedattribute IN patron.extended_attributes %]
110             [% IF ( extendedattribute.type.display_checkout ) %] [%# FIXME We should filter in the line above %]
111                 [% IF ( extendedattribute.attribute ) %] [%# FIXME Why that? why not if == 0? %]
112                     <li class="patronattribute">
113                         <span class="patronattributelabel">[% extendedattribute.type.description | html %]</span>: [% extendedattribute.description | html %]
114                     </li>
115                 [% END %]
116             [% END %]
117         [% END %]
118     [% END %]
119     <li class="patroncategory">Category: [% patron.category.description | html %] ([% patron.categorycode | html %])</li>
120     <li class="patronlibrary">Home library: [% Branches.GetName( patron.branchcode ) | html %]</li>
121     <li class="patronborrowernumber">Borrowernumber: [% patron.borrowernumber | html %]</li>
122     <li><span class="patronupdatedon">Updated on [% patron.updated_on | $KohaDates with_hours => 1 %]</span></li>
123     [% IF patron.account_locked %]
124         [% IF patron.login_attempts < 0 %]
125             <li class="blocker account_admin_locked">Account has been administratively locked</li>
126         [% ELSE %]
127             <li class="blocker account_locked">Account has been locked</li>
128         [% END %]
129     [% END %]
130   </ul></div>
131 <div id="menu">
132 <ul>
133     [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
134         [% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]">Check out</a></li>
135         [% IF Koha.Preference('BatchCheckouts') && Koha.Preference('BatchCheckoutsValidCategories').split(',').grep('^' _ patron.categorycode _ '$').size > 0 %]
136           [% IF ( batch_checkout_view ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]&amp;batch=1">Batch check out</a></li>
137         [% END %]
138     [% END %]
139     [% IF CAN_user_borrowers_edit_borrowers %]
140         [% IF ( detailview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">Details</a></li>
141     [% END %]
142     [% IF ( CAN_user_updatecharges_remaining_permissions ) %]
143         [% IF ( finesview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]">Accounting</a></li>
144     [% END %]
145     [% IF ( CAN_user_circulate_circulate_remaining_permissions  )  %]
146         [% IF Koha.Preference("RoutingSerials") %][% IF ( routinglistview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/routing-lists.pl?borrowernumber=[% patron.borrowernumber | uri %]">Routing lists</a></li>[% END %]
147     [% END %]
148     [% IF CAN_user_borrowers_edit_borrowers %]
149         [% IF ( intranetreadinghistory ) %]
150             [% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% patron.borrowernumber | uri %]">Circulation history</a></li>
151         [% END %]
152     [% END %]
153     [% IF CAN_user_borrowers_edit_borrowers %]
154         [% IF ( intranetreadinghistory ) %]
155             [% IF ( holdshistoryview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/holdshistory.pl?borrowernumber=[% patron.borrowernumber | uri %]">Holds history</a></li>
156         [% END %]
157     [% END %]
158     [% IF ( CAN_user_tools_view_system_logs ) %]
159         [% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;modules=CIRCULATION&amp;object=[% patron.borrowernumber | uri %]&amp;src=circ">Modification log</a></li>
160     [% END %]
161     [% IF CAN_user_borrowers_edit_borrowers %]
162     [% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% patron.borrowernumber | uri %]">Notices</a></li>
163     [% END %]
164     [% IF CAN_user_borrowers_edit_borrowers %]
165         [% IF (  statisticsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/statistics.pl?borrowernumber=[% patron.borrowernumber | uri %]">Statistics</a></li>
166     [% END %]
167     [% IF CAN_user_borrowers_edit_borrowers %]
168         [% IF ( EnableBorrowerFiles ) %]
169             [% IF ( borrower_files ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% patron.borrowernumber | uri %]">Files</a></li>
170         [% END %]
171     [% END %]
172
173     [% IF CAN_user_suggestions_suggestions_manage %]
174         [% IF ( suggestionsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/purchase-suggestions.pl?borrowernumber=[% patron.borrowernumber | uri %]">Purchase suggestions</a></li>
175     [% END %]
176     [% IF CAN_user_borrowers_edit_borrowers && useDischarge %]
177         [% IF dischargeview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% patron.borrowernumber | uri %]">Discharges</a></li>
178     [% END %]
179     [% IF Koha.Preference('HouseboundModule') %]
180         [% IF houseboundview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% patron.borrowernumber | uri %]">Housebound</a></li>
181     [% END %]
182     [% IF Koha.Preference('ILLModule') && CAN_user_ill %]
183         [% IF illview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/ill-requests.pl?borrowernumber=[% patron.borrowernumber | uri %]">ILL requests history</a></li>
184     [% END %]
185     [% IF Koha.Preference('UseRecalls') && CAN_user_recalls %]
186         [% IF recallsview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/recallshistory.pl?borrowernumber=[% patron.borrowernumber | uri %]">Recalls history</a></li>
187     [% END %]
188 </ul></div>
189
190 [% IF patronimages && CAN_user_tools_batch_upload_patron_images %]
191 <!-- Modal -->
192 <div class="modal" id="patronImageEdit" tabindex="-1" role="dialog" aria-labelledby="patronImageEditLabel">
193     <div class="modal-dialog" role="document">
194         <div class="modal-content">
195             <div class="modal-header">
196                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
197                 <h4 class="modal-title" id="patronImageEditLabel">Patron photo</h4>
198             </div>
199             <div class="modal-body">
200                 <div id="upload-patron-image" class="patroninfo-section">
201                     <h5>Upload patron photo</h5>
202                     <form method="post" id="picture-upload" action="/cgi-bin/koha/tools/picture-upload.pl"
203                         enctype="multipart/form-data">
204                         [% IF ( patron.image ) %]
205                             <div class="hint">
206                                 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
207                                 remove the current image.
208                             </div>
209                         [% ELSE %]
210                             <div class="hint">
211                                 [% 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.
212                             </div>
213                         [% END %]
214                         <p>Only PNG, GIF, JPEG, XPM formats are supported.</p>
215                         <label for="uploadfile">Select the file to upload: </label>
216                         <input type="file" id="uploadfile" name="uploadfile" required="required" />
217                         <div class="action">
218                             <input type="hidden" id="csrf_token" name="csrf_token" value="[% csrf_token | html %]" />
219                             <input type="hidden" id="image" name="filetype" value="image" />
220                             <input type="hidden" id="cardnumber" name="cardnumber" value="[% patron.cardnumber | html %]" />
221                             <input type="hidden" id="borrowernumber" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
222                             <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-upload"></i> Upload photo</button>
223                             <input name="op" type="hidden" value="Upload" />
224                             [% IF ( patron.image ) %]
225                                 <a id="delpicture"
226                                     href="/cgi-bin/koha/tools/picture-upload.pl?op=Delete&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;csrf_token=[% csrf_token | html %]"
227                                     class="btn btn-default btn-xs delete"><i class="fa fa-trash"></i> Delete</a>
228                             [% END %]
229                         </div>
230                     </form>
231                 </div>
232                 <div id="capture-patron-image" class="patroninfo-section">
233                     <h5>Take patron photo</h5>
234                     <form method="post" id="camera-upload" action="/cgi-bin/koha/tools/picture-upload.pl">
235                         <div class="btn-toolbar">
236                             <div class="btn-group">
237                                 <button class="btn btn-default" id="takebutton"><i class="fa fa-camera"></i> Take photo</button>
238                             </div>
239                             <div class="btn-group">
240                                 <button class="btn btn-default" id="retakebutton" style="display:none;"><i class="fa fa-refresh"></i> Retake photo</button>
241                             </div>
242                             <div class="btn-group">
243                                 <a id="downloadbutton" href="#" class="btn btn-default" style="display:none;"><i class="fa fa-download"></i> Download photo</a>
244                             </div>
245                             <div class="btn-group">
246                                 <button id="savebutton" type="submit" class="btn btn-default" style="display:none;"><i class="fa fa-hdd-o"></i> Upload</button>
247                             </div>
248                         </div>
249                         <div id="camera">
250                             <video id="viewfinder">Video stream not available.</video>
251                         </div>
252                         <canvas id="canvas" style="display:none"></canvas>
253                         <div id="output" style="display:none">
254                             <img style="width:100%;height:auto;" id="photo" alt="The screen capture will appear in this box.">
255                         </div>
256                         <input type="hidden" name="uploadfilename" value="patron-photo.jpg" />
257                         <textarea id="uploadfiletext" name="uploadfiletext" style="display:none;"></textarea>
258                         <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
259                         <input type="hidden" name="filetype" value="image" />
260                         <input type="hidden" name="cardnumber" value="[% patron.cardnumber | html %]" />
261                         <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
262                         <input name="op" type="hidden" value="Upload" />
263                     </form>
264                 </div>
265                 <div class="dialog message" style="display:none" id="camera-error">
266                     <div>
267                         <span class="fa-stack fa-lg">
268                             <i class="fa fa-camera fa-stack-1x"></i>
269                             <i class="fa fa-ban fa-stack-2x text-danger"></i>
270                         </span>
271                     </div>
272                     <div>
273                         <strong>Cannot take patron photo.</strong>
274                         <span id="camera-error-message"></span>
275                     </div>
276                 </div>
277             </div>
278             <div class="modal-footer">
279                 <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
280             </div>
281         </div>
282     </div>
283 </div>
284 [% END %]
285
286 [% END %]