+[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
-<title>Koha › Acquisitions</title>
+<title>Koha › Acquisitions › EDIFACT messages</title>
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'datatables.inc' %]
$(document).ready(function() {
$('#edi_msgs').dataTable($.extend(true, {}, dataTablesDefaults, {
'aaSorting': [[1, "desc" ]],
- 'sPaginationType': "four_button"
- }));
+ 'sPaginationType': "four_button",
+ "aoColumnDefs": [
+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
+ { "sType": "title-string", "aTargets" : [ "title-string" ] }
+ ]
+ }));
+
+ var EDIModal = $("#EDI_modal");
+ var EDIModalBody = $("#EDI_modal .modal-body");
+
+ $(".view_message").on("click", 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", function(){
+ EDIModalBody.html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
+ });
+ $(".delete_msg").on("click",function(){
+ return confirm(_("Are you sure you want to delete this message?"));
+ });
});
</script>
-
+<style type="text/css">
+#EDI_modal { width : 80%; margin-left : -40%; } @media (max-width: 767px) { #EDI_modal { margin: 0; width : auto; } }
+</style>
</head>
<body id="acq_edifactmsgs" class="acq">
[% INCLUDE 'header.inc' %]
<h1>EDIFACT messages</h1>
<div id="acqui_edifactmsgs">
-
+[% IF ( messages ) %]
<table id="edi_msgs">
<thead>
+<tr>
<th>Type</th>
-<th>Transferred</th>
+<th class="title-string">Transferred</th>
<th>Status</th>
<th>Vendor</th>
<th>Details</th>
<th>Filename</th>
-<th> </th>
-<th>Action</th>
+<th>Actions</th>
+</tr>
</thead>
<tbody>
[% FOREACH msg IN messages %]
<tr>
<td>[% msg.message_type %]</td>
-<td>[% msg.transfer_date %]</td>
+<td><span title="[% msg.transfer_date %]">[% msg.transfer_date | $KohaDates %]</span></td>
<td>[% msg.status %]</td>
<td>
-<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% msg.vendor_id %]"</a>
-[% msg.vendor.name %]
+ <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% msg.vendor_id %]">
+ [% msg.vendor.name %]
+ </a>
</td>
<td>
[% IF msg.message_type == 'QUOTE' || msg.message_type == 'ORDERS' %]
</a>
[% END %]
</td>
-</td>
<td>[% msg.filename %]</td>
-<td><a class="popup" target="_blank" title="View Message" href="/cgi-bin/koha/acqui/edimsg.pl?id=[% msg.id %]"</a>View message</td>
-<td>
-<a href="/cgi-bin/koha/acqui/edifactmsgs.pl?op=delete&message_id=[% msg.id %]">Delete</a>
+
+<td class="actions">
+ <a class="btn btn-mini view_message" target="_blank" href="/cgi-bin/koha/acqui/edimsg.pl?id=[% msg.id %]"><i class="fa fa-search"></i> View message</a>
+ <a class="btn btn-mini delete_msg" href="/cgi-bin/koha/acqui/edifactmsgs.pl?op=delete&message_id=[% msg.id %]"><i class="fa fa-trash"></i> Delete</a>
</td>
</tr>
[% END %]
</tbody>
</table>
+<!-- Modal to display EDIFACT messages -->
+<div class="modal hide" id="EDI_modal" tabindex="-1" role="dialog" aria-labelledby="EDI_modal_label" aria-hidden="true">
+ <div class="modal-header">
+ <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
+ <h3 id="EDI_modal_label">EDIFACT message</h3>
+ </div>
+ <div class="modal-body">
+ <div id="loading"> <img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /> Loading </div>
+ </div>
+ <div class="modal-footer">
+ <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
+ </div>
+</div>
+
+
+[% ELSE %]
+ <div class="dialog message">There are no EDIFACT messages.</div>
+[% END %]
+
</div>
</div>
</div>