Bugzilla – Attachment 157865 Details for
Bug 32610
Add ability to specify patron attribute as a date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32610: Add date extended patron attributes to patron module
Bug-32610-Add-date-extended-patron-attributes-to-p.patch (text/plain), 8.55 KB, created by
Shi Yao Wang
on 2023-10-25 18:56:14 UTC
(
hide
)
Description:
Bug 32610: Add date extended patron attributes to patron module
Filename:
MIME Type:
Creator:
Shi Yao Wang
Created:
2023-10-25 18:56:14 UTC
Size:
8.55 KB
patch
obsolete
>From 2a33dca76a60031c30124e55e9f037e306b26590 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >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 <philip.orr@lmscloud.de> >--- > .../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 ead8c18fbe..94ace19a73 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -110,7 +110,12 @@ > [% IF ( extendedattribute.type.display_checkout ) %] [%# FIXME We should filter in the line above %] > [% IF ( extendedattribute.attribute ) %] [%# FIXME Why that? why not if == 0? %] > <li class="patronattribute"> >- <span class="patronattributelabel">[% extendedattribute.type.description | html %]</span>: [% extendedattribute.description | html %] >+ <span class="patronattributelabel">[% extendedattribute.type.description | html %]</span>: >+ [% IF extendedattribute.type.is_date %] >+ [% extendedattribute.description | $KohaDates %] >+ [% ELSE %] >+ [% extendedattribute.description | html %] >+ [% END %] > </li> > [% 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 8374ee944e..e461ca039b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1562,13 +1562,23 @@ legend:hover { > </select> > [% ELSE %] > [% IF patron_attribute.mandatory %] >- <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required">[% patron_attribute.value | html %]</textarea> >+ [% IF patron_attribute.is_date %] >+ <input type="text" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" maxlength="10" size="10" value="[% patron_attribute.value | html %]" required="required" class="flatpickr" data-date_to="to" /> >+ [% ELSE %] >+ <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required">[% patron_attribute.value | html %]</textarea> >+ [% END %] > [% ELSE %] >- <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">[% patron_attribute.value | html %]</textarea> >+ [% IF patron_attribute.is_date %] >+ <input type="text" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" maxlength="10" size="10" value="[% patron_attribute.value | html %]" class="flatpickr" data-date_to="to" /> >+ [% ELSE %] >+ <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">[% patron_attribute.value | html %]</textarea> >+ [% END %] > [% END %] > [% END # /IF ( patron_attribute.use_dropdown ) %] > <input type="hidden" id="[% patron_attribute.form_id | html %]_code" name="[% patron_attribute.form_id | html %]_code" value="[% patron_attribute.code | html %]" /> >- <a href="#" class="clear_attribute"><i class="fa fa-fw fa-trash-can"></i> Clear</a> >+ [% IF ( !patron_attribute.is_date ) %] >+ <a href="#" class="clear_attribute"><i class="fa fa-fw fa-trash-can"></i> Clear</a> >+ [% END %] > [% IF ( patron_attribute.repeatable ) %] > <a href="#" class="clone_attribute"><i class="fa fa-fw fa-plus"></i> New</a> > [% 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 f070c3eb97..aa063e2fdd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -326,7 +326,11 @@ > [% FOREACH item IN attribute.items %] > <li data-pa_code="[% item.type.code | replace('[^a-zA-Z0-9_-]', '') %]"> > <span class="label">[% item.type.description | html %]: </span> >- [% item.description | html_line_break %] >+ [% IF item.type.is_date %] >+ [% item.description | $KohaDates %] >+ [% ELSE %] >+ [% item.description | html_line_break %] >+ [% END %] > </li> > [% END %] > </ol> >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 360fd2a6b3..52ef74c490 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -853,6 +853,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.34.1
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 32610
:
148400
|
148401
|
148402
|
148403
|
148404
|
148405
|
148825
|
148826
|
148827
|
148828
|
148829
|
148830
|
157862
|
157863
|
157864
|
157865
|
157866
|
157867
|
157868
|
158994
|
158995
|
158996
|
158997
|
158998
|
158999
|
159000
|
165747
|
165750
|
165854
|
165855
|
165856
|
165857
|
165858
|
165859
|
165860
|
165861
|
165862
|
165863
|
165864
|
165865
|
165925
|
165926