Bug 36757: (QA follow-up) Fix for action on different triggers
This patch updates the 'title' and 'comment count' links to action the same ticket detail/update modal as the 'details' button. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Paul Derscheid <paulderscheid@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
fffe081bec
commit
b1944c7895
|
|
@ -1086,9 +1086,9 @@
|
|||
"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>';
|
||||
let result = '<a role="button" href="#" class="detail-trigger">' + 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 class="detail-trigger"><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;
|
||||
|
|
@ -1141,7 +1141,7 @@
|
|||
{
|
||||
"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 + '" data-assignee="'+$patron_to_html(row.assignee, { display_cardnumber: false, url: false })+'"><i class="fa-solid fa-eye" aria-hidden="true"></i> ' + _("Details") + '</a>';
|
||||
let result = '<a class="btn btn-default btn-xs main-trigger" role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '" data-resolved="' + resolved + '" data-assignee="'+$patron_to_html(row.assignee, { display_cardnumber: false, url: false })+'"><i class="fa-solid fa-eye" aria-hidden="true"></i> ' + _("Details") + '</a>';
|
||||
return result;
|
||||
},
|
||||
"searchable": false,
|
||||
|
|
|
|||
|
|
@ -142,9 +142,9 @@
|
|||
"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>';
|
||||
let result = '<a role="button" href="#" class="detail-trigger">' + 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) + '" data-resolved="'+resolved+'"><i class="fa fa-comment" aria-hidden="true"></i> ' + row.updates_count + '</a></span>';
|
||||
result += '<span class="pull-right"><a role="button" href="#" class="detail-trigger"><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;
|
||||
|
|
@ -197,7 +197,7 @@
|
|||
{
|
||||
"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+'" data-assignee="'+$patron_to_html(row.assignee, { display_cardnumber: false, url: false })+'"><i class="fa-solid fa-eye" aria-hidden="true"></i> ' + _("Details") + '</a>';
|
||||
let result = '<a class="btn btn-default btn-xs main-trigger" role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '" data-resolved="'+resolved+'" data-assignee="'+$patron_to_html(row.assignee, { display_cardnumber: false, url: false })+'"><i class="fa-solid fa-eye" aria-hidden="true"></i> ' + _("Details") + '</a>';
|
||||
return result;
|
||||
},
|
||||
"searchable": false,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
/* keep tidy */
|
||||
$(document).ready(function () {
|
||||
$("#table_concerns").on("click", ".detail-trigger", function () {
|
||||
// Find the main trigger anchor within the same table row
|
||||
var $mainTrigger = $(this).closest("tr").find(".main-trigger");
|
||||
|
||||
// Trigger the click event of the main trigger anchor
|
||||
$mainTrigger.trigger("click");
|
||||
});
|
||||
|
||||
$("#ticketDetailsModal").on("show.bs.modal", function (event) {
|
||||
let modal = $(this);
|
||||
let button = $(event.relatedTarget);
|
||||
|
|
|
|||
Loading…
Reference in New Issue