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