Bug 15400 - Display patron age in useful places in the staff interface
Summary: Display patron age in useful places in the staff interface
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Josef Moravec
QA Contact: Testopia
URL:
Keywords:
: 24770 (view as bug list)
Depends on:
Blocks: 27717 27926
  Show dependency treegraph
 
Reported: 2015-12-21 12:24 UTC by Martin Stenberg
Modified: 2022-12-12 21:24 UTC (History)
16 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00
Circulation function:


Attachments
Bug 15400: Show patron age in search results (6.66 KB, patch)
2015-12-21 12:43 UTC, Martin Stenberg
Details | Diff | Splinter Review
Bug 15400: Show patron age in search results (6.93 KB, patch)
2016-01-19 20:36 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 15400: Display date of birth and age more consistantly (8.41 KB, patch)
2018-11-02 13:32 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: Display date of birth and age more consistantly (8.47 KB, patch)
2018-11-28 22:36 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15400: Display date of birth and age more consistantly (8.52 KB, patch)
2019-02-21 11:52 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 15400: (follow-up) Updating text display (1.78 KB, patch)
2019-02-21 19:49 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15400: (followup) Adding age to check out search dropdown (2.16 KB, patch)
2019-02-21 20:45 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15400: Display date of birth and age more consistantly (8.67 KB, patch)
2019-02-21 20:56 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15400: (follow-up) Updating text display (1.93 KB, patch)
2019-02-21 20:56 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15400: (followup) Adding age to check out search dropdown (2.36 KB, patch)
2019-02-21 20:57 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15400: Display date of birth and age more consistantly (8.72 KB, patch)
2019-03-11 14:30 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: (follow-up) Updating text display (1.94 KB, patch)
2019-03-11 14:30 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: (follow-up) Adding age to check out search dropdown (2.37 KB, patch)
2019-03-11 14:30 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string (3.30 KB, patch)
2019-03-11 14:30 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: Display date of birth and age more consistantly (8.68 KB, patch)
2019-04-18 09:28 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: (follow-up) Updating text display (1.94 KB, patch)
2019-04-18 09:28 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: (follow-up) Adding age to check out search dropdown (2.37 KB, patch)
2019-04-18 09:28 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string (3.30 KB, patch)
2019-04-18 09:28 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: (follow-up) Add class to years span (2.23 KB, patch)
2019-04-18 09:28 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: (follow-up) Add class to years span (2.15 KB, patch)
2019-04-26 05:59 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: (follow-up) Add class to years span (2.07 KB, patch)
2019-04-26 06:00 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: Display date of birth and age more consistantly (8.74 KB, patch)
2019-04-27 13:25 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15400: (follow-up) Updating text display (2.00 KB, patch)
2019-04-27 13:25 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15400: (follow-up) Adding age to check out search dropdown (2.43 KB, patch)
2019-04-27 13:25 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string (3.35 KB, patch)
2019-04-27 13:25 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15400: (follow-up) Add class to years span (2.12 KB, patch)
2019-04-27 13:25 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15400: Display date of birth and age more consistantly (8.62 KB, patch)
2020-03-03 19:25 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: (follow-up) Updating text display (2.00 KB, patch)
2020-03-03 19:25 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: (follow-up) Adding age to check out search dropdown (2.42 KB, patch)
2020-03-03 19:25 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string (3.42 KB, patch)
2020-03-03 19:25 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: (follow-up) Add class to years span (2.11 KB, patch)
2020-03-03 19:26 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: Display date of birth and age more consistantly (8.67 KB, patch)
2020-03-03 20:03 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 15400: (follow-up) Updating text display (2.04 KB, patch)
2020-03-03 20:03 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 15400: (follow-up) Adding age to check out search dropdown (2.47 KB, patch)
2020-03-03 20:03 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string (3.47 KB, patch)
2020-03-03 20:03 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 15400: (follow-up) Add class to years span (2.15 KB, patch)
2020-03-03 20:03 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 15400: Clarify usage of patron-age.inc (1.34 KB, patch)
2020-03-04 13:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15400: (follow-up) Remove line break (1.03 KB, patch)
2020-04-21 13:22 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 15400: Display date of birth and age more consistantly (8.73 KB, patch)
2020-06-21 16:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15400: (follow-up) Updating text display (2.10 KB, patch)
2020-06-21 16:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15400: (follow-up) Adding age to check out search dropdown (2.53 KB, patch)
2020-06-21 16:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string (3.53 KB, patch)
2020-06-21 16:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15400: (follow-up) Add class to years span (2.21 KB, patch)
2020-06-21 16:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15400: Clarify usage of patron-age.inc (1.39 KB, patch)
2020-06-21 16:43 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15400: (follow-up) Remove line break (1.08 KB, patch)
2020-06-21 16:43 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15400: Add class on patron brief info to allow hiding date of birth (1.12 KB, patch)
2020-06-21 16:43 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15400: (follow-up) Remove unnecessary class (978 bytes, patch)
2020-06-25 15:09 UTC, Josef Moravec
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Stenberg 2015-12-21 12:24:39 UTC
Show patrons age in checkout search, member search and patrons circulation details (top left menu).
Comment 1 Martin Stenberg 2015-12-21 12:43:47 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2015-12-22 11:54:31 UTC
How is this related to "Bug 15206 - Show patron's age when filling date of birth in memberentry.pl"
Comment 3 Martin Stenberg 2015-12-22 12:24:40 UTC
They look related, but not contradicting or overlapping. Bug 15206 seems unnecessary code complex at first glance though.
Comment 4 Aleisha Amohia 2016-01-11 22:09:42 UTC
Is this similar to Bug 14763, but in more places?
Comment 5 Magnus Enger 2016-01-12 19:32:40 UTC
$ git bz apply 15400
Bug 15400 - display patron age in useful places

45882 - Bug 15400: Show patron age in search results

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 15400: Show patron age in search results
Using index info to reconstruct a base tree...
M	koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
M	koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
M	koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
Failed to merge in the changes.
Patch failed at 0001 Bug 15400: Show patron age in search results
Comment 6 Magnus Enger 2016-01-12 19:34:34 UTC
Also, I have a hunch this:

  </a>[% IF age %]([% age%])[% END %]

might be better written as:

  </a>[% IF age %] ([% age %])[% END %]

to 
1. Give a space between the link and the opening parenthesis
2. Make the layout of TT tags consistent
Comment 7 Mark Tompsett 2016-01-19 20:36:25 UTC
Created attachment 46935 [details] [review]
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

NOTE: rebased to handle conflict with 13931, but I'm not sure this
      is fully needed, as 13931 adds date of birth.
Comment 8 Aleisha Amohia 2016-01-19 20:48:49 UTC
I get a software error at Step 3-4 in your test plan:
Template process failed: undef error - Date::Calc::Delta_YMD(): not a valid date at /usr/lib/perl5/Template/Plugin/Date.pm line 185.

I think the patch for Bug 14763 to show the age on the details page is a better place than above the address like in this patch.

I think that if we do want to show the age in brackets on member.pl search, maybe it should say (x years)? Doesn't make much sense to have all these random numbers next to names.
Comment 9 Josef Moravec 2018-11-02 13:32:16 UTC
Created attachment 81892 [details] [review]
Bug 15400: Display date of birth and age more consistantly

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
Comment 10 Aleisha Amohia 2018-11-28 22:36:22 UTC
Created attachment 82714 [details] [review]
Bug 15400: Display date of birth and age more consistantly

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>
Comment 11 Jonathan Druart 2018-12-13 18:55:50 UTC
Is this info really useful? For everybody?

To me it seems unnecessary additional info
Comment 12 Kyle M Hall (khall) 2019-02-21 11:52:09 UTC
(In reply to Jonathan Druart from comment #11)
> Is this info really useful? For everybody?
> 
> To me it seems unnecessary additional info

I think it's useful. The biggest issue I have is the wording takes up a lot of real estate. I think "Date of birth: 05/30/1958 (60 years)" could be changed to "Born: 05/30/1958 (60)", or "DOB: 05/30/1958 (60)" or something similar. Other than that, I think this is a good patch.
Comment 13 Kyle M Hall (khall) 2019-02-21 11:52:31 UTC
Created attachment 85432 [details] [review]
Bug 15400: Display date of birth and age more consistantly

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>
Comment 14 Aleisha Amohia 2019-02-21 19:49:43 UTC
Created attachment 85479 [details] [review]
Bug 15400: (follow-up) Updating text display

Now shows as 'Born: [date of birth] (age)' in circ sidebar menu and
search results

Sponsored-by: Catalyst IT
Comment 15 Séverine Queune 2019-02-21 20:30:14 UTC
Patch applies correctly except for "Check out" in the header (i still have "NAME, surname (cardnumber) birthdate adress").
Change to Failed [hoping not for too long :)]
Comment 16 Aleisha Amohia 2019-02-21 20:45:41 UTC
Created attachment 85494 [details] [review]
Bug 15400: (followup) Adding age to check out search dropdown

Confirm age shows in the suggestions dropdown when using the checkout
search in header (if user set DOB).
Confirm 'Age unknown' shows if no DOB set.
Comment 17 Séverine Queune 2019-02-21 20:54:56 UTC
Everything works as described now, thanks Aleisha !
Comment 18 Biblibre Sandboxes 2019-02-21 20:56:11 UTC
Patch tested with a sandbox, by Séverine QUEUNE <severine.queune@bulac.fr>
Comment 19 Biblibre Sandboxes 2019-02-21 20:56:54 UTC
Created attachment 85495 [details] [review]
Bug 15400: Display date of birth and age more consistantly

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>
Comment 20 Biblibre Sandboxes 2019-02-21 20:56:57 UTC
Created attachment 85496 [details] [review]
Bug 15400: (follow-up) Updating text display

Now shows as 'Born: [date of birth] (age)' in circ sidebar menu and
search results

Sponsored-by: Catalyst IT

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 21 Biblibre Sandboxes 2019-02-21 20:57:01 UTC
Created attachment 85497 [details] [review]
Bug 15400: (followup) Adding age to check out search dropdown

Confirm age shows in the suggestions dropdown when using the checkout
search in header (if user set DOB).
Confirm 'Age unknown' shows if no DOB set.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 22 Josef Moravec 2019-02-22 07:45:14 UTC
Comment on attachment 85497 [details] [review]
Bug 15400: (followup) Adding age to check out search dropdown

Review of attachment 85497 [details] [review]:
-----------------------------------------------------------------

::: circ/ysearch.pl
@@ +85,4 @@
>          firstname      => $b->firstname  // '',
>          cardnumber     => $b->cardnumber // '',
>          dateofbirth    => format_sqldatetime($b->dateofbirth, undef, undef, 1) // '',
> +        age            => $b->get_age    // 'Age unknown',

This is bad, string 'Age unknown' is not translatable
Comment 23 Josef Moravec 2019-02-22 07:47:22 UTC
Also, I do not like the 'years' word removed, but that's only my personal opinion
Comment 24 Katrin Fischer 2019-02-22 08:44:06 UTC
(In reply to Josef Moravec from comment #22)
> Comment on attachment 85497 [details] [review] [review]
> Bug 15400: (followup) Adding age to check out search dropdown
> 
> Review of attachment 85497 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: circ/ysearch.pl
> @@ +85,4 @@
> >          firstname      => $b->firstname  // '',
> >          cardnumber     => $b->cardnumber // '',
> >          dateofbirth    => format_sqldatetime($b->dateofbirth, undef, undef, 1) // '',
> > +        age            => $b->get_age    // 'Age unknown',
> 
> This is bad, string 'Age unknown' is not translatable

When woudl this display? I think if the user has no date of birth, we should just display 'nothing'.

Thx Josef for spotting this! I also liked the 'years'.
Comment 25 Josef Moravec 2019-03-11 14:30:38 UTC
Created attachment 86457 [details] [review]
Bug 15400: Display date of birth and age more consistantly

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>
Comment 26 Josef Moravec 2019-03-11 14:30:42 UTC
Created attachment 86458 [details] [review]
Bug 15400: (follow-up) Updating text display

Now shows as 'Born: [date of birth] (age)' in circ sidebar menu and
search results

Sponsored-by: Catalyst IT

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 27 Josef Moravec 2019-03-11 14:30:46 UTC
Created attachment 86459 [details] [review]
Bug 15400: (follow-up) Adding age to check out search dropdown

Confirm age shows in the suggestions dropdown when using the checkout
search in header (if user set DOB).
Confirm 'Age unknown' shows if no DOB set.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 28 Josef Moravec 2019-03-11 14:30:50 UTC
Created attachment 86460 [details] [review]
Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string
Comment 29 Katrin Fischer 2019-04-10 11:00:37 UTC
Hi Josef,

this works nicely, with one exception: on the guarantors search the number doesn't show, only ( years).

As there has been some controversy about showing this information - could you consider wrapping a span with a class around the years part?

Thx!
Comment 30 Josef Moravec 2019-04-18 09:28:39 UTC
Created attachment 88274 [details] [review]
Bug 15400: Display date of birth and age more consistantly

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>
Comment 31 Josef Moravec 2019-04-18 09:28:43 UTC
Created attachment 88275 [details] [review]
Bug 15400: (follow-up) Updating text display

Now shows as 'Born: [date of birth] (age)' in circ sidebar menu and
search results

Sponsored-by: Catalyst IT

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 32 Josef Moravec 2019-04-18 09:28:47 UTC
Created attachment 88276 [details] [review]
Bug 15400: (follow-up) Adding age to check out search dropdown

Confirm age shows in the suggestions dropdown when using the checkout
search in header (if user set DOB).
Confirm 'Age unknown' shows if no DOB set.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 33 Josef Moravec 2019-04-18 09:28:51 UTC
Created attachment 88277 [details] [review]
Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string
Comment 34 Josef Moravec 2019-04-18 09:28:55 UTC
Created attachment 88278 [details] [review]
Bug 15400: (follow-up) Add class to years span
Comment 35 Josef Moravec 2019-04-18 09:29:45 UTC
(In reply to Katrin Fischer from comment #29)
> Hi Josef,
> 
> this works nicely, with one exception: on the guarantors search the number
> doesn't show, only ( years).

Sorry, I can't reproduce it now...

> 
> As there has been some controversy about showing this information - could
> you consider wrapping a span with a class around the years part?

Done in folow-up
> 
> Thx!

Thanks for testing ;)
Comment 36 Katrin Fischer 2019-04-24 21:30:50 UTC
> As there has been some controversy about showing this information - could
> you consider wrapping a span with a class around the years part?

Hi Josef, totally my fault for not being clear :( ... I meant a span around the _whole_ age (number + text). So you can choose not to see it. 

Guarantor search is ok now (not sure what happened before) - just this little bit left.
Comment 37 Josef Moravec 2019-04-26 05:59:44 UTC
Created attachment 88845 [details] [review]
Bug 15400: (follow-up) Add class to years span
Comment 38 Josef Moravec 2019-04-26 06:00:45 UTC
Created attachment 88846 [details] [review]
Bug 15400: (follow-up) Add class to years span
Comment 39 Katrin Fischer 2019-04-27 13:25:20 UTC
Created attachment 88977 [details] [review]
Bug 15400: Display date of birth and age more consistantly

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>
Comment 40 Katrin Fischer 2019-04-27 13:25:25 UTC
Created attachment 88978 [details] [review]
Bug 15400: (follow-up) Updating text display

Now shows as 'Born: [date of birth] (age)' in circ sidebar menu and
search results

Sponsored-by: Catalyst IT

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 41 Katrin Fischer 2019-04-27 13:25:31 UTC
Created attachment 88979 [details] [review]
Bug 15400: (follow-up) Adding age to check out search dropdown

Confirm age shows in the suggestions dropdown when using the checkout
search in header (if user set DOB).
Confirm 'Age unknown' shows if no DOB set.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 42 Katrin Fischer 2019-04-27 13:25:36 UTC
Created attachment 88980 [details] [review]
Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 43 Katrin Fischer 2019-04-27 13:25:41 UTC
Created attachment 88981 [details] [review]
Bug 15400: (follow-up) Add class to years span

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 44 Nick Clemens (kidclamp) 2019-04-30 12:11:05 UTC
Needs a minor rebase
Comment 45 Josef Moravec 2020-03-03 19:25:39 UTC
Created attachment 100047 [details] [review]
Bug 15400: Display date of birth and age more consistantly

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>
Comment 46 Josef Moravec 2020-03-03 19:25:47 UTC
Created attachment 100048 [details] [review]
Bug 15400: (follow-up) Updating text display

Now shows as 'Born: [date of birth] (age)' in circ sidebar menu and
search results

Sponsored-by: Catalyst IT

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 47 Josef Moravec 2020-03-03 19:25:52 UTC
Created attachment 100049 [details] [review]
Bug 15400: (follow-up) Adding age to check out search dropdown

Confirm age shows in the suggestions dropdown when using the checkout
search in header (if user set DOB).
Confirm 'Age unknown' shows if no DOB set.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 48 Josef Moravec 2020-03-03 19:25:57 UTC
Created attachment 100050 [details] [review]
Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 49 Josef Moravec 2020-03-03 19:26:02 UTC
Created attachment 100051 [details] [review]
Bug 15400: (follow-up) Add class to years span

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 50 Josef Moravec 2020-03-03 19:27:48 UTC
Rebased on master.

This was PQA before, but as it was so long then I finally rebased it (sorry for that!) I am marking it back to signed off state.
Comment 51 Josef Moravec 2020-03-03 19:28:19 UTC
*** Bug 24770 has been marked as a duplicate of this bug. ***
Comment 52 Michal Denar 2020-03-03 20:03:29 UTC
Created attachment 100065 [details] [review]
Bug 15400: Display date of birth and age more consistantly

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>

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 53 Michal Denar 2020-03-03 20:03:33 UTC
Created attachment 100066 [details] [review]
Bug 15400: (follow-up) Updating text display

Now shows as 'Born: [date of birth] (age)' in circ sidebar menu and
search results

Sponsored-by: Catalyst IT

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 54 Michal Denar 2020-03-03 20:03:38 UTC
Created attachment 100067 [details] [review]
Bug 15400: (follow-up) Adding age to check out search dropdown

Confirm age shows in the suggestions dropdown when using the checkout
search in header (if user set DOB).
Confirm 'Age unknown' shows if no DOB set.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 55 Michal Denar 2020-03-03 20:03:43 UTC
Created attachment 100068 [details] [review]
Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 56 Michal Denar 2020-03-03 20:03:48 UTC
Created attachment 100069 [details] [review]
Bug 15400: (follow-up) Add class to years span

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 57 Jonathan Druart 2020-03-04 13:44:00 UTC
+        [%- IF ( patron.get_age ) %] ([% patron.get_age | html %] years)
+        [%- ELSIF ( patron.age ) %] ([% patron.age | html %] years)[% END -%]

That smells.
You should either test for the type of patron, or pass another variable
  patron_object vs patron
or
  patron vs borrower (that reads wrong but it is what is usually done in controllers)
Comment 58 Jonathan Druart 2020-03-04 13:51:58 UTC
Created attachment 100118 [details] [review]
Bug 15400: Clarify usage of patron-age.inc
Comment 59 Jonathan Druart 2020-03-04 13:55:02 UTC
(In reply to Jonathan Druart from comment #57)
> +        [%- IF ( patron.get_age ) %] ([% patron.get_age | html %] years)
> +        [%- ELSIF ( patron.age ) %] ([% patron.age | html %] years)[% END
> -%]
> 
> That smells.
> You should either test for the type of patron, or pass another variable
>   patron_object vs patron
> or
>   patron vs borrower (that reads wrong but it is what is usually done in
> controllers)

Sorry, I was reading the patch and not the final change. I added a follow-up.

However I still think it's lot of info that could be considered not needed by some.
Especially in the circ autocomplete.

Letting someone else adding the QA stamp.
Comment 60 Katrin Fischer 2020-03-22 16:17:15 UTC
Applying these patches, patron search does no longer work for me:
SyntaxError: JSON.parse: bad control character in string literal at line 22 column 20 of the JSON data

Please double check!
Comment 61 Aleisha Amohia 2020-04-01 04:23:33 UTC
I'm getting a different error that I'm not sure how to fix

Source map error: Error: request failed with status 404
Resource URL: http://localhost:8081/intranet-tmpl/lib/datatables/datatables.min_19.1200060.js
Source Map URL: pdfmake.min.js.map

Anyone?
Comment 62 Josef Moravec 2020-04-21 13:22:03 UTC
Created attachment 103373 [details] [review]
Bug 15400: (follow-up) Remove line break
Comment 63 Josef Moravec 2020-04-21 13:23:07 UTC
(In reply to Katrin Fischer from comment #60)
> Applying these patches, patron search does no longer work for me:
> SyntaxError: JSON.parse: bad control character in string literal at line 22
> column 20 of the JSON data
> 
> Please double check!

I fixed the bad line break, should be OK now.
Comment 64 Josef Moravec 2020-04-21 13:24:19 UTC
(In reply to Aleisha Amohia from comment #61)
> I'm getting a different error that I'm not sure how to fix
> 
> Source map error: Error: request failed with status 404
> Resource URL:
> http://localhost:8081/intranet-tmpl/lib/datatables/datatables.min_19.1200060.
> js
> Source Map URL: pdfmake.min.js.map
> 
> Anyone?

I do not think it is related with this bug anyhow...
Comment 65 Katrin Fischer 2020-06-21 16:42:35 UTC
Created attachment 106133 [details] [review]
Bug 15400: Display date of birth and age more consistantly

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>

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 66 Katrin Fischer 2020-06-21 16:42:39 UTC
Created attachment 106134 [details] [review]
Bug 15400: (follow-up) Updating text display

Now shows as 'Born: [date of birth] (age)' in circ sidebar menu and
search results

Sponsored-by: Catalyst IT

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 67 Katrin Fischer 2020-06-21 16:42:44 UTC
Created attachment 106135 [details] [review]
Bug 15400: (follow-up) Adding age to check out search dropdown

Confirm age shows in the suggestions dropdown when using the checkout
search in header (if user set DOB).
Confirm 'Age unknown' shows if no DOB set.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 68 Katrin Fischer 2020-06-21 16:42:49 UTC
Created attachment 106136 [details] [review]
Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 69 Katrin Fischer 2020-06-21 16:42:54 UTC
Created attachment 106137 [details] [review]
Bug 15400: (follow-up) Add class to years span

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 70 Katrin Fischer 2020-06-21 16:43:01 UTC
Created attachment 106138 [details] [review]
Bug 15400: Clarify usage of patron-age.inc

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 71 Katrin Fischer 2020-06-21 16:43:07 UTC
Created attachment 106139 [details] [review]
Bug 15400: (follow-up) Remove line break

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 72 Katrin Fischer 2020-06-21 16:43:13 UTC
Created attachment 106140 [details] [review]
Bug 15400: Add class on patron brief info to allow hiding date of birth

This just makes a small addition by adding a class to the new
"Born:" entry in the patron brief information area to allow for hiding
it easily with css.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 73 Jonathan Druart 2020-06-25 09:06:46 UTC
There is a misalignment: https://snipboard.io/EqYJmM.jpg

Why did you use the .label class for "Born"?
Comment 74 Josef Moravec 2020-06-25 09:52:30 UTC
(In reply to Jonathan Druart from comment #73)
> There is a misalignment: https://snipboard.io/EqYJmM.jpg
> 
> Why did you use the .label class for "Born"?

I do not really remember that.... so probably we could remove it, if someone want to hide the word "Born" it is possible through the class added in last Katrin's follow-up (thanks for that!)
Comment 75 Jonathan Druart 2020-06-25 10:09:46 UTC
Are you willing to fix the alignment issue, Josef?
Comment 76 Josef Moravec 2020-06-25 15:09:09 UTC
Created attachment 106307 [details] [review]
Bug 15400: (follow-up) Remove unnecessary class

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 77 Josef Moravec 2020-06-25 15:09:51 UTC
(In reply to Jonathan Druart from comment #75)
> Are you willing to fix the alignment issue, Josef?

Yes, it it done now
Comment 78 Jonathan Druart 2020-06-29 11:50:09 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 79 Lucas Gass (lukeg) 2020-07-13 16:41:47 UTC
not backporting this enhancement to the 20.05.x series
Comment 80 Marcel de Rooy 2020-09-16 13:30:21 UTC
(In reply to Aleisha Amohia from comment #61)
> I'm getting a different error that I'm not sure how to fix
> 
> Source map error: Error: request failed with status 404
> Resource URL:
> http://localhost:8081/intranet-tmpl/lib/datatables/datatables.min_19.1200060.
> js
> Source Map URL: pdfmake.min.js.map

While working on a datatable somehwere else, I noticed this warn/error too in the browser console. Looks to me that we are missing something in the datatables files somehow. But cant figure out what action specifically triggers it?
Dont know why I dont see it on some other datatable pages?
Comment 81 Agnes Rivers-Moore 2021-06-15 17:53:13 UTC
Need a way to turn this off! This patch seems to have been added without any way to suppress the display of patron age or date of birth, and it is all over Koha. This library does not want people's age displayed every time we check out. That is sensitive personal information. Actually we do not collect it, so Koha now wastes screen space showing "No date of birth stored" in multiple places. Please add a preference to suppress this if required by each library.  Thank you. ;-)
Comment 82 Katrin Fischer 2021-06-15 20:03:07 UTC
(In reply to Agnes Rivers-Moore from comment #81)
> Need a way to turn this off! This patch seems to have been added without any
> way to suppress the display of patron age or date of birth, and it is all
> over Koha. This library does not want people's age displayed every time we
> check out. That is sensitive personal information. Actually we do not
> collect it, so Koha now wastes screen space showing "No date of birth
> stored" in multiple places. Please add a preference to suppress this if
> required by each library.  Thank you. ;-)

Hi Agnes, actually this has a way to turn it off. See here:
class='age_years'

So all you need to do is add this line to your IntranetUserCSS:

.age_years { display:none; }

Let me know if that works in all places you need it to and if somewhere is missing, I am sure we can figure it out.
Comment 83 Jonathan Druart 2021-06-16 08:22:59 UTC
I also expressed a couple of times that I didn't like the feature. Maybe we should turn it off by default?
Comment 84 Katrin Fischer 2021-06-16 11:00:13 UTC
I think for off by default we should add an actual preference instead of using CSS. But the CSS will hopefully help for now :)

We had no comments this or that way from our mostly academic/special libraries. I imagine the feature might be interesting mostly for publics?
Comment 85 Josef Moravec 2021-06-16 11:11:56 UTC
(In reply to Katrin Fischer from comment #84)
> I think for off by default we should add an actual preference instead of
> using CSS. But the CSS will hopefully help for now :)
> 
> We had no comments this or that way from our mostly academic/special
> libraries. I imagine the feature might be interesting mostly for publics?

As I remember, the request for this development really came from public library.
Comment 86 Agnes Rivers-Moore 2021-06-16 18:35:29 UTC
(In reply to Jonathan Druart from comment #83)
> I also expressed a couple of times that I didn't like the feature. Maybe we
> should turn it off by default?

Thank you Jonathan! I don't know any reason public libraries would want to see this in day-to-day operations. Some use age to set child or adult patron type, and sending a birthday message might be cute (I find it creepy). None of that is reason to see it daily, but libraries in another country might. (I have worked libraries in England, South Africa and Canada.)
Comment 87 Agnes Rivers-Moore 2021-06-16 18:40:34 UTC
There are two or three fields we need to suppress. One is the date of birth, one is the age in years, and the third is the message that displays if there is nothing to display.

    Born: 03/29/1951 (70 years)  or
    No date of birth stored.

We tried the CSS that Katrin suggested, and it does not cover all those cases. It would need to hide DOB and Age. Also as we do not collect DOB, we need to hide whatever generates the message if DOB is empty. That would likely be useful for libraries that collect DOB only for children, not adults.  Thank you!
Comment 88 Marcel de Rooy 2021-06-17 06:36:01 UTC
This is privacy issue too. GDPR etc.
Note that we (as a special library) removed all birthdates from our system.
Hopefully we dont have lots of uninitialized warnings too?
Comment 89 Michal Denar 2021-06-17 06:52:32 UTC
I don't think that displaying age and date of birth in the interface for librarians is in privacy with security and GDPR. It depends on how the library has the area covered in their documents. Our libraries use the age information in the normal course of business in some cases to verify the reader if they don't have a library card, etc. Certainly this feature can be optional, but it should be available.
Comment 90 Michal Denar 2021-06-17 06:53:42 UTC
I don't think that displaying age and date of birth in the interface for librarians is privacy issue or against GDPR rules. It depends on how the library has the area covered in their documents. Our libraries use the age information in the normal course of business in some cases to verify the reader if they don't have a library card, etc. Certainly this feature can be optional, but it should be available.
Comment 91 Marcel de Rooy 2021-06-17 07:12:23 UTC
(In reply to Michal Denar from comment #90)
> I don't think that displaying age and date of birth in the interface for
> librarians is privacy issue or against GDPR rules. It depends on how the
> library has the area covered in their documents. Our libraries use the age
> information in the normal course of business in some cases to verify the
> reader if they don't have a library card, etc. Certainly this feature can be
> optional, but it should be available.

Sure. s/is/could be/
More what I meant.
Comment 92 Katrin Fischer 2021-06-17 11:03:40 UTC
(In reply to Agnes Rivers-Moore from comment #87)
> There are two or three fields we need to suppress. One is the date of birth,
> one is the age in years, and the third is the message that displays if there
> is nothing to display.
> 
>     Born: 03/29/1951 (70 years)  or
>     No date of birth stored.
> 
> We tried the CSS that Katrin suggested, and it does not cover all those
> cases. It would need to hide DOB and Age. Also as we do not collect DOB, we
> need to hide whatever generates the message if DOB is empty. That would
> likely be useful for libraries that collect DOB only for children, not
> adults.  Thank you!

Hi Agnes, the date of birth and the message are - as you say - separate issues. But we can also help with CSS there and maybe prefs there.

There are some options. In the example above, the years bit should be gone now, correct?
And you do collect the date of birth from your patrons, but you don't want to display it in circulation? Check for the HidePersonalPatronDetailOnCirculation  system preference. It should do just that :)
Comment 93 Agnes Rivers-Moore 2021-06-17 14:15:35 UTC
(In reply to Katrin Fischer from comment #92)
> (In reply to Agnes Rivers-Moore from comment #87)
> > There are two or three fields we need to suppress. One is the date of birth,
> > one is the age in years, and the third is the message that displays if there
> > is nothing to display.
> > 
> >     Born: 03/29/1951 (70 years)  or
> >     No date of birth stored.
> > 
> > We tried the CSS that Katrin suggested, and it does not cover all those
> > cases. It would need to hide DOB and Age. Also as we do not collect DOB, we
> > need to hide whatever generates the message if DOB is empty. That would
> > likely be useful for libraries that collect DOB only for children, not
> > adults.  Thank you!
> 
> Hi Agnes, the date of birth and the message are - as you say - separate
> issues. But we can also help with CSS there and maybe prefs there.
> 
> There are some options. In the example above, the years bit should be gone
> now, correct?
> And you do collect the date of birth from your patrons, but you don't want
> to display it in circulation? Check for the
> HidePersonalPatronDetailOnCirculation  system preference. It should do just
> that :)

Hi Katrin
We have all of it hidden now with a combination of CSS and JS, but there is a flicker when the screen redraws. So, our library has a fix in, but still would like to see this as a preference.
We do not collect DOB for all patrons.
We don't want to hide ALL personal information - we need phone and email. The preference hides everything. We only want to hide age/DOB. Thanks!