Bugzilla – Attachment 88977 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: Display date of birth and age more consistantly
Bug-15400-Display-date-of-birth-and-age-more-consi.patch (text/plain), 8.74 KB, created by
Katrin Fischer
on 2019-04-27 13:25:20 UTC
(
hide
)
Description:
Bug 15400: Display date of birth and age more consistantly
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-04-27 13:25:20 UTC
Size:
8.74 KB
patch
obsolete
>From 9d4fb4fd02f33b33d8859c0de54bc4341fbb997a Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Fri, 2 Nov 2018 08:13:35 +0000 >Subject: [PATCH] Bug 15400: Display date of birth and age more consistantly >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Test plan: >0) Apply the patch >1) Go to all of these pages > Patron detail > Other patron pages - look on the left side (circ-menu) > Patron search > Guarantor search ( go to child patron -> edit -> in guarantor > section click "Set to patron" > Search through "Check out" (in the header) > >2) Confirm that does show date of birth and date consistantly, > try it on patrons with and without date of birth set to find > possible reggressions > >Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Utils/DataTables/Members.pm | 1 + > koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc | 10 ++++++++++ > .../prog/en/includes/circ-patron-search-results.inc | 2 +- > koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc | 8 ++++++++ > koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 2 +- > .../prog/en/modules/members/tables/guarantor_search.tt | 2 +- > .../prog/en/modules/members/tables/members_results.tt | 2 +- > members/moremember.pl | 5 ----- > 8 files changed, 23 insertions(+), 9 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc > >diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm >index caf7a92152..f86f93d2d0 100644 >--- a/C4/Utils/DataTables/Members.pm >+++ b/C4/Utils/DataTables/Members.pm >@@ -180,6 +180,7 @@ sub search { > my $patron_object = Koha::Patrons->find( $patron->{borrowernumber} ); > $patron->{overdues} = $patron_object->get_overdues->count; > $patron->{issues} = $patron_object->checkouts->count; >+ $patron->{age} = $patron_object->get_age; > my $balance = $patron_object->account->balance; > # FIXME Should be formatted from the template > $patron->{fines} = sprintf("%.2f", $balance); >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 a79a55f38f..e120610f89 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -53,6 +53,12 @@ > <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> >@@ -66,6 +72,10 @@ > [% 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') %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc >index 8b34bd6c59..815ee16258 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc >@@ -27,7 +27,7 @@ > <td><a href="[% data_url | url %]">[% borrower.surname | html %], [% borrower.firstname | html %]</a></td> > [% END %] > <td>[% borrower.cardnumber | html %]</td> >- <td>[% borrower.dateofbirth | $KohaDates %]</td> >+ <td>[% INCLUDE 'patron-age.inc' patron = borrower %]</td> > <td>[% Categories.GetName( borrower.categorycode ) | html %]</td> > <td>[% Branches.GetName( borrower.branchcode ) | html %]</td> > <td>[% borrower.address | html %]</td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc >new file mode 100644 >index 0000000000..c89382b641 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc >@@ -0,0 +1,8 @@ >+[%- USE KohaDates -%] >+[%- IF ( patron ) -%] >+ [%- IF ( patron.dateofbirth ) -%] >+ [% patron.dateofbirth | $KohaDates -%] >+ [%- IF ( patron.get_age ) %] ([% patron.get_age | html %] years) >+ [%- ELSIF ( patron.age ) %] ([% patron.age | html %] years)[% END -%] >+ [%- END -%] >+[%- END -%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index cb69bba4e2..e7dbe7451d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -233,7 +233,7 @@ > [% IF ( patron.dateofbirth ) %] > <li> > <span class="label">Date of birth:</span> >- [% patron.dateofbirth | $KohaDates %] ([% age | html %] years) >+ [% INCLUDE 'patron-age.inc' %] > </li> > [% END %] > [% IF ( patron.sex ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt >index a82f0e8dcb..38ec5aa9e0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt >@@ -14,7 +14,7 @@ > "dt_name": > "[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames cardnumber = data.cardnumber invert_name = 1%]", > "dt_dateofbirth": >- "[% data.dateofbirth | $KohaDates %]", >+ "[% INCLUDE 'patron-age.inc' patron = data %]", > "dt_address": > "[% INCLUDE escape_address data=data %]", > "dt_action": >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 607146e269..352559a526 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 >@@ -19,7 +19,7 @@ > "dt_name": > "<a href=\"/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber | html %]\" class=\"patron_preview\" data-borrowernumber=\"[% data.borrowernumber | html %]\" style='white-space:nowrap'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = To.json(data.firstname) surname = To.json(data.surname) othernames = To.json(data.othernames) invert_name = 1 %]</a><br />[% INCLUDE escape_address data = data %][% IF data.email %]<br/>Email: <a href='mailto:[% data.email | html %]'>[% data.email | html %]</a>[% END %]", > "dt_dateofbirth": >- "[% data.dateofbirth | $KohaDates %]", >+ "[% INCLUDE 'patron-age.inc' patron = data %]", > "dt_category": > "[% data.category_description | html %] ([% data.category_type | html %])", > "dt_branch": >diff --git a/members/moremember.pl b/members/moremember.pl >index be365a3c06..25e19d54de 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -223,11 +223,6 @@ $today->truncate(to => 'day'); > my $overdues_exist = 0; > my $totalprice = 0; > >-# Calculate and display patron's age >-if ( $data->{dateofbirth} ) { >- $template->param( age => Koha::Patron->new({ dateofbirth => $data->{dateofbirth} })->get_age ); >-} >- > ### ############################################################################### > # BUILD HTML > # show all reserves of this borrower, and the position of the reservation .... >-- >2.11.0
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