Bug 12904: Force browser to load new javascript files after upgrade
[koha_ffzg] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / edifactmsgs.tt
1 [% USE KohaDates %]
2 [% SET footerjs = 1 %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Acquisitions &rsaquo; EDIFACT messages</title>
5 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
6 [% INCLUDE 'doc-head-close.inc' %]
7 <style type="text/css">
8 #EDI_modal { width : 80%; } @media (max-width: 767px) { #EDI_modal { margin: 0; width : auto; } }
9 </style>
10 </head>
11
12 <body id="acq_edifactmsgs" class="acq">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'acquisitions-search.inc' %]
15 <div id="breadcrumbs">
16 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
17 &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
18 &rsaquo; <a href="/cgi-bin/koha/acqui/edifactmsgs.pl">EDIFACT messages</a>
19 </div>
20
21 <div id="doc3" class="yui-t2">
22
23 <div id="bd">
24     <div id="yui-main">
25     <div class="yui-b">
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>
105 </div>
106 </div>
107 <div class="yui-b">
108 [% INCLUDE 'acquisitions-menu.inc' %]
109 </div>
110 </div>
111
112 [% MACRO jsinclude BLOCK %]
113     <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu_[% KOHA_VERSION %].js"></script>
114     [% INCLUDE 'datatables.inc' %]
115     <script type="text/javascript">
116         $(document).ready(function() {
117             $('#edi_msgs').dataTable($.extend(true, {}, dataTablesDefaults, {
118                 'aaSorting': [[1, "desc" ]],
119                 'sPaginationType': "four_button",
120                 "aoColumnDefs": [
121                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
122                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
123                 ]
124             }));
125
126             var EDIModal = $("#EDI_modal");
127             var EDIModalBody = $("#EDI_modal .modal-body");
128
129             $(".view_message").on("click", function(e){
130                 e.preventDefault();
131                 var page = $(this).attr("href");
132                 EDIModalBody.load(page + " #edimsg");
133                 EDIModal.modal("show");
134             });
135             EDIModal.on("click",".closebtn",function(e){
136                 e.preventDefault();
137                 EDIModal.modal("hide");
138             });
139             EDIModal.on("hidden", function(){
140                 EDIModalBody.html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
141             });
142             $(".delete_msg").on("click",function(){
143                 return confirm(_("Are you sure you want to delete this message?"));
144             });
145         });
146     </script>
147 [% END %]
148
149 [% INCLUDE 'intranet-bottom.inc' %]