Bug 15400: Display date of birth and age more consistantly
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / en / includes / circ-menu.inc
index a79a55f..948a95c 100644 (file)
@@ -1,11 +1,14 @@
 [% USE Koha %]
 [% USE KohaDates %]
+[% PROCESS 'member-display-address-style.inc' %]
 [% IF ( patron.borrowernumber ) %]
 <div class="patroninfo"><h5>[% INCLUDE 'patron-title.inc' %]</h5>
 
-<input type="hidden" id="hiddenborrowernumber" value="[% patron.borrowernumber | html %]">
-<input type="hidden" id="hiddenborrowername" value="[% patron.surname | html %] [% patron.firstname | html %]">
-<input type="hidden" id="hiddenborrowercard" value="[% patron.cardnumber | html %]">
+[% IF Koha.Preference('showLastPatron') %]
+    <input type="hidden" id="hiddenborrowernumber" value="[% patron.borrowernumber | html %]">
+    <input type="hidden" id="hiddenborrowername" value="[% patron.surname | html %] [% patron.firstname | html %]">
+    <input type="hidden" id="hiddenborrowercard" value="[% patron.cardnumber | html %]">
+[% END %]
 
 [% IF ( patronimages ) %]
     <div>
 
 <ul class="patronbriefinfo">
     [% IF !(Koha.Preference('HidePersonalPatronDetailOnCirculation')) %]
-        [% SWITCH Koha.Preference( 'AddressFormat' ) %]
-            [% CASE 'de' %]
-                [% INCLUDE 'member-display-address-style-de.inc' %]
-            [% CASE # us %]
-                [% INCLUDE 'member-display-address-style-us.inc' %]
-        [% END %]
+        [% PROCESS 'display-address-style' %]
 
         [% IF ( patron.phone || patron.mobile || patron.phonepro ) %]<li class="patronphone">
         [% IF ( patron.phone ) %]
                 <li class="email"> <a href="mailto:[% patron.emailpro | url %]" title="[% patron.emailpro | html %]">[% patron.emailpro | html %]</a></li>
             [% END %]
         [% END %]
+        [% IF ( patron.dateofbirth ) %]
+            <li>
+                <span class="label">Date of birth:</span>
+                [% INCLUDE 'patron-age.inc' %]
+            </li>
+        [% END %]
 
         [% UNLESS ( patron.address or patron.address2 ) %]
             <li><span class="empty" id="noaddressstored">No address stored.</span></li>
         [% UNLESS ( patron.email or patron.emailpro) %]
             <li> <span class="empty">No email stored.</span></li>
         [% END %]
+        [% UNLESS ( patron.dateofbirth ) %]
+            <li> <span class="empty">No date of birth stored.</span></li>
+        [% END %]
+
     [% END %]
 
     [% IF Koha.Preference('ExtendedPatronAttributes') %]
-        [% FOREACH extendedattribute IN patron.attributes %]
-            [% IF ( extendedattribute.display_checkout ) %]
-                <li class="patronattribute"><span class="patronattributelabel">[% extendedattribute.type_description | html %]</span> : [% IF ( extendedattribute.value_description ) %][% extendedattribute.value_description | html %][% ELSE %][% extendedattribute.attribute | html %][% END %]</li>
+        [% FOREACH extendedattribute IN patron.extended_attributes %]
+            [% IF ( extendedattribute.type.display_checkout ) %] [%# FIXME We should filter in the line above %]
+                [% IF ( extendedattribute.attribute ) %] [%# FIXME Why that? why not if == 0? %]
+                    <li class="patronattribute">
+                        <span class="patronattributelabel">[% extendedattribute.type.description | html %]</span>: [% extendedattribute.description | html %]
+                    </li>
+                [% END %]
             [% END %]
         [% END %]
     [% END %]
         [% END %]
     [% END %]
 
-    [% IF CAN_user_acquisition_suggestions_manage %]
+    [% IF CAN_user_suggestions_suggestions_manage %]
         [% 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>
     [% END %]
     [% IF CAN_user_borrowers_edit_borrowers && useDischarge %]