Bugzilla – Attachment 160318 Details for
Bug 35628
Add optional statuses to catalog concerns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35628: Add resolution states to Catalog concerns
Bug-35628-Add-resolution-states-to-Catalog-concern.patch (text/plain), 7.38 KB, created by
Martin Renvoize (ashimema)
on 2023-12-27 11:34:46 UTC
(
hide
)
Description:
Bug 35628: Add resolution states to Catalog concerns
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-12-27 11:34:46 UTC
Size:
7.38 KB
patch
obsolete
>From ed2315995b0a494fe83c4b8e516f4e2d6a9641e1 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 35628: Add resolution states to Catalog concerns > >This patch adds ticket status to the catalog concerns feature. It >allows libraries to define a list of 'TICKET_STATUS' authorized >values from which librarians can then pick at the point of updateing >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 update a concern from the catalog > concerns management page as before. >5) Add some values to the new TICKET_STATUS authorized values >6) Submit a new catalog concern >7) Confirm that the 'Update' button in the management modal is now a > split button with a dropdown containing the list of status values > defined above. > >Signed-off-by: Esther Melander <esther@bywatersolutions.com> >--- > Koha/REST/V1/Tickets.pm | 6 ++++++ > .../en/includes/modals/display_ticket.inc | 21 ++++++++++++++++++- > .../prog/en/modules/cataloguing/concerns.tt | 8 +++++-- > .../prog/js/modals/display_ticket.js | 13 ++++++++---- > 4 files changed, 41 insertions(+), 7 deletions(-) > >diff --git a/Koha/REST/V1/Tickets.pm b/Koha/REST/V1/Tickets.pm >index a63ff3539de..6d13183343d 100644 >--- a/Koha/REST/V1/Tickets.pm >+++ b/Koha/REST/V1/Tickets.pm >@@ -220,6 +220,12 @@ sub add_update { > )->store; > } > >+ # Update ticket status if needed >+ if ( $ticket_update->{status} ) { >+ my $ticket = $update->ticket; >+ $ticket->set( { status => $ticket_update->{status} } )->store; >+ } >+ > # Optionally add to message_queue here to notify reporter > if ( $update->public ) { > my $notice = >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 3bf471ae4fa..29c258d21b7 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,3 +1,5 @@ >+[% USE AuthorisedValues %] >+[% SET status = AuthorisedValues.GetAuthValueDropbox('TICKET_STATUS') %] > <!-- Display updates concern modal --> > <div class="modal" id="ticketDetailsModal" tabindex="-1" role="dialog" aria-labelledby="ticketDetailsLabel"> > <div class="modal-dialog modal-lg" role="document"> >@@ -24,7 +26,24 @@ > <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> >- <button type="submit" class="btn btn-primary" id="updateTicket">Comment <i id="comment-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i></button> >+ [% 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> >+ <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> >+ <span class="caret"></span> >+ <span class="sr-only">Select status</span> >+ </button> >+ <ul class="dropdown-menu"> >+ [% FOR st IN status %] >+ <li> >+ <a class="dropdown-item updateSubmit" type="button" data-status="[% st.authorised_value | html %]">[% st.lib | html_entity %]</a> >+ </li> >+ [% END %] >+ </ul> >+ </div> >+ [% ELSE %] >+ <button type="submit" class="btn btn-primary updateSubmit" id="updateTicket">Update <i id="comment-spinner" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i></button> >+ [% END %] > </div> <!-- /.modal-footer --> > </div> <!-- /.modal-content --> > </div> <!-- /.modal-dialog --> >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 2a9336cc29b..a1a27cb3be2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt >@@ -155,7 +155,7 @@ > "orderable": true > }, > { >- "data": "resolver.firstname:resolver.surname:resolved_date", >+ "data": "resolver.firstname:resolver.surname:resolved_date:status", > "render": function(data, type, row, meta) { > let result = ''; > if (row.resolved_date) { >@@ -165,7 +165,11 @@ > }) + '</span>'; > result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>'; > } else { >- result += _("Open"); >+ if (row.status) { >+ result += row.status; >+ } else { >+ result += _("Open"); >+ } > } > return result; > }, >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 653f3f97263..236ef41ea4d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js >@@ -51,6 +51,9 @@ $(document).ready(function() { > display_cardnumber: false, > url: true > }) + ' (' + $datetime(item.date) + ')</span>'; >+ if ( item.status ) { >+ updates += '<span class="pull-right">' + item.status + '</span>' >+ } > updates += '</div>'; > }); > updates_display.html(updates); >@@ -63,12 +66,14 @@ $(document).ready(function() { > $('#public').prop( "checked", false ); > }); > >- $('#ticketDetailsModal').on('click', '#updateTicket', function(e) { >+ $('#ticketDetailsModal').on('click', '.updateSubmit', 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 >+ 'message': $('#update_message').val(), >+ 'user_id': logged_in_user_borrowernumber, >+ 'status': clicked.data('status') > }; > > $('#comment-spinner').show(); >@@ -96,7 +101,7 @@ $(document).ready(function() { > 'public': $('#public').is(":checked"), > message: $('#update_message').val(), > user_id: logged_in_user_borrowernumber, >- state: 'resolved' >+ state: 'resolved', > }; > > $('#resolve-spinner').show(); >-- >2.43.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 35628
:
160255
|
160256
|
160257
|
160258
|
160259
|
160268
|
160269
|
160270
|
160271
|
160272
|
160273
|
160274
|
160286
|
160287
|
160288
|
160289
|
160290
|
160308
|
160309
|
160310
|
160311
|
160312
|
160313
|
160314
|
160315
|
160316
|
160317
|
160318
|
160319
|
160320
|
160329
|
160330
|
160331
|
160332
|
160333
|
160334
|
160335
|
160364
|
162500
|
164912
|
164913
|
164914
|
164915
|
164916
|
164917
|
164918
|
165551
|
165552
|
165553
|
165554
|
165555
|
165556
|
165557
|
165560
|
165561
|
165562
|
165563
|
165564
|
165599
|
165600
|
165601
|
165602
|
165603
|
165604
|
165605
|
165606
|
165607
|
165608
|
165622
|
165623
|
165624
|
165625
|
165626
|
165627
|
165628
|
165629
|
165630
|
165631
|
165770
|
165771
|
165772
|
165773
|
165774
|
165775
|
165776
|
165777
|
165778
|
165779