3 [% USE AuthorisedValues %]
4 [% PROCESS 'i18n.inc' %]
5 [% SET status = AuthorisedValues.GetAuthValueDropbox('TICKET_STATUS') %]
7 [% USE TablesSettings %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>[% FILTER collapse %]
10 [% t("Catalog concerns") | html %] ›
11 [% t("Cataloging") | html %] ›
12 [% t("Koha") | html %]
14 [% INCLUDE 'doc-head-close.inc' %]
17 <body id="cat_concerns" class="cat">
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'cataloging-search.inc' %]
21 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
24 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
27 <a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a>
30 <a href="#" aria-current="page">
37 <div class="main container-fluid">
39 <div class="col-sm-10 col-sm-push-2">
41 [% INCLUDE 'messages.inc' %]
44 <div class="page-section">
45 <fieldset class="action filters" style="cursor:pointer;">
46 <a id="resolved_filter" class="filtered"><i class="fa fa-bars"></i> Include resolved</a>
47 [% FOR st IN status %]
48 | <a id="[% st.authorised_value | html %]_filter"><i class="fa fa-filter"></i> Filter [% st.lib | html %]</a>
52 <table id="table_concerns">
59 <th data-class-name="actions noExport">Actions</th>
65 </div> <!-- /.col-sm-10.col-sm-push-2 -->
67 <div class="col-sm-2 col-sm-pull-10">
69 [% INCLUDE 'cat-menu.inc' %]
71 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
74 [% INCLUDE 'modals/display_ticket.inc' %]
76 [% MACRO jsinclude BLOCK %]
77 [% INCLUDE 'datatables.inc' %]
78 [% INCLUDE 'columns_settings.inc' %]
79 [% INCLUDE 'js-date-format.inc' %]
80 [% INCLUDE 'js-patron-format.inc' %]
81 [% INCLUDE 'js-biblio-format.inc' %]
83 $(document).ready(function() {
85 logged_in_user_borrowernumber = [% logged_in_user.borrowernumber | html %];
87 var table_settings = [% TablesSettings.GetTableSettings('cataloguing', 'concerns', 'table_concerns', 'json') | $raw %];
89 var filter_resolved = true;
90 let additional_filters = {
91 resolved_date: function(){
92 if ( filter_resolved ) {
101 var tickets_url = '/api/v1/tickets';
102 var tickets = $("#table_concerns").kohaTable({
113 'emptyTable': '<div class="dialog message">' + _("Congratulations, there are no catalog concerns.") + '</div>',
115 "targets": [0, 1, 2, 3],
116 "render": function(data, type, row, meta) {
117 if (type == 'display') {
119 return data.escapeHtml();
128 "data": "reported_date:reporter.firstname",
129 "render": function(data, type, row, meta) {
130 let reported = '<span class="date clearfix">' + $datetime(row.reported_date) + '</span>';
131 reported += '<span class="reporter clearfix">' + $patron_to_html(row.reporter, {
132 display_cardnumber: false,
141 "data": "title:body",
142 "render": function(data, type, row, meta) {
143 let resolved = ( row.resolved_date ) ? true : false;
144 let result = '<a role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '" data-resolved="'+resolved+'">' + row.title + '</a>';
145 if (row.updates_count) {
146 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>';
148 result += '<div id="detail_' + row.ticket_id + '" class="hidden">' + row.body + '</div>';
155 "data": "biblio.title",
156 "render": function(data, type, row, meta) {
157 return $biblio_to_html(row.biblio, {
165 "data": "resolver.firstname:resolver.surname:resolved_date:status",
166 "render": function(data, type, row, meta) {
168 if (row.resolved_date) {
169 result += _("Resolved by") + ' <span>' + $patron_to_html(row.resolver, {
170 display_cardnumber: false,
174 result += ' ' + _("as") + ' ';
175 result += row._strings.status ? escape_str(row._strings.status.str) : "";
177 result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>';
180 result += row._strings.status ? escape_str(row._strings.status.str) : "";
191 "data": function(row, type, val, meta) {
192 let resolved = ( row.resolved_date ) ? true : false;
193 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-solid fa-eye" aria-hidden="true"></i> ' + _("Details") + '</a>';
200 createdRow: function (row, data, dataIndex) {
202 $(row).addClass(data.status.toLowerCase());
205 }, table_settings, 1, additional_filters);
207 var txtActivefilter = _("Include resolved");
208 var txtInactivefilter = _("Filter resolved");
209 $('#resolved_filter').on("click", function() {
210 if ($(this).hasClass('filtered')){
211 filter_resolved = false;
212 $(this).html('<i class="fa fa-filter"></i> '+txtActivefilter);
214 filter_resolved = true;
215 $(this).html('<i class="fa fa-bars"></i> '+txtInactivefilter);
217 tickets.DataTable().draw();
218 $(this).toggleClass('filtered');
221 [% FOR st IN status %]
222 $('#[% st.authorised_value | html %]_filter').on("click", function() {
223 if ($(this).hasClass('filtered')){
224 additional_filters.status.find((o, i) => {
225 if (o["!="] === '[% st.authorised_value | html %]') {
226 additional_filters.status.splice(i, 1);
227 return true; // stop searching
230 if ( additional_filters.status.length === 1 ){
231 delete additional_filters.status;
233 $(this).html('<i class="fa fa-filter"></i> '+_("Filter ")+"[% st.lib | html %]");
235 if (!additional_filters.hasOwnProperty("status")) {
236 additional_filters.status = [ '-and' ];
238 additional_filters.status.push({ '!=': "[% st.authorised_value | html %]" });
239 $(this).html('<i class="fa fa-bars"></i> '+_("Include ")+"[% st.lib | html %]");
241 tickets.DataTable().draw();
242 $(this).toggleClass('filtered');
247 [% Asset.js("js/modals/display_ticket.js") | $raw %]
249 [% INCLUDE 'intranet-bottom.inc' %]