Bug 20538: Remove the need of writing [% KOHA_VERSION %] everywhere
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / edifactmsgs.tt
1 [% USE Asset %]
2 [% USE KohaDates %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Acquisitions &rsaquo; EDIFACT messages</title>
6 [% Asset.css("css/datatables.css") %]
7 [% INCLUDE 'doc-head-close.inc' %]
8 <style type="text/css">
9 #EDI_modal { width : 80%; } @media (max-width: 767px) { #EDI_modal { margin: 0; width : auto; } }
10 </style>
11 </head>
12
13 <body id="acq_edifactmsgs" class="acq">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'acquisitions-search.inc' %]
16 <div id="breadcrumbs">
17 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
18 &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
19 &rsaquo; <a href="/cgi-bin/koha/acqui/edifactmsgs.pl">EDIFACT messages</a>
20 </div>
21
22 <div id="doc3" class="yui-t2">
23
24 <div id="bd">
25     <div id="yui-main">
26     <div class="yui-b">
27
28
29 <h1>EDIFACT messages</h1>
30 <div id="acqui_edifactmsgs">
31
32 [% IF ( messages ) %]
33 <table id="edi_msgs">
34 <thead>
35 <tr>
36 <th>Type</th>
37 <th class="title-string">Transferred</th>
38 <th>Status</th>
39 <th>Vendor</th>
40 <th>Details</th>
41 <th>Filename</th>
42 <th>Actions</th>
43 </tr>
44 </thead>
45 <tbody>
46 [% FOREACH msg IN messages %]
47 <tr>
48 <td>[% msg.message_type %]</td>
49 <td><span title="[% msg.transfer_date %]">[% msg.transfer_date | $KohaDates %]</span></td>
50 <td>[% msg.status %]</td>
51 <td>
52     <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% msg.vendor_id %]">
53         [% msg.vendor.name %]
54     </a>
55 </td>
56 <td>
57 [% IF msg.message_type == 'QUOTE' || msg.message_type == 'ORDERS' %]
58     [% IF msg.basketno %]
59     <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% msg.basketno.basketno %]">
60     Basket: [% msg.basketno.basketno %]
61     </a>
62     [% END %]
63 [% ELSE %]
64 <!-- Assuming invoices -->
65      <a href="/cgi-bin/koha/acqui/invoices.pl?message_id=[% msg.id %]">
66       Invoices
67      </a>
68 [% END %]
69 </td>
70 <td>[% msg.filename %]</td>
71
72 <td class="actions">
73     <a class="btn btn-default btn-xs view_message" target="_blank" href="/cgi-bin/koha/acqui/edimsg.pl?id=[% msg.id %]"><i class="fa fa-search"></i> View message</a>
74     <a class="btn btn-default btn-xs delete_msg" href="/cgi-bin/koha/acqui/edifactmsgs.pl?op=delete&amp;message_id=[% msg.id %]"><i class="fa fa-trash"></i> Delete</a>
75 </td>
76 </tr>
77 [% END %]
78
79 </tbody>
80 </table>
81
82 <!-- Modal to display EDIFACT messages -->
83 <div class="modal" id="EDI_modal" tabindex="-1" role="dialog" aria-labelledby="EDI_modal_label" aria-hidden="true">
84     <div class="modal-dialog">
85     <div class="modal-content">
86     <div class="modal-header">
87         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">&times;</button>
88         <h3 id="EDI_modal_label">EDIFACT message</h3>
89     </div>
90     <div class="modal-body">
91         <div id="loading"> <img src="[% interface %]/[% theme %]/img/spinner-small.gif" alt="" /> Loading </div>
92     </div>
93     <div class="modal-footer">
94         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
95     </div>
96     </div>
97     </div>
98 </div>
99
100
101 [% ELSE %]
102     <div class="dialog message">There are no EDIFACT messages.</div>
103 [% END %]
104
105 </div>
106 </div>
107 </div>
108 <div class="yui-b">
109 [% INCLUDE 'acquisitions-menu.inc' %]
110 </div>
111 </div>
112
113 [% MACRO jsinclude BLOCK %]
114     [% Asset.js("js/acquisitions-menu.js") %]
115     [% INCLUDE 'datatables.inc' %]
116     <script type="text/javascript">
117         $(document).ready(function() {
118             $('#edi_msgs').dataTable($.extend(true, {}, dataTablesDefaults, {
119                 'aaSorting': [[1, "desc" ]],
120                 'sPaginationType': "four_button",
121                 "aoColumnDefs": [
122                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
123                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
124                 ]
125             }));
126
127             var EDIModal = $("#EDI_modal");
128             var EDIModalBody = $("#EDI_modal .modal-body");
129
130             $(".view_message").on("click", function(e){
131                 e.preventDefault();
132                 var page = $(this).attr("href");
133                 EDIModalBody.load(page + " #edimsg");
134                 EDIModal.modal("show");
135             });
136             EDIModal.on("click",".closebtn",function(e){
137                 e.preventDefault();
138                 EDIModal.modal("hide");
139             });
140             EDIModal.on("hidden", function(){
141                 EDIModalBody.html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
142             });
143             $(".delete_msg").on("click",function(){
144                 return confirm(_("Are you sure you want to delete this message?"));
145             });
146         });
147     </script>
148 [% END %]
149
150 [% INCLUDE 'intranet-bottom.inc' %]