Lines 299-304
Link Here
|
299 |
[% 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 %] |
299 |
[% 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 %] |
300 |
[% IF suggestions.count %]<li role="presentation"><a href="#suggestion_details" aria-controls="suggestion_details" role="tab" data-toggle="tab">Suggestion details</a></li>[% END %] |
300 |
[% IF suggestions.count %]<li role="presentation"><a href="#suggestion_details" aria-controls="suggestion_details" role="tab" data-toggle="tab">Suggestion details</a></li>[% END %] |
301 |
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li role="presentation"><a href="#editions" aria-controls="editions" role="tab" data-toggle="tab">Editions</a></li>[% END %][% END %] |
301 |
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li role="presentation"><a href="#editions" aria-controls="editions" role="tab" data-toggle="tab">Editions</a></li>[% END %][% END %] |
|
|
302 |
[% IF ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) %]<li role="presentation"><a href="#concerns" aria-controls="concerns" role="tab" data-toggle="tab">Concerns ([% biblio.tickets.count | html %])</a></li>[% END %] |
302 |
[% IF ( LocalCoverImages ) %] |
303 |
[% IF ( LocalCoverImages ) %] |
303 |
<li role="presentation"> |
304 |
<li role="presentation"> |
304 |
<a href="#images" aria-controls="images" role="tab" data-toggle="tab">Images ([% localimages.count || 0 | html %])</a> |
305 |
<a href="#images" aria-controls="images" role="tab" data-toggle="tab">Images ([% localimages.count || 0 | html %])</a> |
Lines 1000-1005
Note that permanent location is a code, and location may be an authval.
Link Here
|
1000 |
</table></div>[% END %] |
1001 |
</table></div>[% END %] |
1001 |
[% END %] |
1002 |
[% END %] |
1002 |
|
1003 |
|
|
|
1004 |
[% IF ( Koha.Prefernce('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) %] |
1005 |
<div role="tabpanel" class="tab-pane" id="concerns"> |
1006 |
<fieldset class="action" style="cursor:pointer;"> |
1007 |
<a id="hideResolved"><i class="fa fa-minus-square"></i> Hide resolved</a> |
1008 |
| <a id="showAll"><i class="fa fa-bars"></i> Show all</a> |
1009 |
</fieldset> |
1010 |
|
1011 |
<table id="table_concerns" width="100%"> |
1012 |
<thead> |
1013 |
<tr> |
1014 |
<th>Reported</th> |
1015 |
<th>Details</th> |
1016 |
<th>Status</th> |
1017 |
<th data-class-name="actions noExport">Actions</th> |
1018 |
</tr> |
1019 |
</thead> |
1020 |
</table> |
1021 |
|
1022 |
<!-- Resolve concern modal --> |
1023 |
<div class="modal" id="resolveConcernModal" tabindex="-1" role="dialog" aria-labelledby="resolveConcernLabel"> |
1024 |
<div class="modal-dialog" role="document"> |
1025 |
<div class="modal-content"> |
1026 |
<div class="modal-header"> |
1027 |
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
1028 |
<h4 class="modal-title" id="resolveConcernLabel">Resolve concern</h4> |
1029 |
</div> |
1030 |
<div class="modal-body"> |
1031 |
<fieldset class="rows"> |
1032 |
<ol> |
1033 |
<li> |
1034 |
<label for="notify">Notify: </label> |
1035 |
<input type="checkbox" name="notify" id="resolve_notify"> |
1036 |
</li> |
1037 |
<li> |
1038 |
<label for="message">Resolution: </label> |
1039 |
<textarea id="resolve_message" name="message"></textarea> |
1040 |
<p id="helpBlock" class="help-block">Optional message to include with the notification to the reporter</p> |
1041 |
|
1042 |
</li> |
1043 |
</ol> |
1044 |
</fieldset> |
1045 |
</div> <!-- /.modal-body --> |
1046 |
<div class="modal-footer"> |
1047 |
<input type="hidden" name="concern_id" id="concern_id"> |
1048 |
<button type="submit" class="btn btn-default" id="resolveConfirm">Confirm</button> |
1049 |
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> |
1050 |
</div> <!-- /.modal-footer --> |
1051 |
</div> <!-- /.modal-content --> |
1052 |
</div> <!-- /.modal-dialog --> |
1053 |
</div> <!-- /#resolveConcernModal --> |
1054 |
</div> |
1055 |
[% END %] |
1056 |
|
1003 |
[% IF ( LocalCoverImages ) %] |
1057 |
[% IF ( LocalCoverImages ) %] |
1004 |
<div role="tabpanel" class="tab-pane" id="images"> |
1058 |
<div role="tabpanel" class="tab-pane" id="images"> |
1005 |
[% IF localimages.count %] |
1059 |
[% IF localimages.count %] |
Lines 1301-1306
Note that permanent location is a code, and location may be an authval.
Link Here
|
1301 |
|
1355 |
|
1302 |
[% IF ( Koha.Preference('CatalogConcerns') ) %] |
1356 |
[% IF ( Koha.Preference('CatalogConcerns') ) %] |
1303 |
[% INCLUDE 'modals/add_catalog_concern.inc' %] |
1357 |
[% INCLUDE 'modals/add_catalog_concern.inc' %] |
|
|
1358 |
[% INCLUDE 'modals/display_ticket.inc' %] |
1304 |
[% END %] |
1359 |
[% END %] |
1305 |
|
1360 |
|
1306 |
[% MACRO jsinclude BLOCK %] |
1361 |
[% MACRO jsinclude BLOCK %] |
Lines 1313-1320
Note that permanent location is a code, and location may be an authval.
Link Here
|
1313 |
<script> |
1368 |
<script> |
1314 |
/* Set a variable needed by add_catalog_concern.js */ |
1369 |
/* Set a variable needed by add_catalog_concern.js */ |
1315 |
var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]"; |
1370 |
var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]"; |
|
|
1371 |
|
1372 |
$(document).ready(function() { |
1373 |
var table_settings = [% TablesSettings.GetTableSettings( 'cataloguing', 'concerns', 'table_concerns', 'json' ) | $raw %]; |
1374 |
|
1375 |
var tickets_url = '/api/v1/tickets'; |
1376 |
var tickets = $("#table_concerns").kohaTable({ |
1377 |
"ajax": { |
1378 |
"url": tickets_url |
1379 |
}, |
1380 |
"embed": [ |
1381 |
"reporter", |
1382 |
"resolver", |
1383 |
"updates+count", |
1384 |
], |
1385 |
'emptyTable': '<div class="dialog message">' + _("Congradulations, there are no catalog concerns.") + '</div>', |
1386 |
"columnDefs": [ { |
1387 |
"targets": [0,1,2], |
1388 |
"render": function (data, type, row, meta) { |
1389 |
if ( type == 'display' ) { |
1390 |
if ( data != null ) { |
1391 |
return data.escapeHtml(); |
1392 |
} |
1393 |
else { |
1394 |
return ""; |
1395 |
} |
1396 |
} |
1397 |
return data; |
1398 |
} |
1399 |
} ], |
1400 |
"columns": [ |
1401 |
{ |
1402 |
"data": "reported_date:reporter.firstname", |
1403 |
"render": function(data, type, row, meta) { |
1404 |
let reported = '<span class="date clearfix">' + $datetime(row.reported_date) + '</span>'; |
1405 |
reported += '<span class="reporter clearfix">' + $patron_to_html(row.reporter, { |
1406 |
display_cardnumber: false, |
1407 |
url: true |
1408 |
}) + '</span>'; |
1409 |
return reported; |
1410 |
}, |
1411 |
"searchable": true, |
1412 |
"orderable": true |
1413 |
}, |
1414 |
{ |
1415 |
"data": "title:body", |
1416 |
"render": function(data, type, row, meta) { |
1417 |
let result = '<a role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '">' + row.title + '</a>'; |
1418 |
if (row.updates_count) { |
1419 |
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>'; |
1420 |
} |
1421 |
result += '<div id="detail_' + row.ticket_id + '" class="hidden">' + row.body + '</div>'; |
1422 |
return result; |
1423 |
}, |
1424 |
"searchable": true, |
1425 |
"orderable": true |
1426 |
}, |
1427 |
{ |
1428 |
"data": "resolved_date", |
1429 |
"render": function(data, type, row, meta) { |
1430 |
let result = ''; |
1431 |
if (row.resolved_date) { |
1432 |
result += _("Resolved by:") + ' <span>' + $patron_to_html(row.resolver, { |
1433 |
display_cardnumber: false, |
1434 |
url: true |
1435 |
}) + '</span>'; |
1436 |
result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>'; |
1437 |
} else { |
1438 |
result += _("Open"); |
1439 |
} |
1440 |
return result; |
1441 |
}, |
1442 |
"searchable": true, |
1443 |
"orderable": true |
1444 |
}, |
1445 |
{ |
1446 |
"data": function(row, type, val, meta) { |
1447 |
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>'; |
1448 |
return result; |
1449 |
}, |
1450 |
"searchable": false, |
1451 |
"orderable": false |
1452 |
}, |
1453 |
] |
1454 |
}, table_settings, 0, { biblio_id: [% biblionumber | uri %]}); |
1455 |
|
1456 |
$('#hideResolved').on( "click", function() { |
1457 |
// It would be great if we could pass null here but it gets stringified |
1458 |
concerns.DataTable().columns('3').search('special:undefined').draw(); |
1459 |
}); |
1460 |
|
1461 |
$('#showAll').on( "click", function() { |
1462 |
concerns.DataTable().columns('3').search('').draw(); |
1463 |
}); |
1464 |
|
1465 |
$('#resolveConcernModal').on('show.bs.modal', function (event) { |
1466 |
let modal = $(this); |
1467 |
let button = $(event.relatedTarget); |
1468 |
let concern = button.data('concern'); |
1469 |
|
1470 |
modal.find('.modal-footer input').val(concern) |
1471 |
}); |
1472 |
|
1473 |
$('#resolveConcernModal').on('click', '#resolveConfirm', function(e) { |
1474 |
let concern_id = $('#concern_id').val(); |
1475 |
let params = { notify: $('#resolve_notify').is(":checked"), message: $('#resolve_message').val() }; |
1476 |
|
1477 |
$.ajax({ |
1478 |
url: "/api/v1/tickets/"+concern_id+"/resolve", |
1479 |
method: "POST", |
1480 |
data: JSON.stringify(params) |
1481 |
}).success(function() { |
1482 |
$("#resolveConcernModal").modal('hide'); |
1483 |
concerns.DataTable().ajax.reload(function (data) { |
1484 |
$("#concern_action_result_dialog").hide(); |
1485 |
$("#concern_delete_success").html(_("Concern #%s deleted successfully.").format(concern_id)).show(); |
1486 |
}); |
1487 |
}).error(function () { |
1488 |
$("#concern_resolve_error").html(_("Error resolving concern #%s. Check the logs.").format(concern_id)).show(); |
1489 |
}); |
1490 |
}); |
1491 |
}); |
1316 |
</script> |
1492 |
</script> |
1317 |
[% Asset.js("js/modals/add_catalog_concern.js") | $raw %] |
1493 |
[% Asset.js("js/modals/add_catalog_concern.js") | $raw %] |
|
|
1494 |
[% Asset.js("js/modals/display_ticket.js") | $raw %] |
1318 |
[% END %] |
1495 |
[% END %] |
1319 |
<script> |
1496 |
<script> |
1320 |
var interface = "[% interface | html %]"; |
1497 |
var interface = "[% interface | html %]"; |