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