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