Bugzilla – Attachment 127807 Details for
Bug 29519
Add option to resolve a return claim at checkin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29519: Allow resolution of claims return at checkin
Bug-29519-Allow-resolution-of-claims-return-at-che.patch (text/plain), 14.90 KB, created by
Martin Renvoize (ashimema)
on 2021-11-18 15:54:50 UTC
(
hide
)
Description:
Bug 29519: Allow resolution of claims return at checkin
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-11-18 15:54:50 UTC
Size:
14.90 KB
patch
obsolete
>From 4b7133992c54bd79fe157b0af53d49d2262c968e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 17 Nov 2021 16:07:40 +0000 >Subject: [PATCH] Bug 29519: Allow resolution of claims return at checkin > >Add a 'Resolve' button in the alert dialogue that is displayed when a >lost item with a return claim is checked in. The button will trigger the >usual resolution modal allowing the user to pick their resolution. > >This patch splits the resolution modal out of checkouts.js and >checkouts-table.inc so it can be used outside of the checkouts table. >We then reload it, optionally based upon the presence of the claims >preference, where needed. This has the added benefit that it saves a >little bit of page load data in cases where the feature is not enabled. > >Test plan >1. As we alter the file locations of the resolution handling code we > need to test that normal claims functionality continue to work as > expected. >2. Test the new functoinality by checking in an item that has been > claimed as returned (but not yet resolved). The dialogue box should > now contain a 'resolve' button next to each claimant and clicking > upon it should trigger the resolution modal where the librarian can > subsequently pick the resolution and submit it. >--- > .../prog/en/includes/checkouts-table.inc | 42 ------------------- > .../includes/modals/resolve_return_claim.inc | 42 +++++++++++++++++++ > .../prog/en/modules/circ/circulation.tt | 7 ++++ > .../prog/en/modules/circ/returns.tt | 13 +++++- > .../prog/en/modules/members/moremember.tt | 7 ++++ > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 42 ------------------- > .../prog/js/resolve_claim_modal.js | 40 ++++++++++++++++++ > 7 files changed, 108 insertions(+), 85 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/modals/resolve_return_claim.inc > create mode 100644 koha-tmpl/intranet-tmpl/prog/js/resolve_claim_modal.js > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >index 002a1b4440..a5bdaf7dfa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >@@ -127,45 +127,3 @@ > </div> > </div> > </div> >- >-<!-- Resolve Return Claim Modal --> >-<div class="modal fade" id="claims-returned-resolved-modal" tabindex="-1" role="dialog" aria-labelledby="claims-returned-resolved-modal-label"> >- <div class="modal-dialog" role="document"> >- <div class="modal-content"> >- <div class="modal-header"> >- <h4 class="modal-title" id="claims-returned-resolved-modal-label">Resolve return claim</h4> >- </div> >- <div class="modal-body"> >- >- <div class="form-group"> >- <label for="claims-returned-resolved-code">Resolution</label> >- [% SET resolutions = AuthorisedValues.GetAuthValueDropbox('RETURN_CLAIM_RESOLUTION') %] >- <select class="form-control" id="claims-returned-resolved-modal-resolved-code"> >- [% FOREACH r IN resolutions %] >- <option value="[% r.authorised_value | html %]">[% r.lib | html %]</option> >- [% END %] >- </select> >- >- <label for="new_lost_status">New item lost value:</label> >- [% SET itemlost = AuthorisedValues.GetAuthValueDropbox('LOST') %] >- <select class="form-control" id="new_lost_status"> >- <option value="0">(Not lost)</option> >- [% FOREACH lost IN itemlost %] >- <option value="[% lost.authorised_value | html %]">[% lost.lib | html %]</option> >- [% END %] >- </select> >- </div> >- >- <input type="hidden" id="claims-returned-resolved-modal-id"/> >- </div> >- <div class="modal-footer"> >- <button id="claims-returned-resolved-modal-btn-submit" type="button" class="btn btn-primary"> >- <i id="claims-returned-resolved-modal-btn-submit-icon" class="fa fa-exclamation-circle"></i> >- <i id="claims-returned-resolved-modal-btn-submit-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i> >- Resolve claim >- </button> >- <button class="btn btn-default deny cancel" href="#" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> Cancel</button> >- </div> >- </div> >- </div> >-</div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/resolve_return_claim.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/resolve_return_claim.inc >new file mode 100644 >index 0000000000..01475ff5dc >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/resolve_return_claim.inc >@@ -0,0 +1,42 @@ >+<!-- Resolve Return Claim Modal --> >+<div class="modal fade" id="claims-returned-resolved-modal" tabindex="-1" role="dialog" aria-labelledby="claims-returned-resolved-modal-label"> >+ <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="claims-returned-resolved-modal-label">Resolve return claim</h4> >+ </div> >+ <div class="modal-body"> >+ >+ <div class="form-group"> >+ <label for="claims-returned-resolved-code">Resolution</label> >+ [% SET resolutions = AuthorisedValues.GetAuthValueDropbox('RETURN_CLAIM_RESOLUTION') %] >+ <select class="form-control" id="claims-returned-resolved-modal-resolved-code"> >+ [% FOREACH r IN resolutions %] >+ <option value="[% r.authorised_value | html %]">[% r.lib | html %]</option> >+ [% END %] >+ </select> >+ >+ <label for="new_lost_status">New item lost value:</label> >+ [% SET itemlost = AuthorisedValues.GetAuthValueDropbox('LOST') %] >+ <select class="form-control" id="new_lost_status"> >+ <option value="0">(Not lost)</option> >+ [% FOREACH lost IN itemlost %] >+ <option value="[% lost.authorised_value | html %]">[% lost.lib | html %]</option> >+ [% END %] >+ </select> >+ </div> >+ >+ <input type="hidden" id="claims-returned-resolved-modal-id"/> >+ </div> >+ <div class="modal-footer"> >+ <button id="claims-returned-resolved-modal-btn-submit" type="button" class="btn btn-primary"> >+ <i id="claims-returned-resolved-modal-btn-submit-icon" class="fa fa-exclamation-circle"></i> >+ <i id="claims-returned-resolved-modal-btn-submit-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i> >+ Resolve claim >+ </button> >+ <button class="btn btn-default deny cancel" href="#" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> Cancel</button> >+ </div> >+ </div> >+ </div> >+</div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index bc8a32e631..d727dd95d1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -932,6 +932,10 @@ > </div> <!-- /.row --> > </main> > >+ [% IF Koha.Preference('ClaimReturnedLostValue') %] >+ [% INCLUDE 'modals/resolve_return_claim.inc' %] >+ [% END %] >+ > <!-- Modal --> > <div id="barcodeSubmittedModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true"> > <div class="modal-dialog"> >@@ -978,6 +982,9 @@ > </script> > [% Asset.js("js/pages/circulation.js") | $raw %] > [% Asset.js("js/checkouts.js") | $raw %] >+ [% IF Koha.Preference('ClaimReturnedLostValue') %] >+ [% Asset.js("js/resolve_claim_modal.js") | $raw %] >+ [% END %] > [% Asset.js("js/holds.js") | $raw %] > <script> > columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %] >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 b3d8c04e59..731ec996e5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -192,7 +192,7 @@ > <ul> > [% FOREACH rc IN ReturnClaims %] > <li> >- [% INCLUDE 'patron-title.inc' patron=rc.patron hide_patron_infos_if_needed=1 invert_name=1 %] >+ [% INCLUDE 'patron-title.inc' patron=rc.patron hide_patron_infos_if_needed=1 invert_name=1 %] <a class="btn btn-default btn-xs return-claim-tools-resolve" role="button" data-return-claim-id="[% rc.id | html %]" data-current-lost-status="0"><i class="fa fa-check-square"></i> Resolve</a> > </li> > [% END %] > </ul> >@@ -983,12 +983,23 @@ > </div> <!-- /.col-sm-12 --> > </div> <!-- /.row --> > >+ [% IF ( ReturnClaims ) %] >+ [% INCLUDE 'modals/resolve_return_claim.inc' %] >+ [% END %] >+ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'columns_settings.inc' %] > [% INCLUDE 'calendar.inc' %] > [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %] > [% Asset.js("js/pages/circulation.js") | $raw %] >+ [% IF ( ReturnClaims ) %] >+ <script> >+ /* Set a variable needed by resolve_claim_modal.js */ >+ var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]"; >+ </script> >+ [% Asset.js("js/resolve_claim_modal.js") | $raw %] >+ [% END %] > [% INCLUDE 'timepicker.inc' %] > > <script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 91bc3db21f..60a8f55176 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -853,6 +853,10 @@ > </div> <!-- /.col-sm-2.col-sm-pull-10 --> > </div> <!-- /.row --> > >+ [% IF Koha.Preference('ClaimReturnedLostValue') %] >+ [% INCLUDE 'modals/resolve_return_claim.inc' %] >+ [% END %] >+ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] > [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] >@@ -885,6 +889,9 @@ > </script> > [% Asset.js("js/pages/circulation.js") | $raw %] > [% Asset.js("js/checkouts.js") | $raw %] >+ [% IF Koha.Preference('ClaimReturnedLostValue') %] >+ [% Asset.js("js/resolve_claim_modal.js") | $raw %] >+ [% END %] > [% Asset.js("js/holds.js") | $raw %] > [% INCLUDE 'str/members-menu.inc' %] > [% Asset.js("js/members-menu.js") | $raw %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index e31585814a..6246684a06 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -1185,48 +1185,6 @@ $(document).ready(function() { > } > }); > >- // Handle return claim resolution >- $('body').on('click', '.return-claim-tools-resolve', function() { >- let id = $(this).data('return-claim-id'); >- let current_lost_status = $(this).data('current-lost-status'); >- >- $('#claims-returned-resolved-modal-id').val(id); >- $("#new_lost_status").val(current_lost_status); >- let selected_option = $("#new_lost_status option:selected"); >- $(selected_option).text(_("%s (current status)").format($(selected_option).text())); >- $('#claims-returned-resolved-modal').modal() >- }); >- >- $(document).on('click', '#claims-returned-resolved-modal-btn-submit', function(e) { >- let resolution = $('#claims-returned-resolved-modal-resolved-code').val(); >- let new_lost_status = $('#new_lost_status').val(); >- let id = $('#claims-returned-resolved-modal-id').val(); >- >- $('#claims-returned-resolved-modal-btn-submit-spinner').show(); >- $('#claims-returned-resolved-modal-btn-submit-icon').hide(); >- >- params = { >- resolution: resolution, >- resolved_by: logged_in_user_borrowernumber, >- new_lost_status: new_lost_status >- }; >- >- $.ajax({ >- url: '/api/v1/return_claims/' + id + '/resolve', >- type: 'PUT', >- data: JSON.stringify(params), >- success: function( data ) { >- $('#claims-returned-resolved-modal-btn-submit-spinner').hide(); >- $('#claims-returned-resolved-modal-btn-submit-icon').show(); >- $('#claims-returned-resolved-modal').modal('hide') >- >- refreshReturnClaimsTable(); >- }, >- contentType: "json" >- }); >- >- }); >- > $("#show_all_claims").on("click", function(e){ > e.preventDefault(); > $(".ctrl_link").removeClass("disabled"); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/resolve_claim_modal.js b/koha-tmpl/intranet-tmpl/prog/js/resolve_claim_modal.js >new file mode 100644 >index 0000000000..c59ee023e5 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/resolve_claim_modal.js >@@ -0,0 +1,40 @@ >+$('body').on('click', '.return-claim-tools-resolve', function() { >+ let id = $(this).data('return-claim-id'); >+ let current_lost_status = $(this).data('current-lost-status'); >+ >+ $('#claims-returned-resolved-modal-id').val(id); >+ $("#new_lost_status").val(current_lost_status); >+ let selected_option = $("#new_lost_status option:selected"); >+ $(selected_option).text(_("%s (current status)").format($(selected_option).text())); >+ $('#claims-returned-resolved-modal').modal() >+}); >+ >+$(document).on('click', '#claims-returned-resolved-modal-btn-submit', function(e) { >+ let resolution = $('#claims-returned-resolved-modal-resolved-code').val(); >+ let new_lost_status = $('#new_lost_status').val(); >+ let id = $('#claims-returned-resolved-modal-id').val(); >+ >+ $('#claims-returned-resolved-modal-btn-submit-spinner').show(); >+ $('#claims-returned-resolved-modal-btn-submit-icon').hide(); >+ >+ params = { >+ resolution: resolution, >+ resolved_by: logged_in_user_borrowernumber, >+ new_lost_status: new_lost_status >+ }; >+ >+ $.ajax({ >+ url: '/api/v1/return_claims/' + id + '/resolve', >+ type: 'PUT', >+ data: JSON.stringify(params), >+ success: function(data) { >+ $('#claims-returned-resolved-modal-btn-submit-spinner').hide(); >+ $('#claims-returned-resolved-modal-btn-submit-icon').show(); >+ $('#claims-returned-resolved-modal').modal('hide') >+ >+ refreshReturnClaimsTable(); >+ }, >+ contentType: "json" >+ }); >+ >+}); >-- >2.20.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 29519
:
127802
|
127805
|
127806
|
127807
|
127808
|
127814
|
127815
|
127945
|
129700
|
130338