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