Bugzilla – Attachment 162459 Details for
Bug 36060
If issues table includes overdues 'Renew selected items' button is disabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36060: Simplify logic to enable/disable CheckinChecked/RenewChecked buttons
Bug-36060-Simplify-logic-to-enabledisable-CheckinC.patch (text/plain), 6.23 KB, created by
Brendan Lawlor
on 2024-02-26 15:43:56 UTC
(
hide
)
Description:
Bug 36060: Simplify logic to enable/disable CheckinChecked/RenewChecked buttons
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2024-02-26 15:43:56 UTC
Size:
6.23 KB
patch
obsolete
>From 2a4f273ebb366a4171764a9f6f7e3e55578d075f Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 9 Feb 2024 18:14:50 +0000 >Subject: [PATCH] Bug 36060: Simplify logic to enable/disable > CheckinChecked/RenewChecked buttons > >This patch attempts to simplify for disabling/enabling the 'Check in selected items' and 'Renewal selected items' buttons. > >To test: >1. APPLY patch, clear browser's cache >2. Have more than 1 checkout issued to a borrower. >3. Load the checkout table on circ/circulation.pl >4. Notice that there is now 'Renew selected items' and 'Checkin > selected items' button. >5. Play around with each making sure that they work as excepted when > checkouts are checked in either the 'Check in' or 'Renew' columns. >6. Uncheck everything in the 'Renew column', the 'Renew selected items' > button should be disabled. >7. Uncheck everything in the 'Checkin column', the 'Checkin selected > items' button should be disabled. >8. Try unchecking some of these to make sure the Renew/Checkin button is > properly disabled when no related checkboxes are checked. >9. Try using the select all/none options at the top of both the 'Renew' > and 'Checkin' columns. Make sure the 'Renew selected items' and > 'Checkin selected items' become properly disabled/enabled. >10. Make sure the 'Renew all' button still works properly. > >11. Have two checkouts. Click one for Renew and one for Checkin. Click on Check in selected items. >12. When the table reloads the 'renew' selections should be retained >13. Have two checkouts. Click one for Renew and one for Checkin. Click on Renew selected items. >14. When the table reloads the 'check in' selections should be retained > >15. Have overdues >16. Go to a patron account and load the issue table >17. The items that are overdue are checked for renewal by default >16. The 'Renew selected items' button show be enabled. > >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >--- > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 40 ++++++++------------ > 1 file changed, 16 insertions(+), 24 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 3ab2ec6592..918a24eee2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -1,5 +1,9 @@ > /* global __ */ > >+function CheckRenewCheckinBoxes() { >+ $('#RenewChecked').prop('disabled', !$('.renew:checked').length ); >+ $('#CheckinChecked').prop('disabled', !$('.checkin:checked').length ); >+} > > function RefreshIssuesTable() { > var table = $('#issues-table').DataTable(); >@@ -10,21 +14,9 @@ function RefreshIssuesTable() { > return this.value; > }).get(); > table.ajax.reload( function() { >- $('#RenewChecked, #CheckinChecked').prop('disabled' , true ); >- if ( renewchecked.length ) { >- $('#RenewChecked').prop('disabled' , false ); >- renewchecked.forEach( function(checked) { >- $('.renew[value="'+checked+'"]').prop('checked' , true ); >- }); >- } >- if ( checkinchecked.length ) { >- $('#CheckinChecked').prop('disabled' , false ); >- checkinchecked.forEach( function(checked) { >- $('.checkin[value="'+checked+'"]').prop('checked' , true ); >- }); >- } >- var checkout_count = table.page.info().recordsTotal; >- $('.checkout_count').text(checkout_count); >+ CheckRenewCheckinBoxes(); >+ var checkout_count = table.page.info().recordsTotal; >+ $('.checkout_count').text(checkout_count); > }); > } > >@@ -430,6 +422,8 @@ function LoadIssuesTable() { > } > }, > "initComplete": function(oSettings, json) { >+ CheckRenewCheckinBoxes(); >+ > // Build a summary of checkouts grouped by itemtype > var checkoutsByItype = json.aaData.reduce(function (obj, row) { > obj[row.type_for_stat] = (obj[row.type_for_stat] || 0) + 1; >@@ -495,13 +489,13 @@ $(document).ready(function() { > $("#CheckAllRenewals").on("click",function(){ > $("#UncheckAllCheckins").click(); > $(".renew:visible").prop("checked", true); >- $('#RenewChecked').prop('disabled', !$('.renew:checked').length ); >+ CheckRenewCheckinBoxes(); > showHideOnHoldRenewal(); > return false; > }); > $("#UncheckAllRenewals").on("click",function(){ > $(".renew:visible").prop("checked", false); >- $('#RenewChecked').prop('disabled', !$('.renew:checked').length ); >+ CheckRenewCheckinBoxes(); > showHideOnHoldRenewal(); > return false; > }); >@@ -509,12 +503,12 @@ $(document).ready(function() { > $("#CheckAllCheckins").on("click",function(){ > $("#UncheckAllRenewals").click(); > $(".checkin:visible").prop("checked", true); >- $('#CheckinChecked').prop('disabled', !$('.checkin:checked').length ); >+ CheckRenewCheckinBoxes(); > return false; > }); > $("#UncheckAllCheckins").on("click",function(){ > $(".checkin:visible").prop("checked", false); >- $('#CheckinChecked').prop('disabled', !$('.checkin:checked').length ); >+ CheckRenewCheckinBoxes(); > return false; > }); > >@@ -533,15 +527,13 @@ $(document).ready(function() { > if ( $(this).is(":checked") ) { > $( "#checkin_" + $(this).val() ).prop("checked", false); > } >- $('#CheckinChecked').prop('disabled', !$('.checkin:checked').length ); >- $('#RenewChecked').prop('disabled', !$('.renew:checked').length ); >+ CheckRenewCheckinBoxes(); > }); > $(document).on("change", '.checkin', function(){ > if ( $(this).is(":checked") ) { > $( "#renew_" + $(this).val() ).prop("checked", false); > } >- $('#CheckinChecked').prop('disabled', !$('.checkin:checked').length ); >- $('#RenewChecked').prop('disabled', !$('.renew:checked').length ); >+ CheckRenewCheckinBoxes(); > }); > > // Display on hold due dates input when an on hold item is >@@ -619,7 +611,7 @@ $(document).ready(function() { > if ( refresh_table ) { > RefreshIssuesTable(); > } >- $('#RenewChecked, #CheckinChecked').prop('disabled' , true ); >+ CheckRenewCheckinBoxes(); > // Prevent form submit > return false; > }); >-- >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 36060
:
161991
|
162459
|
162673
|
164036
|
166723
|
166942
|
166943