From e22e0e09dd9a1e3aad3fb2a8e3d93459cacac597 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Sat, 18 Mar 2023 10:13:09 +0000 Subject: [PATCH] Bug 32610: Add date extended patron attributes to patron module This makes the necessary changes in the patron module of the staff interface, so the new patron attribute appers and behaves correctly when editing a patron record. To test: * You will need to test different configuration options for extended patron attributes (PA) in combination with the date option: * PA is a date and not mandatory * Patron form should have the calendar widget to let you set the date. * PA is a date and mandatory * Patron form shoudl have calendar widget and check that the date is set for allowing you to save the record. * PA is a date and unique * For this set the date in one patron record and try to set the same date in another. You should not be able to save. * PA displays in brief patron information * Make sure the date displays on the left formatted correctly * When the date PAs are saved, they should display nicely formatted on the details tab. Signed-off-by: Philip Orr Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- .../intranet-tmpl/prog/en/includes/circ-menu.inc | 7 ++++++- .../prog/en/modules/members/memberentrygen.tt | 16 +++++++++++++--- .../prog/en/modules/members/moremember.tt | 6 +++++- members/memberentry.pl | 1 + 4 files changed, 25 insertions(+), 5 deletions(-) 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 6facc63971..b54aa71d6e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -115,7 +115,12 @@ [% IF ( extendedattribute.type.display_checkout ) %] [%# FIXME We should filter in the line above %] [% IF ( extendedattribute.attribute.defined ) %]
  • - [% extendedattribute.type.description | html %]: [% extendedattribute.description | html %] + [% extendedattribute.type.description | html %]: + [% IF extendedattribute.type.is_date %] + [% extendedattribute.description | $KohaDates %] + [% ELSE %] + [% extendedattribute.description | html %] + [% END %]
  • [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 274b9c21f7..bd2bd23ae7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1657,13 +1657,23 @@ legend.collapsed i.fa.fa-caret-down::before { [% ELSE %] [% IF patron_attribute.mandatory %] - + [% IF patron_attribute.is_date %] + + [% ELSE %] + + [% END %] [% ELSE %] - + [% IF patron_attribute.is_date %] + + [% ELSE %] + + [% END %] [% END %] [% END # /IF ( patron_attribute.use_dropdown ) %] - Clear + [% IF ( !patron_attribute.is_date ) %] + Clear + [% END %] [% IF ( patron_attribute.repeatable ) %] New [% 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 6d8ee98f69..cd209c43cc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -335,7 +335,11 @@ [% FOREACH item IN attribute.items %]
  • [% item.type.description | html %]: - [% item.description | html_line_break %] + [% IF item.type.is_date %] + [% item.description | $KohaDates %] + [% ELSE %] + [% item.description | html_line_break %] + [% END %]
  • [% END %] diff --git a/members/memberentry.pl b/members/memberentry.pl index e28e8c1449..fe0d1beff0 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -880,6 +880,7 @@ sub patron_attributes_form { category => $attr_type->authorised_value_category(), category_code => $attr_type->category_code(), mandatory => $attr_type->mandatory(), + is_date => $attr_type->is_date(), }; if (exists $attr_hash{$attr_type->code()}) { foreach my $attr (@{ $attr_hash{$attr_type->code()} }) { -- 2.39.5