Koha/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt
Martin Renvoize 70dc91d274 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.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Helen Oliver <HOliver@tavi-port.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-03-06 11:23:17 -03:00

185 lines
8 KiB
Text

[% USE raw %]
[% USE Asset %]
[% SET footerjs = 1 %]
[% USE TablesSettings %]
[% INCLUDE 'doc-head-open.inc' %]
<title>
Catalog concerns &rsaquo; Tools &rsaquo; Koha
</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="cat_concerns" class="cat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cataloging-search.inc' %]
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
<ol>
<li>
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
</li>
<li>
<a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a>
</li>
<li>
<a href="#" aria-current="page">
Catalog concerns
</a>
</li>
</ol>
</nav>
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
<h1>Concerns</h1>
<div class="page-section">
<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">
<thead>
<tr>
<th>Reported</th>
<th>Details</th>
<th>Title</th>
<th>Status</th>
<th data-class-name="actions noExport">Actions</th>
</tr>
</thead>
</table>
</div>
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'cat-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% INCLUDE 'modals/display_ticket.inc' %]
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
[% INCLUDE 'js-date-format.inc' %]
[% INCLUDE 'js-patron-format.inc' %]
[% INCLUDE 'js-biblio-format.inc' %]
<script>
$(document).ready(function() {
logged_in_user_borrowernumber = [% logged_in_user.borrowernumber | html %];
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",
"biblio",
"updates+count",
],
'emptyTable': '<div class="dialog message">' + _("Congratulations, there are no catalog concerns.") + '</div>',
"columnDefs": [{
"targets": [0, 1, 2, 3],
"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) + '" 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;
},
"searchable": true,
"orderable": true
},
{
"data": "biblio.title",
"render": function(data, type, row, meta) {
return $biblio_to_html(row.biblio, {
link: 1
});
},
"searchable": true,
"orderable": true
},
{
"data": "resolver.firstname:resolver.surname: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, 1);
$('#hideResolved').on("click", function() {
// It would be great if we could pass null here but it gets stringified
tickets.DataTable().columns('3').search('special:undefined').draw();
});
$('#showAll').on("click", function() {
tickets.DataTable().columns('3').search('').draw();
});
});
</script>
[% Asset.js("js/modals/display_ticket.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]