Bugzilla – Attachment 168896 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), 4.04 KB, created by
Jan Kissig
on 2024-07-12 12:08:17 UTC
(
hide
)
Description:
Bug 32581: Add confirmation modal
Filename:
MIME Type:
Creator:
Jan Kissig
Created:
2024-07-12 12:08:17 UTC
Size:
4.04 KB
patch
obsolete
>From 2694291cc6f93e78a66fa96f98d7fb7b1b1e02a4 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 | 20 +++++++++++++++++++ > koha-tmpl/intranet-tmpl/prog/js/members.js | 19 +++++++++++------- > 2 files changed, 32 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 eb2f49b32b..6ec4835565 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1752,6 +1752,26 @@ legend.collapsed i.fa.fa-caret-down::before { > </div> <!-- /.col-sm-2.col-sm-pull-10 --> > [% END %] > </div> <!-- /.row --> >+ >+ <!-- 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 %] > [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %] > [% INCLUDE 'calendar.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index 9afce16e7b..48e87f8478 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -84,13 +84,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.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 32581
:
168476
|
168763
|
168838
|
168895
| 168896