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