Bug 15400: (follow-up) Adding age to check out search dropdown
authorAleisha Amohia <aleishaamohia@hotmail.com>
Thu, 21 Feb 2019 20:44:20 +0000 (20:44 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 29 Jun 2020 10:37:02 +0000 (12:37 +0200)
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>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

circ/ysearch.pl
koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc

index 5db55ff..ee16d10 100755 (executable)
@@ -85,6 +85,7 @@ while ( my $b = $borrowers_rs->next ) {
         firstname      => $b->firstname  // '',
         cardnumber     => $b->cardnumber // '',
         dateofbirth    => format_sqldatetime($b->dateofbirth, undef, undef, 1) // '',
+        age            => $b->get_age    // 'Age unknown',
         address        => $b->address    // '',
         city           => $b->city       // '',
         zipcode        => $b->zipcode    // '',
index 7e7604b..7569a24 100644 (file)
                         }
                         return $( "<li></li>" )
                         .data( "ui-autocomplete-item", item )
-                        .append( "<a href=\"" + item.link + "\">" + item.surname + ", " + item.firstname + cardnumber + " <small>" + item.dateofbirth + " " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
+                        .append( "<a href=\"" + item.link + "\">" + item.surname + ", " + item.firstname + cardnumber + " <small>" + item.dateofbirth + " (" + item.age + ") " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
                         .appendTo( ul );
                     };
                 }