Bugzilla – Attachment 143658 Details for
Bug 31028
Add 'Report a concern' feature for patrons to report concerns about catalog records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31028: Add display to details page
Bug-31028-Add-display-to-details-page.patch (text/plain), 29.30 KB, created by
Martin Renvoize (ashimema)
on 2022-11-10 13:48:20 UTC
(
hide
)
Description:
Bug 31028: Add display to details page
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-11-10 13:48:20 UTC
Size:
29.30 KB
patch
obsolete
>From f4722256f8662f60ff8d930edb6a9ab288aa937f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 25 Oct 2022 16:02:09 +0100 >Subject: [PATCH] Bug 31028: Add display to details page > >This patch adds the display of biblio specific concerns to the biblio >detail display page. > >Test plan >1) Enable the feature as in prior patch test plans >2) Add a concern as per prior patch test plans >3) Confirm that a new tab appears at the bottom of the catalog record > details display and all functionality from the concern management > page is precent. >--- > .../en/includes/modals/display_ticket.inc | 31 ++++ > .../prog/en/modules/catalogue/detail.tt | 125 ++++++++++++++++ > .../prog/en/modules/cataloguing/concerns.tt | 137 +----------------- > .../prog/en/modules/intranet-main.tt | 2 +- > .../prog/js/modals/display_ticket.js | 120 +++++++++++++++ > 5 files changed, 285 insertions(+), 130 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/modals/display_ticket.inc > create mode 100644 koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js > >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 >new file mode 100644 >index 0000000000..3bf471ae4f >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/display_ticket.inc >@@ -0,0 +1,31 @@ >+<!-- Display updates concern modal --> >+<div class="modal" id="ticketDetailsModal" tabindex="-1" role="dialog" aria-labelledby="ticketDetailsLabel"> >+ <div class="modal-dialog modal-lg" 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="displayUpdateLabel">Ticket details</h4> >+ </div> >+ <div class="modal-body"> >+ <div id="concern-details"></div> >+ <fieldset> >+ <ol> >+ <li class="form-group"> >+ <label for="message">Update: </label> >+ <textarea id="update_message" class="form-control" name="message"></textarea> >+ </li> >+ <li class="rows"> >+ <label for="public">Notify: </label> >+ <input type="checkbox" name="public" id="public"> >+ </li> >+ </ol> >+ </fieldset> >+ </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> >+ <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> >+ </div> <!-- /.modal-footer --> >+ </div> <!-- /.modal-content --> >+ </div> <!-- /.modal-dialog --> >+</div> <!-- /#displayUpdateModal --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index c5e7330c11..7c95fcb97d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -299,6 +299,7 @@ > [% IF Koha.Preference('AcquisitionDetails') %]<li role="presentation"><a href="#acq_details" aria-controls="acq_details" role="tab" data-toggle="tab">Acquisition details</a></li>[% END %] > [% IF suggestions.count %]<li role="presentation"><a href="#suggestion_details" aria-controls="suggestion_details" role="tab" data-toggle="tab">Suggestion details</a></li>[% END %] > [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li role="presentation"><a href="#editions" aria-controls="editions" role="tab" data-toggle="tab">Editions</a></li>[% END %][% END %] >+[% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]<li role="presentation"><a href="#concerns" aria-controls="concerns" role="tab" data-toggle="tab">Concerns ([% biblio.tickets.count | html %])</a></li>[% END %] > [% IF ( LocalCoverImages ) %] > <li role="presentation"> > <a href="#images" aria-controls="images" role="tab" data-toggle="tab">Images ([% localimages.count || 0 | html %])</a> >@@ -1005,6 +1006,26 @@ Note that permanent location is a code, and location may be an authval. > </table></div>[% END %] > [% END %] > >+[% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %] >+<div role="tabpanel" class="tab-pane" id="concerns"> >+ <fieldset class="action" style="cursor:pointer;"> >+ <a id="hideResolved"><i class="fa fa-minus-square"></i> Hide resolved</a> >+ | <a id="showAll"><i class="fa fa-bars"></i> Show all</a> >+ </fieldset> >+ >+ <table id="table_concerns" width="100%"> >+ <thead> >+ <tr> >+ <th>Reported</th> >+ <th>Details</th> >+ <th>Status</th> >+ <th data-class-name="actions noExport">Actions</th> >+ </tr> >+ </thead> >+ </table> >+</div> >+[% END %] >+ > [% IF ( LocalCoverImages ) %] > <div role="tabpanel" class="tab-pane" id="images"> > [% IF localimages.count %] >@@ -1308,6 +1329,10 @@ Note that permanent location is a code, and location may be an authval. > [% INCLUDE 'modals/add_catalog_concern.inc' %] > [% END %] > >+ [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %] >+ [% INCLUDE 'modals/display_ticket.inc' %] >+ [% END %] >+ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'catalog-strings.inc' %] > [% Asset.js("js/catalog.js") | $raw %] >@@ -1320,6 +1345,106 @@ Note that permanent location is a code, and location may be an authval. > var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]"; > </script> > [% Asset.js("js/modals/add_catalog_concern.js") | $raw %] >+ [% END %] >+ [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %] >+ <script> >+ $(document).ready(function() { >+ var table_settings = [% TablesSettings.GetTableSettings( 'cataloguing', 'concerns', 'table_concerns', 'json' ) | $raw %]; >+ >+ var tickets_url = '/api/v1/tickets'; >+ var tickets = $("#table_concerns").kohaTable({ >+ "ajax": { >+ "url": tickets_url >+ }, >+ "embed": [ >+ "reporter", >+ "resolver", >+ "updates+count", >+ ], >+ 'emptyTable': '<div class="dialog message">' + _("Congradulations, there are no catalog concerns.") + '</div>', >+ "columnDefs": [ { >+ "targets": [0,1,2], >+ "render": function (data, type, row, meta) { >+ if ( type == 'display' ) { >+ if ( data != null ) { >+ return data.escapeHtml(); >+ } >+ else { >+ return ""; >+ } >+ } >+ return data; >+ } >+ } ], >+ "columns": [ >+ { >+ "data": "reported_date:reporter.firstname", >+ "render": function(data, type, row, meta) { >+ let reported = '<span class="date clearfix">' + $datetime(row.reported_date) + '</span>'; >+ reported += '<span class="reporter clearfix">' + $patron_to_html(row.reporter, { >+ display_cardnumber: false, >+ url: true >+ }) + '</span>'; >+ return reported; >+ }, >+ "searchable": true, >+ "orderable": true >+ }, >+ { >+ "data": "title:body", >+ "render": function(data, type, row, meta) { >+ let resolved = ( row.resolved_date ) ? true : false; >+ let result = '<a role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '" data-resolved="' + resolved + '">' + row.title + '</a>'; >+ if (row.updates_count) { >+ result += '<span class="pull-right"><a role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '"><i class="fa fa-comment" aria-hidden="true"></i> ' + row.updates_count + '</a></span>'; >+ } >+ result += '<div id="detail_' + row.ticket_id + '" class="hidden">' + row.body + '</div>'; >+ return result; >+ }, >+ "searchable": true, >+ "orderable": true >+ }, >+ { >+ "data": "resolved_date", >+ "render": function(data, type, row, meta) { >+ let result = ''; >+ if (row.resolved_date) { >+ result += _("Resolved by:") + ' <span>' + $patron_to_html(row.resolver, { >+ display_cardnumber: false, >+ url: true >+ }) + '</span>'; >+ result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>'; >+ } else { >+ result += _("Open"); >+ } >+ return result; >+ }, >+ "searchable": true, >+ "orderable": true >+ }, >+ { >+ "data": function(row, type, val, meta) { >+ let resolved = ( row.resolved_date ) ? true : false; >+ let result = '<a class="btn btn-default btn-xs" role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '" data-resolved="' + resolved + '"><i class="fa fa-eye" aria-hidden="true"></i> ' + _("Details") + '</a>'; >+ return result; >+ }, >+ "searchable": false, >+ "orderable": false >+ }, >+ ] >+ }, table_settings, 0, { biblio_id: [% biblionumber | uri %]}); >+ >+ $('#hideResolved').on( "click", function() { >+ // It would be great if we could pass null here but it gets stringified >+ concerns.DataTable().columns('3').search('special:undefined').draw(); >+ }); >+ >+ $('#showAll').on( "click", function() { >+ concerns.DataTable().columns('3').search('').draw(); >+ }); >+ }); >+ </script> >+ [% Asset.js("js/modals/display_ticket.js") | $raw %] > [% END %] > <script> > var interface = "[% interface | html %]"; >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 42e8f8c0a1..4105642136 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt >@@ -63,37 +63,7 @@ > </div> <!-- /.col-sm-2.col-sm-pull-10 --> > </div> <!-- /.row --> > >- <!-- Display updates concern modal --> >- <div class="modal" id="ticketDetailsModal" tabindex="-1" role="dialog" aria-labelledby="ticketDetailsLabel"> >- <div class="modal-dialog modal-lg" 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="displayUpdateLabel">Ticket details</h4> >- </div> >- <div class="modal-body"> >- <div id="concern-details"></div> >- <fieldset class="rows"> >- <ol> >- <li> >- <label for="message">Update: </label> >- <textarea id="update_message" name="message"></textarea> >- </li> >- <li> >- <label for="public">Notify: </label> >- <input type="checkbox" name="public" id="public"> >- </li> >- </ol> >- </fieldset> >- </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</button> >- <button type="submit" class="btn btn-primary" id="updateTicket">Comment</button> >- </div> <!-- /.modal-footer --> >- </div> <!-- /.modal-content --> >- </div> <!-- /.modal-dialog --> >- </div> <!-- /#displayUpdateModal --> >+ [% INCLUDE 'modals/display_ticket.inc' %] > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >@@ -104,7 +74,7 @@ > <script> > $(document).ready(function() { > >- var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]"; >+ logged_in_user_borrowernumber = [% logged_in_user.borrowernumber | html %]; > > var table_settings = [% TablesSettings.GetTableSettings('cataloguing', 'concerns', 'table_concerns', 'json') | $raw %]; > >@@ -149,9 +119,10 @@ > { > "data": "title:body", > "render": function(data, type, row, meta) { >- let result = '<a role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '">' + row.title + '</a>'; >+ let resolved = ( row.resolved_date ) ? true : false; >+ let result = '<a role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '" data-resolved="'+resolved+'">' + row.title + '</a>'; > if (row.updates_count) { >- result += '<span class="pull-right"><a role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '"><i class="fa fa-comment" aria-hidden="true"></i> ' + row.updates_count + '</a></span>'; >+ result += '<span class="pull-right"><a role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '" data-resolved="'+resolved+'"><i class="fa fa-comment" aria-hidden="true"></i> ' + row.updates_count + '</a></span>'; > } > result += '<div id="detail_' + row.ticket_id + '" class="hidden">' + row.body + '</div>'; > return result; >@@ -189,7 +160,8 @@ > }, > { > "data": function(row, type, val, meta) { >- let result = '<a class="btn btn-default btn-xs" role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '"><i class="fa fa-eye" aria-hidden="true"></i> ' + _("Details") + '</a>'; >+ let resolved = ( row.resolved_date ) ? true : false; >+ let result = '<a class="btn btn-default btn-xs" role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '" data-resolved="'+resolved+'"><i class="fa fa-eye" aria-hidden="true"></i> ' + _("Details") + '</a>'; > return result; > }, > "searchable": false, >@@ -206,101 +178,8 @@ > $('#showAll').on("click", function() { > tickets.DataTable().columns('3').search('').draw(); > }); >- >- $('#ticketDetailsModal').on('show.bs.modal', function(event) { >- let modal = $(this); >- let button = $(event.relatedTarget); >- let ticket_id = button.data('concern'); >- modal.find('.modal-footer input').val(ticket_id); >- >- let detail = $('#detail_' + ticket_id).text(); >- >- let display = '<div class="list-group">'; >- display += '<div class="list-group-item">'; >- display += '<span class="wrapfix">' + detail + '</span>'; >- display += '</div>'; >- display += '<div id="concern-updates" class="list-group-item">'; >- display += '<span>Loading updates . . .</span>'; >- display += '</div>'; >- display += '</div>'; >- >- let details = modal.find('#concern-details'); >- details.html(display); >- >- $.ajax({ >- url: "/api/v1/tickets/" + ticket_id + "/updates", >- method: "GET", >- headers: { >- "x-koha-embed": "user" >- }, >- }).success(function(data) { >- let updates_display = $('#concern-updates'); >- let updates = ''; >- data.forEach(function(item, index) { >- updates += '<div class="list-group-item">'; >- updates += '<span class="wrapfix">' + item.message + '</span>'; >- updates += '<span class="clearfix">' + $patron_to_html(item.user, { >- display_cardnumber: false, >- url: true >- }) + ' (' + $datetime(item.date) + ')</span>'; >- updates += '</div>'; >- }); >- updates_display.html(updates); >- }).error(function() { >- >- }); >- }); >- >- $('#ticketDetailsModal').on('click', '#updateTicket', function(e) { >- let ticket_id = $('#ticket_id').val(); >- let params = { >- 'public': $('#public').is(":checked"), >- message: $('#update_message').val(), >- user_id: logged_in_user_borrowernumber >- }; >- >- $.ajax({ >- url: "/api/v1/tickets/" + ticket_id + "/updates", >- method: "POST", >- data: JSON.stringify(params), >- ontentType: "application/json; charset=utf-8" >- }).success(function() { >- $("#ticketDetailsModal").modal('hide'); >- tickets.DataTable().ajax.reload(function(data) { >- $("#concern_action_result_dialog").hide(); >- $("#concern_delete_success").html(_("Concern #%s updated successfully.").format(ticket_id)).show(); >- }); >- }).error(function() { >- $("#concern_update_error").html(_("Error resolving concern #%s. Check the logs.").format(ticket_id)).show(); >- }); >- }); >- >- $('#ticketDetailsModal').on('click', '#resolveTicket', function(e) { >- let ticket_id = $('#ticket_id').val(); >- let params = { >- 'public': $('#public').is(":checked"), >- message: $('#update_message').val(), >- user_id: logged_in_user_borrowernumber, >- state: 'resolved' >- }; >- >- $.ajax({ >- url: "/api/v1/tickets/" + ticket_id + "/updates", >- method: "POST", >- data: JSON.stringify(params), >- ontentType: "application/json; charset=utf-8" >- }).success(function() { >- $("#ticketDetailsModal").modal('hide'); >- tickets.DataTable().ajax.reload(function(data) { >- $("#concern_action_result_dialog").hide(); >- $("#concern_delete_success").html(_("Concern #%s updated successfully.").format(ticket_id)).show(); >- }); >- }).error(function() { >- $("#concern_update_error").html(_("Error resolving concern #%s. Check the logs.").format(ticket_id)).show(); >- }); >- }); >- > }); > </script> >+ [% Asset.js("js/modals/display_ticket.js") | $raw %] > [% END %] > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >index 6ee857b1ca..bb71c500d6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >@@ -177,7 +177,7 @@ > <div class="row"> > <div class="col-sm-12"> > [%# Following statement must be in one line for translatability %] >- [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions )) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( ( Koha.preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && pending_biblio_tickets && CAN_user_editcatalogue_edit_catalogue ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || already_ran_jobs || new_curbside_pickups.count %] >+ [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions )) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && pending_biblio_tickets && CAN_user_editcatalogue_edit_catalogue ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || already_ran_jobs || new_curbside_pickups.count %] > <div id="area-pending" class="page-section"> > [% IF pending_article_requests %] > <div class="pending-info" id="article_requests_pending"> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js b/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js >new file mode 100644 >index 0000000000..653f3f9726 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js >@@ -0,0 +1,120 @@ >+$(document).ready(function() { >+ $('#ticketDetailsModal').on('show.bs.modal', function(event) { >+ let modal = $(this); >+ let button = $(event.relatedTarget); >+ let ticket_id = button.data('concern'); >+ let resolved = button.data('resolved'); >+ modal.find('.modal-footer input').val(ticket_id); >+ >+ if ( resolved ) { >+ $('#resolveTicket').hide(); >+ } else { >+ $('#resolveTicket').show(); >+ } >+ >+ let detail = $('#detail_' + ticket_id).text(); >+ >+ // Display ticket details >+ let display = '<div class="list-group">'; >+ display += '<div class="list-group-item">'; >+ display += '<span class="wrapfix">' + detail + '</span>'; >+ display += '</div>'; >+ display += '<div id="concern-updates" class="list-group-item">'; >+ display += '<span>' + __("Loading updates . . .") + '</span>'; >+ display += '</div>'; >+ display += '</div>'; >+ >+ let details = modal.find('#concern-details'); >+ details.html(display); >+ >+ // Load any existing updates >+ $.ajax({ >+ url: "/api/v1/tickets/" + ticket_id + "/updates", >+ method: "GET", >+ headers: { >+ "x-koha-embed": "user" >+ }, >+ }).success(function(data) { >+ let updates_display = $('#concern-updates'); >+ let updates = ''; >+ data.forEach(function(item, index) { >+ if ( item.public ) { >+ updates += '<div class="list-group-item list-group-item-success">'; >+ updates += '<span class="pull-right">' + __("Public") + '</span>'; >+ } >+ else { >+ updates += '<div class="list-group-item list-group-item-warning">'; >+ updates += '<span class="pull-right">' + __("Private") + '</span>'; >+ } >+ updates += '<span class="wrapfix">' + item.message + '</span>'; >+ updates += '<span class="clearfix">' + $patron_to_html(item.user, { >+ display_cardnumber: false, >+ url: true >+ }) + ' (' + $datetime(item.date) + ')</span>'; >+ updates += '</div>'; >+ }); >+ updates_display.html(updates); >+ }).error(function() { >+ >+ }); >+ >+ // Clear any previously entered update message >+ $('#update_message').val(''); >+ $('#public').prop( "checked", false ); >+ }); >+ >+ $('#ticketDetailsModal').on('click', '#updateTicket', function(e) { >+ let ticket_id = $('#ticket_id').val(); >+ let params = { >+ 'public': $('#public').is(":checked"), >+ message: $('#update_message').val(), >+ user_id: logged_in_user_borrowernumber >+ }; >+ >+ $('#comment-spinner').show(); >+ >+ $.ajax({ >+ url: "/api/v1/tickets/" + ticket_id + "/updates", >+ method: "POST", >+ data: JSON.stringify(params), >+ ontentType: "application/json; charset=utf-8" >+ }).success(function() { >+ $('#comment-spinner').hide(); >+ $('#ticketDetailsModal').modal('hide'); >+ $('#table_concerns').DataTable().ajax.reload(function(data) { >+ $("#concern_action_result_dialog").hide(); >+ $("#concern_delete_success").html(__("Concern #%s updated successfully.").format(ticket_id)).show(); >+ }); >+ }).error(function() { >+ $("#concern_update_error").html(__("Error resolving concern #%s. Check the logs.").format(ticket_id)).show(); >+ }); >+ }); >+ >+ $('#ticketDetailsModal').on('click', '#resolveTicket', function(e) { >+ let ticket_id = $('#ticket_id').val(); >+ let params = { >+ 'public': $('#public').is(":checked"), >+ message: $('#update_message').val(), >+ user_id: logged_in_user_borrowernumber, >+ state: 'resolved' >+ }; >+ >+ $('#resolve-spinner').show(); >+ >+ $.ajax({ >+ url: "/api/v1/tickets/" + ticket_id + "/updates", >+ method: "POST", >+ data: JSON.stringify(params), >+ ontentType: "application/json; charset=utf-8" >+ }).success(function() { >+ $('#resolve-spinner').hide(); >+ $("#ticketDetailsModal").modal('hide'); >+ $('#table_concerns').DataTable().ajax.reload(function(data) { >+ $("#concern_action_result_dialog").hide(); >+ $("#concern_delete_success").html(__("Concern #%s updated successfully.").format(ticket_id)).show(); >+ }); >+ }).error(function() { >+ $("#concern_update_error").html(__("Error resolving concern #%s. Check the logs.").format(ticket_id)).show(); >+ }); >+ }); >+}); >-- >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 31028
:
137412
|
139222
|
139223
|
139224
|
139225
|
139226
|
139227
|
139228
|
139229
|
139230
|
139231
|
139232
|
139233
|
139234
|
139235
|
139236
|
139237
|
139238
|
139572
|
139573
|
139574
|
139575
|
139576
|
139577
|
139578
|
139579
|
139580
|
139581
|
139582
|
139583
|
139584
|
139585
|
139586
|
139587
|
139588
|
139589
|
139590
|
139591
|
140289
|
140290
|
140291
|
140292
|
140293
|
140294
|
140295
|
140296
|
140297
|
140298
|
140299
|
140300
|
140301
|
140302
|
140303
|
140304
|
140305
|
140306
|
140307
|
140308
|
140436
|
140437
|
140438
|
140439
|
140440
|
140441
|
140442
|
140443
|
140444
|
140445
|
140446
|
140447
|
140448
|
140449
|
140450
|
140451
|
140452
|
140453
|
140454
|
140455
|
140764
|
140765
|
140766
|
140767
|
140768
|
140769
|
140770
|
140771
|
140772
|
140773
|
140774
|
140775
|
140776
|
140777
|
140778
|
140779
|
140780
|
140781
|
140782
|
140783
|
140793
|
140929
|
140930
|
140931
|
140932
|
140933
|
140934
|
140935
|
140936
|
140937
|
140938
|
140939
|
140940
|
140941
|
140942
|
140943
|
140944
|
140945
|
140946
|
140947
|
140948
|
140949
|
140950
|
141133
|
141134
|
141135
|
141136
|
141137
|
141138
|
141139
|
141140
|
141141
|
141142
|
141143
|
141144
|
141145
|
141146
|
141147
|
141148
|
141149
|
141150
|
141151
|
141152
|
141153
|
141154
|
141440
|
141441
|
141442
|
141443
|
141444
|
141445
|
141446
|
141447
|
141448
|
141449
|
141450
|
141451
|
141452
|
141453
|
141454
|
141455
|
141456
|
141457
|
141458
|
141459
|
141460
|
142164
|
142165
|
142166
|
142167
|
142168
|
142169
|
142170
|
142171
|
142172
|
142173
|
142174
|
142175
|
142177
|
142179
|
142180
|
142181
|
142182
|
142183
|
142184
|
142185
|
142186
|
142187
|
142188
|
142189
|
142190
|
142191
|
142616
|
142617
|
142618
|
142619
|
142620
|
142621
|
142622
|
142623
|
142624
|
142625
|
142626
|
142627
|
142932
|
142933
|
142934
|
142935
|
142936
|
142937
|
142938
|
142939
|
142940
|
142941
|
142942
|
142943
|
142944
|
142945
|
142946
|
142947
|
142948
|
142949
|
143238
|
143239
|
143240
|
143241
|
143242
|
143243
|
143244
|
143245
|
143246
|
143247
|
143248
|
143249
|
143250
|
143251
|
143252
|
143253
|
143254
|
143255
|
143256
|
143257
|
143302
|
143303
|
143304
|
143305
|
143306
|
143307
|
143308
|
143309
|
143310
|
143311
|
143312
|
143313
|
143314
|
143315
|
143316
|
143317
|
143318
|
143319
|
143320
|
143321
|
143322
|
143323
|
143324
|
143325
|
143326
|
143327
|
143328
|
143329
|
143330
|
143331
|
143332
|
143333
|
143334
|
143335
|
143336
|
143337
|
143338
|
143339
|
143340
|
143341
|
143470
|
143471
|
143472
|
143473
|
143474
|
143475
|
143476
|
143477
|
143478
|
143479
|
143480
|
143481
|
143482
|
143483
|
143484
|
143485
|
143486
|
143487
|
143488
|
143489
|
143490
|
143647
|
143648
|
143649
|
143650
|
143651
|
143652
|
143653
|
143654
|
143655
|
143656
|
143657
|
143658
|
143659
|
143660
|
143661
|
143662
|
143663
|
143664
|
143665
|
143666
|
143667
|
143708
|
143709
|
143710
|
143711
|
143712
|
143713
|
143714
|
143715
|
143716
|
143717
|
143718
|
143719
|
143720
|
143721
|
143722
|
143723
|
143724
|
143725
|
143726
|
143727
|
144647
|
144648
|
144649
|
144650
|
144651
|
144652
|
144653
|
144654
|
144655
|
144656
|
144657
|
144658
|
144659
|
144660
|
144661
|
144662
|
144663
|
144664
|
144665
|
144666
|
144667
|
144668
|
145542
|
146214
|
146215
|
146216
|
146217
|
146218
|
146219
|
146220
|
146221
|
146222
|
146223
|
146224
|
146225
|
146226
|
146227
|
146228
|
146229
|
146230
|
146231
|
146232
|
146233
|
146234
|
146235
|
146236
|
146237
|
146238
|
146239
|
146240
|
146241
|
146242
|
146243
|
146244
|
146245
|
146246
|
146247
|
146248
|
146249
|
146250
|
146251
|
146252
|
146253
|
146254
|
146255
|
146256
|
146257
|
146258
|
146259
|
146260
|
146261
|
146262
|
146697
|
146870
|
146871
|
146872
|
146873
|
146874
|
146875
|
146876
|
146877
|
146878
|
146879
|
146880
|
146881
|
146882
|
146883
|
146884
|
146885
|
146886
|
146887
|
146888
|
146889
|
146890
|
146891
|
146892
|
146893
|
146894
|
146895
|
146896
|
147797
|
147840
|
147841
|
147844
|
147859
|
147860
|
147861
|
147866
|
148673
|
149931