Bugzilla – Attachment 100047 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.62 KB, created by
Josef Moravec
on 2020-03-03 19:25:39 UTC
(
hide
)
Description:
Bug 15400: Display date of birth and age more consistantly
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2020-03-03 19:25:39 UTC
Size:
8.62 KB
patch
obsolete
>From 17a6bc60ebb0d9ab1ed7e580dbfdbde2edf35412 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 | 1 - > 8 files changed, 23 insertions(+), 5 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 4504bd3047..cb596064b5 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 95ace5e248..52dc60fcc2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -55,6 +55,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> >@@ -68,6 +74,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 cfc2a0ab23..d7b78c97c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -240,7 +240,7 @@ > [% IF ( patron.dateofbirth ) %] > <li> > <span class="label">Date of birth:</span> >- [% patron.dateofbirth | $KohaDates %] ([% patron.get_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 2c047fd8f5..9e5c1612e3 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 = data.firstname surname = data.surname othernames = data.othernames invert_name = 1 | $To %]</a><br />[% INCLUDE escape_address data = data %][% IF data.email %]<br/>Email: <a href='mailto:[% data.email | html | $To %]'>[% data.email | html | $To %]</a>[% END %]", > "dt_dateofbirth": >- "[% data.dateofbirth | $KohaDates %]", >+ "[% INCLUDE 'patron-age.inc' patron = data %]", > "dt_category": > "[% data.category_description | html | $To %] ([% data.category_type | html | $To %])", > "dt_branch": >diff --git a/members/moremember.pl b/members/moremember.pl >index f083203d4a..340963dea4 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -123,7 +123,6 @@ if ( !$patron->is_valid_age ) { > $template->param( age_low => $patron->category->dateofbirthrequired ); > $template->param( age_high => $patron->category->upperagelimit ); > } >-$template->param( age => $patron->get_age ); > > # Generate CSRF token for upload and delete image buttons > $template->param( >-- >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