Bug 26534: Replace 'grade' by 'is-patron' and 'patron-type'
[koha.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_type_class = patron_is_staff ? 'is-staff' : 'is-not-staff' %]
7 <div class="patroninfo [% patron_type_class | html %]">
8
9 [% IF ( patronimages ) %]
10     <h5 class="text-center">
11         [% IF ( patron_is_staff ) %]
12             <i class="fa fa-shield fa-fw" title="Staff patron"></i>
13         [% END %]
14         [% INCLUDE 'patron-title.inc' %]
15     </h5>
16
17     <div>
18         <div class="patronimage-container">
19             [% IF ( patron.image ) %]
20                 <img src="/cgi-bin/koha/members/patronimage.pl?borrowernumber=[% patron.borrowernumber | uri %]" class="patronimage" alt="[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])" />
21                 <div class="patronimage-controls">
22                     <div class="patronimage-control"><a data-borrowernumber="[% patron.borrowernumber | uri %]" class="btn btn-default edit-patronimage" title="Edit patron image" href="#"><i class="fa fa-pencil"></i> Edit</a></div>
23                 </div>
24             [% ELSE %]
25                 <div class="patronimage empty"></div>
26                 <div class="patronimage-controls">
27                     <div class="patronimage-control"><a data-borrowernumber="[% patron.borrowernumber | uri %]" class="btn btn-default edit-patronimage" title="Add patron image" href="#"><i class="fa fa-plus"></i> Add</a></div>
28                 </div>
29             [% END %]
30         </div>
31     </div>
32 [% ELSE %]
33     <h5>
34         [% IF ( patron_is_staff ) %]
35             <i class="fa fa-shield fa-fw" title="Staff patron"></i>
36         [% END %]
37         [% INCLUDE 'patron-title.inc' %]
38     </h5>
39 [% END %]
40
41 [% IF Koha.Preference('showLastPatron') %]
42     <input type="hidden" id="hiddenborrowernumber" value="[% patron.borrowernumber | html %]">
43     <input type="hidden" id="hiddenborrowername" value="[% patron.surname | html %] [% patron.firstname | html %]">
44     <input type="hidden" id="hiddenborrowercard" value="[% patron.cardnumber | html %]">
45 [% END %]
46
47 <ul class="patronbriefinfo">
48     [% IF !(Koha.Preference('HidePersonalPatronDetailOnCirculation')) %]
49         [% PROCESS 'display-address-style' %]
50
51         [% IF ( patron.phone || patron.mobile || patron.phonepro ) %]<li class="patronphone">
52         [% IF ( patron.phone ) %]
53             <a href="tel:[% patron.phone | url %]">[% patron.phone | html %]</a>
54         [% ELSE %]
55             [% IF ( patron.mobile ) %]
56                 <a href="tel:[% patron.mobile | url %]">[% patron.mobile | html %]</a>
57             [% ELSE %]
58                 [% IF ( patron.phonepro ) %]
59                     <a href="tel:[% patron.phonepro | url %]">[% patron.phonepro | html %]</a>
60                 [% END %]
61             [% END %]
62         [% END %]</li>[% END %]
63         [% IF ( patron.email ) %]
64             <li class="email"> <a href="mailto:[% patron.email | url %]" title="[% patron.email | html %]">[% patron.email | html %]</a></li>
65         [% ELSE %]
66             [% IF ( patron.emailpro ) %]
67                 <li class="email"> <a href="mailto:[% patron.emailpro | url %]" title="[% patron.emailpro | html %]">[% patron.emailpro | html %]</a></li>
68             [% END %]
69         [% END %]
70         [% IF ( patron.dateofbirth ) %]
71             <li class="patrondateofbirth">
72                 <span>Born:</span>
73                 [% INCLUDE 'patron-age.inc' %]
74             </li>
75         [% END %]
76
77         [% UNLESS ( patron.address or patron.address2 ) %]
78             <li><span class="empty" id="noaddressstored">No address stored.</span></li>
79         [% END %]
80         [% UNLESS ( patron.city ) %]
81             <li><span class="empty" id="nocitystored">No city stored.</span></li>
82         [% END %]
83         [% UNLESS ( patron.phone or patron.mobile or patron.phonepro) %]
84             <li> <span class="empty">No phone stored.</span></li>
85         [% END %]
86         [% UNLESS ( patron.email or patron.emailpro) %]
87             <li> <span class="empty">No email stored.</span></li>
88         [% END %]
89         [% UNLESS ( patron.dateofbirth ) %]
90             <li> <span class="empty">No date of birth stored.</span></li>
91         [% END %]
92
93     [% END %]
94
95     [% IF Koha.Preference('ExtendedPatronAttributes') %]
96         [% FOREACH extendedattribute IN patron.extended_attributes %]
97             [% IF ( extendedattribute.type.display_checkout ) %] [%# FIXME We should filter in the line above %]
98                 [% IF ( extendedattribute.attribute ) %] [%# FIXME Why that? why not if == 0? %]
99                     <li class="patronattribute">
100                         <span class="patronattributelabel">[% extendedattribute.type.description | html %]</span>: [% extendedattribute.description | html %]
101                     </li>
102                 [% END %]
103             [% END %]
104         [% END %]
105     [% END %]
106     <li class="patroncategory">Category: [% patron.category.description | html %] ([% patron.categorycode | html %])</li>
107     <li class="patronlibrary">Home library: [% Branches.GetName( patron.branchcode ) | html %]</li>
108     <li class="patronborrowernumber">Borrowernumber: [% patron.borrowernumber | html %]</li>
109     <li><span class="patronupdatedon">Updated on [% patron.updated_on | $KohaDates with_hours => 1 %]</span></li>
110   </ul></div>
111 <div id="menu">
112 <ul>
113     [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
114         [% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber | uri %]">Check out</a></li>
115         [% IF Koha.Preference('BatchCheckouts') && Koha.Preference('BatchCheckoutsValidCategories').split('\|').grep('^' _ patron.categorycode _ '$').size > 0 %]
116           [% 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>
117         [% END %]
118     [% END %]
119     [% IF CAN_user_borrowers_edit_borrowers %]
120         [% IF ( detailview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">Details</a></li>
121     [% END %]
122     [% IF ( CAN_user_updatecharges ) %]
123         [% IF ( finesview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]">Accounting</a></li>
124     [% END %]
125     [% IF ( CAN_user_circulate_circulate_remaining_permissions  )  %]
126         [% 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 %]
127     [% END %]
128     [% IF CAN_user_borrowers_edit_borrowers %]
129         [% IF ( intranetreadinghistory ) %]
130             [% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% patron.borrowernumber | uri %]">Circulation history</a></li>
131         [% END %]
132     [% END %]
133     [% IF CAN_user_borrowers_edit_borrowers %]
134         [% IF ( intranetreadinghistory ) %]
135             [% IF ( holdshistoryview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/holdshistory.pl?borrowernumber=[% patron.borrowernumber | uri %]">Holds history</a></li>
136         [% END %]
137     [% END %]
138     [% IF ( CAN_user_tools_view_system_logs ) %]
139         [% 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>
140     [% END %]
141     [% IF CAN_user_borrowers_edit_borrowers %]
142     [% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% patron.borrowernumber | uri %]">Notices</a></li>
143     [% END %]
144     [% IF CAN_user_borrowers_edit_borrowers %]
145         [% IF (  statisticsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/statistics.pl?borrowernumber=[% patron.borrowernumber | uri %]">Statistics</a></li>
146     [% END %]
147     [% IF CAN_user_borrowers_edit_borrowers %]
148         [% IF ( EnableBorrowerFiles ) %]
149             [% IF ( borrower_files ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% patron.borrowernumber | uri %]">Files</a></li>
150         [% END %]
151     [% END %]
152
153     [% IF CAN_user_suggestions_suggestions_manage %]
154         [% 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>
155     [% END %]
156     [% IF CAN_user_borrowers_edit_borrowers && useDischarge %]
157         [% IF dischargeview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% patron.borrowernumber | uri %]">Discharges</a></li>
158     [% END %]
159     [% IF Koha.Preference('HouseboundModule') %]
160         [% IF houseboundview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% patron.borrowernumber | uri %]">Housebound</a></li>
161     [% END %]
162     [% IF Koha.Preference('ILLModule') && CAN_user_ill %]
163         [% 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>
164     [% END %]
165 </ul></div>
166
167 <!-- Modal -->
168 <div class="modal" id="patronImageEdit" tabindex="-1" role="dialog" aria-labelledby="patronImageEditLabel">
169     <div class="modal-dialog" role="document">
170         <div class="modal-content">
171             <div class="modal-header">
172                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
173                 <h4 class="modal-title" id="patronImageEditLabel">Modal title</h4>
174             </div>
175             <div class="modal-body">
176                 <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" />
177             </div>
178             <div class="modal-footer">
179                 <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
180             </div>
181         </div>
182     </div>
183 </div>
184
185 [% END %]