Bugzilla – Attachment 45882 Details for
Bug 15400
Display patron age in useful places in the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15400: Show patron age in search results
Bug-15400-Show-patron-age-in-search-results.patch (text/plain), 6.66 KB, created by
Martin Stenberg
on 2015-12-21 12:43:47 UTC
(
hide
)
Description:
Bug 15400: Show patron age in search results
Filename:
MIME Type:
Creator:
Martin Stenberg
Created:
2015-12-21 12:43:47 UTC
Size:
6.66 KB
patch
obsolete
>From a87f15ad62ebfc6dedb0380a80f97d7c19380c37 Mon Sep 17 00:00:00 2001 >From: Martin Stenberg <martin@xinxidi.net> >Date: Mon, 21 Dec 2015 13:34:39 +0100 >Subject: [PATCH] Bug 15400: Show patron age in search results > >Display patron age in search results and checkout details. > >Test plan >========= > >1. Go to checkout page for one patron (cgi-bin/koha/circ/circulation.pl) >2. In the circulation menu to the left, under the patrons name you should see a > new field "Age:" showing the patrons age, if a date of birth is available. >3. Enter a search term that will match more than one patron in the checkout > search field >4. A new table column "Age" should be visible and display each patrons age >5. In cgi-bin/koha/members/member.pl enter a search filter that will match more > than one patron >6. Each patrons age should be visible within parentheses to the right of the > patron name >--- > koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc | 17 +++++++++++++++++ > .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 13 +++++++++++++ > .../prog/en/modules/members/tables/members_results.tt | 15 ++++++++++++++- > 3 files changed, 44 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >index 6393a04..e2a3a8c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -1,4 +1,5 @@ > [% USE Koha %] >+[% USE date %] > [% IF ( borrowernumber ) %] > <div class="patroninfo"><h5>[% INCLUDE 'patron-title.inc' %]</h5> > <!--[if IE 6]> >@@ -13,6 +14,19 @@ > <li id="patronbasics"><img src="[% interface %]/[% theme %]/img/patron-blank.png" alt="[% firstname %] [% surname %] ([% cardnumber %])" border="0" style="margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC;" /></li> > [% END %] > [% END %] >+ [% IF ( dateofbirth ) %] >+ [%- calc = date.calc >+ YMD = dateofbirth.split("-") >+ ageymd = calc.Delta_YMD( >+ YMD.0, YMD.1, YMD.2, >+ date.format(date.now, "%Y"), >+ date.format(date.now, "%m"), >+ date.format(date.now, "%d") >+ ) >+ age = ageymd.0 >+ -%] >+ <li>Age: [% age %]</li> >+ [% END %] > [% IF Koha.Preference( 'AddressFormat' ) %] > [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] > [% ELSE %] >@@ -50,6 +64,9 @@ > [% UNLESS ( email or emailpro) %] > <li> <span class="empty">No email stored.</span></li> > [% END %] >+ [% UNLESS ( dateofbirth ) %] >+ <li> <span class="empty">No birth date stored.</span></li> >+ [% END %] > > [% IF ( ExtendedPatronAttributes ) %][% FOREACH extendedattribute IN extendedattributes %] > [% IF ( extendedattribute.display_checkout ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 19ba9fa..e0884b5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -1,4 +1,5 @@ > [% USE Koha %] >+[% USE date %] > [% USE Branches %] > [% USE KohaDates %] > [% USE ColumnsSettings %] >@@ -571,10 +572,21 @@ No patron matched <span class="ex">[% message %]</span> > <th>Category</th> > <th>Library</th> > <th>Address</th> >+ <th>Age</th> > </tr> > </thead> > <tbody> > [% FOREACH borrower IN borrowers %] >+ [%- calc = date.calc >+ YMD = borrower.dateofbirth.split("-") >+ ageymd = calc.Delta_YMD( >+ YMD.0, YMD.1, YMD.2, >+ date.format(date.now, "%Y"), >+ date.format(date.now, "%m"), >+ date.format(date.now, "%d") >+ ) >+ age = ageymd.0 >+ -%] > <tr> > <td><input type="radio" name="borrowernumber" value="[% borrower.borrowernumber %]" /></td> > <td>[% borrower.surname %], [% borrower.firstname %]</td> >@@ -582,6 +594,7 @@ No patron matched <span class="ex">[% message %]</span> > <td>[% borrower.categorycode %]</td> > <td>[% borrower.branchcode %]</td> > <td>[% borrower.address %]</td> >+ <td>[% age %]</td> > </tr> > [% END %] > </tbody> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >index e4b7337..df38d9e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >@@ -1,4 +1,5 @@ > [% USE To %] >+[% USE date %] > [% USE AuthorisedValues %] > { > "sEcho": [% sEcho %], >@@ -6,6 +7,18 @@ > "iTotalDisplayRecords": [% iTotalDisplayRecords %], > "aaData": [ > [% FOREACH data IN aaData %] >+ [% IF ( data.dateofbirth ) %] >+ [%- calc = date.calc >+ YMD = data.dateofbirth.split("-") >+ ageymd = calc.Delta_YMD( >+ YMD.0, YMD.1, YMD.2, >+ date.format(date.now, "%Y"), >+ date.format(date.now, "%m"), >+ date.format(date.now, "%d") >+ ) >+ age = ageymd.0 >+ -%] >+ [% END %] > { > [% IF CAN_user_tools_manage_patron_lists %] > "dt_borrowernumber": >@@ -14,7 +27,7 @@ > "dt_cardnumber": > "[% data.cardnumber | html %]", > "dt_name": >- "<span style='white-space:nowrap'><a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames invert_name = 1 %]</a><br />[% INCLUDE escape_address data = data %]</span>", >+ "<span style='white-space:nowrap'><a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber %]'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames invert_name = 1 %]</a>[% IF age %]([% age%])[% END %]<br />[% INCLUDE escape_address data = data %]</span>", > "dt_category": > "[% data.category_description |html %] ([% data.category_type |html %])", > "dt_branch": >-- >2.6.3
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15400
:
45882
|
46935
|
81892
|
82714
|
85432
|
85479
|
85494
|
85495
|
85496
|
85497
|
86457
|
86458
|
86459
|
86460
|
88274
|
88275
|
88276
|
88277
|
88278
|
88845
|
88846
|
88977
|
88978
|
88979
|
88980
|
88981
|
100047
|
100048
|
100049
|
100050
|
100051
|
100065
|
100066
|
100067
|
100068
|
100069
|
100118
|
103373
|
106133
|
106134
|
106135
|
106136
|
106137
|
106138
|
106139
|
106140
|
106307