Bugzilla – Attachment 168763 Details for
Bug 32581
Update dateexpiry on categorycode change
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32581: Automatically update patron expiration date when changing their category
Bug-32581-Automatically-update-patron-expiration-d.patch (text/plain), 4.31 KB, created by
Roman Dolny
on 2024-07-10 18:28:54 UTC
(
hide
)
Description:
Bug 32581: Automatically update patron expiration date when changing their category
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2024-07-10 18:28:54 UTC
Size:
4.31 KB
patch
obsolete
>From 3166947ce78dbeac4a6e12fe59ec16e392482a5a Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >Date: Wed, 3 Jul 2024 20:09:37 +0000 >Subject: [PATCH] Bug 32581: Automatically update patron expiration date when > changing their category > >To test: >1) In Administration-> Patron categories, set the enrollment period for the 'School' category to 12 months. >2) Find a patron that is from another category, edit their info and change their category from patron to school. >3) Note that the expiry date automatically changes to 12 months from today. >4) Save your changes and ensure on the patron's detail page that their expiration date was successfully changed. > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > .../prog/en/modules/members/memberentrygen.tt | 4 ++-- > koha-tmpl/intranet-tmpl/prog/js/members.js | 11 +++++++++++ > 2 files changed, 13 insertions(+), 2 deletions(-) > >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 6877ef453f..eb2f49b32b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1007,9 +1007,9 @@ legend.collapsed i.fa.fa-caret-down::before { > [% END %] > [% FOREACH category IN patron_categories.$category_type %] > [% IF category.categorycode == patron_category.categorycode %] >- <option value="[% category.categorycode | html %]" selected="selected" data-pwd-length="[% category.effective_min_password_length | html %]" data-pwd-strong="[% category.effective_require_strong_password | html %]" data-typename="[% category_type | html %]">[% category.description | html %]</option> >+ <option value="[% category.categorycode | html %]" selected="selected" data-pwd-length="[% category.effective_min_password_length | html %]" data-pwd-strong="[% category.effective_require_strong_password | html %]" data-typename="[% category_type | html %]" data-expiry-date="[% category.get_expiry_date | html %]">[% category.description | html %]</option> > [% ELSE %] >- <option value="[% category.categorycode | html %]" data-pwd-length="[% category.effective_min_password_length | html %]" data-pwd-strong="[% category.effective_require_strong_password | html %]" data-typename="[% category_type | html %]">[% category.description | html %]</option> >+ <option value="[% category.categorycode | html %]" data-pwd-length="[% category.effective_min_password_length | html %]" data-pwd-strong="[% category.effective_require_strong_password | html %]" data-typename="[% category_type | html %]" data-expiry-date="[% category.get_expiry_date | html %]">[% category.description | html %]</option> > [% END %] > [% END %] > </optgroup> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index 2f58cb888c..9afce16e7b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -81,6 +81,17 @@ function update_category_code(category_code) { > var min_length = $('select'+category_selector+' option:selected').data('pwdLength'); > var hint_string = __("Minimum password length: %s").format(min_length); > hint.html(hint_string); >+ >+ // Change patron's expiration date >+ $('#categorycode_entry').change(function() { >+ var fp = $("#to").flatpickr(); >+ var expiryDate = $('select'+category_selector+' option:selected').data('expiryDate'); >+ // Check if expiryDate is available and format it to YYYY-MM-DD >+ if (expiryDate) { >+ var formattedDate = expiryDate.split('T')[0]; >+ fp.setDate(formattedDate); >+ } >+ }); > } > > function select_user(borrowernumber, borrower, relationship) { >-- >2.39.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 32581
:
168476
|
168763
|
168838
|
168895
|
168896