Bugzilla – Attachment 164922 Details for
Bug 32435
Add resolution types to catalog concerns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32435: Add resolution states to Catalog concerns
Bug-32435-Add-resolution-states-to-Catalog-concern.patch (text/plain), 7.32 KB, created by
Martin Renvoize (ashimema)
on 2024-04-16 12:32:54 UTC
(
hide
)
Description:
Bug 32435: Add resolution states to Catalog concerns
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-16 12:32:54 UTC
Size:
7.32 KB
patch
obsolete
>From 5e76026f28d26280dcd7017d57cc9f1d76ddb35e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 21 Dec 2023 15:58:41 +0000 >Subject: [PATCH] Bug 32435: Add resolution states to Catalog concerns > >This patch adds resolution types to the catalog concerns feature. It >allows libraries to define a list of 'TICKET_RESOLUTION' authorized >values from which librarians can then pick at the point of resolving a >catalog concern. > >To test: >1) Apply the patches and run the database updates >2) Enable catalog concerns (staff or opac will do the trick) >3) Submit a catalog concern >4) Confirm that you can still resolve a concern from the catalog > concerns management page as before. >5) Add some values to the new TICKET_RESOLUTION authorized values >6) Submit a new catalog concern >7) Confirm that the 'Resolve' button in the management modal is now a > dropdown containing the list of resolution values defined above. > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk> >--- > Koha/Ticket.pm | 10 ++++++++++ > Koha/Ticket/Update.pm | 10 ++++++++++ > .../prog/en/includes/modals/display_ticket.inc | 18 +++++++++++++++++- > .../prog/en/modules/cataloguing/concerns.tt | 6 +++++- > .../prog/js/modals/display_ticket.js | 10 ++++++---- > 5 files changed, 48 insertions(+), 6 deletions(-) > >diff --git a/Koha/Ticket.pm b/Koha/Ticket.pm >index ea17e899de4..59792e24bfc 100644 >--- a/Koha/Ticket.pm >+++ b/Koha/Ticket.pm >@@ -196,6 +196,16 @@ sub strings_map { > } > ); > >+ # Fall back to TICKET_RESOLUTION as needed >+ if ( !$av->count ) { >+ $av = Koha::AuthorisedValues->search( >+ { >+ category => 'TICKET_RESOLUTION', >+ authorised_value => $self->status, >+ } >+ ); >+ } >+ > my $status_str = > $av->count > ? $params->{public} >diff --git a/Koha/Ticket/Update.pm b/Koha/Ticket/Update.pm >index 1ad6b6577a1..dad68226f0a 100644 >--- a/Koha/Ticket/Update.pm >+++ b/Koha/Ticket/Update.pm >@@ -85,6 +85,16 @@ sub strings_map { > } > ); > >+ # Fall back to TICKET_RESOLUTION as needed >+ if ( !$av->count ) { >+ $av = Koha::AuthorisedValues->search( >+ { >+ category => 'TICKET_RESOLUTION', >+ authorised_value => $self->status, >+ } >+ ); >+ } >+ > my $status_str = > $av->count > ? $params->{public} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/display_ticket.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/display_ticket.inc >index 29c258d21b7..5a3479a0de5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/display_ticket.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/display_ticket.inc >@@ -1,5 +1,6 @@ > [% USE AuthorisedValues %] > [% SET status = AuthorisedValues.GetAuthValueDropbox('TICKET_STATUS') %] >+[% SET resolutions = AuthorisedValues.GetAuthValueDropbox('TICKET_RESOLUTION') %] > <!-- Display updates concern modal --> > <div class="modal" id="ticketDetailsModal" tabindex="-1" role="dialog" aria-labelledby="ticketDetailsLabel"> > <div class="modal-dialog modal-lg" role="document"> >@@ -25,7 +26,22 @@ > </div> <!-- /.modal-body --> > <div class="modal-footer"> > <input type="hidden" name="ticket_id" id="ticket_id"> >- <button type="button" class="btn btn-default" id="resolveTicket">Resolve <i id="resolve-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i></button> >+ [% IF resolutions.count %] >+ <div class="btn-group"> >+ <button type="button" class="btn btn-danger dropdown-toggle" id="resolveTicket" data-toggle="dropdown" aria-expanded="false"> >+ Resolve <span class="caret"></span> <i id="resolve-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i> >+ </button> >+ <ul class="dropdown-menu"> >+ [% FOR resolution IN resolutions %] >+ <li> >+ <a class="dropdown-item resolveSubmit" type="button" data-resolution="[% resolution.authorised_value | html %]">[% resolution.lib | html_entity %]</a> >+ </li> >+ [% END %] >+ </ul> >+ </div> >+ [% ELSE %] >+ <button type="button" class="btn btn-danger resolveSubmit" id="resolveTicket">Resolve <i id="resolve-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i></button> >+ [% END %] > [% IF status.count %] > <div class="btn-group"> > <button type="button" class="btn btn-primary" id="updateTicket">Update <i id="comment-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i></button> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt >index 562088d6216..5255593a4ee 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt >@@ -165,10 +165,14 @@ > "render": function(data, type, row, meta) { > let result = ''; > if (row.resolved_date) { >- result += _("Resolved by:") + ' <span>' + $patron_to_html(row.resolver, { >+ result += _("Resolved by") + ' <span>' + $patron_to_html(row.resolver, { > display_cardnumber: false, > url: true > }) + '</span>'; >+ if (row.status) { >+ result += ' ' + _("as") + ' '; >+ result += row._strings.status ? escape_str(row._strings.status.str) : ""; >+ } > result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>'; > } else { > if (row.status) { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js b/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js >index 282c2d4fcea..61fecbea3ab 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js >@@ -98,13 +98,15 @@ $(document).ready(function() { > }); > }); > >- $('#ticketDetailsModal').on('click', '#resolveTicket', function(e) { >+ $('#ticketDetailsModal').on('click', '.resolveSubmit', function(e) { >+ let clicked = $(this); > let ticket_id = $('#ticket_id').val(); > let params = { > 'public': $('#public').is(":checked"), >- message: $('#update_message').val(), >- user_id: logged_in_user_borrowernumber, >- state: 'resolved', >+ 'message': $('#update_message').val(), >+ 'user_id': logged_in_user_borrowernumber, >+ 'state': 'resolved', >+ 'status': clicked.data('resolution') > }; > > $('#resolve-spinner').show(); >-- >2.44.0
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 32435
:
160211
|
160212
|
160213
|
160214
|
160260
|
160261
|
160291
|
160292
|
160306
|
160321
|
160322
|
162493
|
164919
|
164920
|
164921
|
164922
|
165558
|
165559
|
165565
|
165566
|
165567
|
165611
|
165612
|
165613
|
165656
|
165657
|
165658
|
165781
|
165782
|
165783