Bugzilla – Attachment 148828 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.48 KB, created by
Philip Orr
on 2023-03-28 14:00:53 UTC
(
hide
)
Description:
Bug 32610: Add date extended patron attributes to patron module
Filename:
MIME Type:
Creator:
Philip Orr
Created:
2023-03-28 14:00:53 UTC
Size:
8.48 KB
patch
obsolete
>From 2a1af4d10a0b8e53340a0547294d782d42e479de 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 be02b213ec..613b4cdb52 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -106,7 +106,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 10a4a4d601..fe5ce6ee98 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1575,13 +1575,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"></i> Clear</a> >+ [% IF ( !patron_attribute.is_date ) %] >+ <a href="#" class="clear_attribute"><i class="fa fa-fw fa-trash"></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 9cadcd5709..7b6baecc86 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -320,7 +320,11 @@ > [% FOREACH item IN attribute.items %] > <li> > <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 0193cc3777..af2e333380 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -864,6 +864,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.30.2
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