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