Koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt
Jonathan Druart a19d36cf14
Bug 34862: Include messages.inc
Generated using `perl add_blocking_errors.pl`

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-01-31 14:44:44 +01:00

186 lines
7.4 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE KohaDates %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %]
[% t("EDIFACT messages") | html %] &rsaquo;
[% t("Acquisitions") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="acq_edifactmsgs" class="acq">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>EDIFACT messages</span>
[% END %]
[% END #/ WRAPPER breadcrumbs %]
[% END #/ WRAPPER sub-header.inc %]
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
[% INCLUDE 'messages.inc' %]
<h1>EDIFACT messages</h1>
<div id="acqui_edifactmsgs" class="page-section">
<table id="edi_msgs"></table>
<!-- Modal to display EDIFACT messages -->
<div class="modal" id="EDI_modal" tabindex="-1" role="dialog" aria-labelledby="EDI_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3 id="EDI_modal_label">EDIFACT message</h3>
</div>
<div class="modal-body">
<div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
</div>
</div> <!-- /#acqui_edifactmsgs -->
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'acquisitions-menu.inc' %]
</aside>
</div>
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/acquisitions-menu.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
<script>
$(document).ready(function() {
let edi_msgs_table_url = '/api/v1/acquisitions/edifiles?';
var edi_msgs_table = $("#edi_msgs").kohaTable({
"ajax": {
"url": edi_msgs_table_url
},
"embed": [
"vendor",
"basket"
],
"columns": [
{
"data": "type",
"title": _("Type"),
"searchable": true,
"orderable": true
},
{
"data": "transfer_date",
"title": _("Transferred"),
"searchable": true,
"orderable": true,
"render": function(data, type, row, meta) {
return $date(row.transfer_date);
}
},
{
"data": "status",
"title": _("Status"),
"searchable": true,
"orderable": true
},
{
"data": "vendor.name",
"title": _("Vendor"),
"searchable": true,
"orderable": true,
"render": function(data, type, row, meta) {
let link;
if ( row.vendor ) {
link = '<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid='+row.vendor_id+'">'+row.vendor.name+'</a>';
} else {
link = '<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid='+row.vendor_id+'">'+row.vendor_id+'</a>';
}
return link;
}
},
{
"title": _("Details"),
"searchable": false,
"orderable": false,
"render": function(data, type, row, meta) {
let rendered = '';
if ( row.type == 'QUOTE' || row.type == 'ORDERS' ) {
if ( row.basket_id ) {
rendered = '<a href="/cgi-bin/koha/acqui/basket.pl?basketno='+row.basked_id+'">'+_("Basket")+': '+row.basket_id+'</a>';
}
} else {
rendered = '<a href="/cgi-bin/koha/acqui/invoices.pl?message_id='+row.id+'&op=do_search">'+_("Invoices")+'</a>';
}
return rendered;
}
},
{
"data": "filename",
"title": _("Filename"),
"searchable": true,
"orderable": true
},
{
"title": _("Actions"),
"className": "actions",
"searchable": false,
"orderable": false,
"render": function(data, type, row, meta) {
var result = '<a class="btn btn-default btn-xs view_message" target="_blank" href="/cgi-bin/koha/acqui/edimsg.pl?id='+encodeURIComponent(row.id)+'"><i class="fa fa-search"></i> '+_("View message")+'</a> ';
result += '<a class="btn btn-default btn-xs delete_msg" href="/cgi-bin/koha/acqui/edifactmsgs.pl?op=delete&amp;message_id='+encodeURIComponent(row.id)+'"><i class="fa fa-trash-can"></i> '+_("Delete")+'</a> ';
if ( row.status == 'new' ) {
result += '<a class="btn btn-default btn-xs import_msg" href="/cgi-bin/koha/acqui/edifactmsgs.pl?op=import&amp;message_id='+encodeURIComponent(row.id)+'"><i class="fa fa-cog"></i> '+_("Import")+'</a> ';
}
return result;
}
}
]
}, 0, 0);
var EDIModal = $("#EDI_modal");
var EDIModalBody = $("#EDI_modal .modal-body");
$("body").on("click", ".view_message", function(e){
e.preventDefault();
var page = $(this).attr("href");
EDIModalBody.load(page + " #edimsg");
EDIModal.modal("show");
});
EDIModal.on("click",".closebtn",function(e){
e.preventDefault();
EDIModal.modal("hide");
});
EDIModal.on("hidden.bs.modal", function(){
EDIModalBody.html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
});
$("body").on("click", ".delete_msg" ,function(){
return confirm(_("Are you sure you want to delete this message?"));
});
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]