Bugzilla – Attachment 165862 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: make date attributes repeatable
Bug-32610-make-date-attributes-repeatable.patch (text/plain), 3.87 KB, created by
Martin Renvoize (ashimema)
on 2024-04-30 11:56:20 UTC
(
hide
)
Description:
Bug 32610: make date attributes repeatable
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-30 11:56:20 UTC
Size:
3.87 KB
patch
obsolete
>From 85fd41d43e02a22896b5d2156ede7b60db948009 Mon Sep 17 00:00:00 2001 >From: Shi Yao Wang <shi-yao.wang@inlibro.com> >Date: Mon, 29 Apr 2024 12:26:06 -0400 >Subject: [PATCH] Bug 32610: make date attributes repeatable > >Test plan: >1- create a patron attribute type with is a date and repeatable checked >(administration -> patron attribute types) >2- add a couple of patron attribute of type date >3- Save >4- Edit to see if everything has been stored correctly > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../en/modules/admin/patron-attr-types.tt | 19 ++++--------------- > koha-tmpl/intranet-tmpl/prog/js/members.js | 9 +++++++++ > 2 files changed, 13 insertions(+), 15 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >index b612f55b851..326d8edc862 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >@@ -148,17 +148,14 @@ > <span class="hint">If checked, attribute will be a unique identifier. If a value is given to a patron record, the same value > cannot be given to a different record.</span> > </li> >- >- <li> >- <label for="is_date">Is a date: </label> >- [% IF attribute_type.is_date %] >+ <li><label for="is_date">Is a date: </label> >+ [% IF attribute_type AND attribute_type.is_date %] > <input type="checkbox" id="is_date" name="is_date" checked="checked" /> > [% ELSE %] > <input type="checkbox" id="is_date" name="is_date" /> > [% END %] > <span class="hint">If checked, attribute will be a date. Date attributes cannot be repeatable or linked to an authorised value category.</span> > </li> >- > <li><label for="opac_display">Display in OPAC: </label> > [% IF attribute_type AND attribute_type.opac_display %] > <input type="checkbox" id="opac_display" name="opac_display" checked="checked" /> >@@ -443,17 +440,9 @@ > > $("#is_date").change( function() { > if ( this.checked ) { >- $("#repeatable, #authorised_value_category").attr('disabled', true).parent().attr('aria-disabled', 'true'); >- } else { >- $("#repeatable, #authorised_value_category").removeAttr('disabled').parent().removeAttr('aria-disabled'); >- } >- } ).change(); >- >- $("#repeatable").change( function() { >- if ( this.checked ) { >- $("#is_date").attr('disabled', true).parent().attr('aria-disabled', 'true'); >+ $("#authorised_value_category").attr('disabled', true).parent().attr('aria-disabled', 'true'); > } else { >- $("#is_date").removeAttr('disabled').parent().removeAttr('aria-disabled'); >+ $("#authorised_value_category").removeAttr('disabled').parent().removeAttr('aria-disabled'); > } > } ).change(); > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index d460b4c41e9..7e4806fa234 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -57,6 +57,15 @@ function clone_entry(node) { > $("input#patron_attr_" + newId, clone).attr('value',''); > $("select#patron_attr_" + newId, clone).attr('value',''); > $(original).after(clone); >+ >+ // regenerate flatpickr calendars to add event listeners >+ $(`.flatpickr_wrapper`, clone).remove(); >+ var date = $("> .flatpickr", original).val(); >+ $(".flatpickr", clone).each(function(){ >+ apply_flatpickr(this); >+ }); >+ $(`.flatpickr_wrapper .flatpickr, #patron_attr_${newId}.flatpickr`, clone).val(date); >+ > return false; > } > >-- >2.44.0
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