From bd1bd83f624ca5c7d4bee10bc2e09b7877bab941 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 10 Nov 2025 11:46:02 +0100 Subject: [PATCH] Bug 19814: More template changes Content-Type: text/plain; charset=utf-8 Add more AddReturn codes to result loop (like ResFound, BadBarcode etc). Add a class to NotIssued to optionally hide. Open circ settings, enable batch mode when pref enabled. Add additional batch mode settings. Toggle display of additional batch mode settings. Load/save batch mode settings from localStorage. Make confirm hold/transfer settings respect system preferences HoldsAutoFill/AutomaticItemReturn. --- .../prog/en/modules/circ/returns.tt | 94 ++++++++++++++++++- 1 file changed, 92 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 63d374eb18..c47cad9ec3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -1274,6 +1274,20 @@
+ +
+ + +
+ + +
+ + +
+ + +
[% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %] @@ -1343,14 +1357,37 @@
Item transferred to [% result.messages.TransferTo %]
[% ELSIF code == 'NeedsTransfer' %]
Item needs transfer
+ [% ELSIF code == 'RecallNeedsTransfer' %] +
Recall needs transfer
[% ELSIF code == 'NotIssued' %] -
Item was not checked out
+
Item was not checked out
[% ELSIF code == 'WasLost' %]
Item was lost, now found
[% ELSIF code == 'withdrawn' %]
Item is withdrawn
- [% ELSIF code == 'Debarred' %] + [% ELSIF code.match('Debarred|ForeverDebarred|PrevDebarred') %]
Patron is restricted
+ [% ELSIF code == 'ResFound' %] +
Hold found
+ [% ELSIF code == 'RecallFound' %] +
Recall found
+ [% ELSIF code == 'BadBarcode' %] +
Bad barcode
+ [% ELSIF code == 'TransferArrived' %] +
Transfer arrived from [% result.messages.TransferArrived %]
+ [% ELSIF code == 'TransferredRecall' %] +
Recalled item has been transferred
+ [% ELSIF code == 'WrongTransfer' %] +
This item is still on transfer to [% result.messages.WrongTransfer %]
+ [% ELSIF code == 'Wrongbranch'%] +
This item cannot be returned to this branch
+ [% ELSIF code == 'UpdateLastSeenError'%] +
Error: Patron's last seen date could not be updated; see system logs.
+ [% ELSIF code.match('Transfer(To|Trigger)|WrongTransferItem|WasReturned|LostItem.+|ProcessingFeeRefunded') # ignore %] + [% ELSIF code.match('ClaimAutoResolved|ReturnClaims') # ignored too for now %] + [% ELSIF code == 'InBundle' # TODO %] + [% ELSE # unexpected codes %] +
Received code [% code %] from AddReturn. Contact support.
[% END %] [% END %] @@ -1601,6 +1638,53 @@ var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top'); $("#barcode").focus(); } + function ApplyBatchCheckinSettings() { + // check local storage key, fallback to system preference + var batch_mode_settings = localStorage.getItem("batch_mode_settings") || + '[% Koha.Preference('BatchCheckinDefaults') %]'; + + if ( batch_mode_settings.match('BATCH_CHECKIN_ENABLED') ) { + $("#show-circ-settings a").trigger('click'); + $('#batch-mode-toggle').prop('checked', true).trigger('change'); + } + if ( batch_mode_settings.match('BATCH_CHECKIN_KEEP_SELECTION') ) + $('#batch-mode-keep-selection').prop('checked', true); + if ( batch_mode_settings.match('BATCH_CHECKIN_IGNORE_NOTISSUED') ) { + $('#batch-mode-ignore-notissued').prop('checked', true); + $('div.alert.notissued').hide(); + } + + // Confirm hold setting depends on HoldsAutoFill + if ( "[% Koha.Preference('HoldsAutoFill') %]" == "1" ) + $('#batch-mode-confirm-hold') + .attr('title', '[% t("Forced by preference HoldsAutoFill") %]' ) + .prop('checked', true).prop('disabled', true); + else if ( batch_mode_settings.match('BATCH_CHECKIN_CONFIRM_HOLD') ) + $('#batch-mode-confirm-hold').prop('checked', true); + + // Confirm transfer setting depends on AutomaticItemReturn + if ( "[% Koha.Preference('AutomaticItemReturn') %]" == "1" ) + $('#batch-mode-confirm-transfer') + .attr('title', '[% t("Forced by preference AutomaticItemReturn") %]' ) + .prop('checked', true).prop('disabled', true); + else if ( batch_mode_settings.match('BATCH_CHECKIN_CONFIRM_TRANSFER') ) + $('#batch-mode-confirm-transfer').prop('checked', true); + } + function ChangeBatchCheckinSettings() { + // if user does not want to keep, we remove his settings in localStorage + if( !$('#batch-mode-keep-selection').prop('checked') ) { + localStorage.removeItem("batch_mode_settings"); + return; + } + + // Save current settings + var batch_mode_settings = 'BATCH_CHECKIN_KEEP_SELECTION,'; + if ( $('#batch-mode-toggle').prop('checked') ) batch_mode_settings += 'BATCH_CHECKIN_ENABLED,'; + if ( $('#batch-mode-ignore-notissued').prop('checked') ) batch_mode_settings += 'BATCH_CHECKIN_IGNORE_NOTISSUED,'; + if ( $('#batch-mode-confirm-hold').prop('checked') ) batch_mode_settings += 'BATCH_CHECKIN_CONFIRM_HOLD,'; + if ( $('#batch-mode-confirm-transfer').prop('checked') ) batch_mode_settings += 'BATCH_CHECKIN_CONFIRM_TRANSFER,'; + localStorage.setItem( "batch_mode_settings", batch_mode_settings ); + } $(document).ready(function () { $("#checkin-form").preventDoubleFormSubmit(); @@ -1853,6 +1937,7 @@ 'white-space': 'pre-wrap', 'resize': 'vertical' }); + $('#batch-mode-more-settings').show(); } else { // Switch back to single-line mode $barcodeTextarea.attr({ @@ -1864,6 +1949,7 @@ 'white-space': 'nowrap', 'resize': 'none' }); + $('#batch-mode-more-settings').hide(); } $barcodeTextarea.focus(); }); @@ -1887,6 +1973,7 @@ // Set a debounce timer to submit after RFID scanning finishes debounceTimer = setTimeout(function() { isReceivingRFIDInput = false; + ChangeBatchCheckinSettings(); $('#checkin-form').submit(); }, 500); // 500ms delay after last input } @@ -1918,6 +2005,9 @@ }); [% END %] [% END %] + + ApplyBatchCheckinSettings(); + }); [% END %] -- 2.39.5