Bugzilla – Attachment 182520 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: Add confirmation modal
Bug-32581-Add-confirmation-modal.patch (text/plain), 3.92 KB, created by
Janusz Kaczmarek
on 2025-05-16 11:54:46 UTC
(
hide
)
Description:
Bug 32581: Add confirmation modal
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2025-05-16 11:54:46 UTC
Size:
3.92 KB
patch
obsolete
>From 862aed2733ecc63d447b51a9c9cf55c57a4af57c Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >Date: Thu, 11 Jul 2024 16:03:26 +0000 >Subject: [PATCH] Bug 32581: Add confirmation modal > >This patch makes changing the expiration date optional, by providing a modal when switching a patron category. Confirming the modal will change the expiration date to the default and cancelling will keep the same expiration date. > >To test: >1) Same plan as before except now there is a modal when changing the patron category. >- Attempt confirming the modal: expiration date should change to default. >- Attempt canceling the modal: expiration date should stay the same > >Signed-off-by: Jan Kissig <jkissig@th-wildau.de> >--- > .../prog/en/modules/members/memberentrygen.tt | 19 +++++++++++++++++++ > koha-tmpl/intranet-tmpl/prog/js/members.js | 19 ++++++++++++------- > 2 files changed, 31 insertions(+), 7 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 ec7c493421..279ad8c9eb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1661,6 +1661,25 @@ > </div> > <!-- /.main.container-fluid --> > >+ <!-- Expiration date modal--> >+ <div id="expirationDateModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="expirationDateModalLabel" aria-hidden="true"> >+ <div class="modal-dialog" role="document"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> >+ <h4 class="modal-title" id="expirationDateModalLabel">Confirm expiration date</h4> >+ </div> >+ <div class="modal-body"> >+ <p>Change expiration date to default for this category?</p> >+ </div> >+ <div class="modal-footer"> >+ <button id="expirationDateConfirmBtn" class="btn btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Yes</button> >+ <button id="expirationDateCancelBtn"data-dismiss="modal" class="btn btn-secondary"><i class="fa fa-times" aria-hidden="true"></i> No</button> >+ </div> >+ </div> >+ </div> >+ </div> >+ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'str/members-menu.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index 55cffbc504..b3b77c5490 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -91,13 +91,18 @@ function update_category_code(category_code) { > > // 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); >- } >+ $('#expirationDateModal').modal('show'); >+ // Handle confirmation Yes button click >+ $('#expirationDateConfirmBtn').on('click', 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); >+ } >+ $('#expirationDateModal').modal('hide'); >+ }); > }); > } > >-- >2.39.5
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
|
182519
| 182520