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