Bug 19755: Move template JavaScript to the footer: Acquisitions, part 3
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / uncertainprice.tt
1 [% USE Koha %]
2 [% SET footerjs = 1 %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( booksellername ) %]Orders with uncertain prices for vendor [% booksellername %][% ELSE %]Orders with uncertain prices[% END %]</title>
5 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
6 [% INCLUDE 'doc-head-close.inc' %]
7 </head>
8
9 <body id="acq_uncertainprice" class="acq">
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'acquisitions-search.inc' %]
12
13 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; [% IF ( booksellername ) %]<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername %]</a> &rsaquo; Uncertain prices for vendor [% booksellername %][% ELSE %]Uncertain prices[% END %]</div>
14
15 <div id="doc3" class="yui-t2">
16
17     <div id="bd">
18     <div id="yui-main">
19     <div class="yui-b">
20
21 [% INCLUDE 'acquisitions-toolbar.inc' %]
22         [% IF ( validate ) %]
23             [% SET metacontent = '0; url=' _  scriptname  _ '?booksellerid=' _  booksellerid %]
24             <META HTTP-EQUIV=Refresh CONTENT="[% metacontent %]">
25         [% ELSE %]
26         [% IF ( booksellername ) %]
27             <h1>Orders with uncertain prices for vendor <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername %]</a></h1>
28             <h2>Contact information</h2>
29             <p><strong>Address: </strong>
30                 [% booksellerpostal %]
31                 [% bookselleraddress1 %]
32                 [% bookselleraddress2 %]
33                 [% bookselleraddress3 %]
34                 [% bookselleraddress4 %]
35                 <a href="[% booksellerurl %]">[% booksellerurl %]</a>
36             </p>
37             <p><strong>Phone: </strong>
38                 [% booksellerphone %] / Fax:
39                 [% booksellerfax %]</p>
40             <dl>
41                 [% FOREACH contact IN contacts %]
42                     <dt><strong>Contact: </strong></dt>
43                     <dd>[% contact.name %]
44                         [% contact.position %]
45                         [% contact.phone %]
46                         [% contact.altphone %]
47                         [% contact.email %]
48                         [% contact.notes %]
49                     </dd>
50                 [% END %]
51             </dl>
52             [% IF ( booksellernotes ) %]
53             <p><strong>Notes: </strong>
54                 [% booksellernotes %]</p>
55             [% END %]
56         [% END %]
57
58         <h2>Orders with uncertain prices</h2>
59         <form action="[% scriptname %]" method="post">
60         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
61         <label for="owner">Orders from:</label>
62         <select id="owner" name="owner">
63             [% IF ( owner ) %]
64             <option value="0">Everyone</option>
65             <option value="1" selected="selected">me</option>
66             [% ELSE %]
67             <option value="0" selected="selected">Everyone</option>
68             <option value="1">me</option>
69             [% END %]
70         </select>
71         <input type="submit" value="Filter" />
72         </form>
73         <form action="[% scriptname %]" method="post" id="uncertainprices">
74         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
75         <input type="hidden" name="op" value="validate" />
76         <table id="uncertainpricet">
77         <thead>
78             <tr>
79             <th>Basket</th>
80            <th>Order</th>
81             <th>By</th>
82             <th>Uncertain</th>
83             <th>Price</th>
84             <th>Quantity</th>
85             </tr>
86         </thead>
87         <tbody>
88             [% FOREACH uncertainpriceorder IN uncertainpriceorders %]
89             <tr>
90         <td>
91             [% uncertainpriceorder.basketname %]
92         </td>
93             <td>
94             <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% uncertainpriceorder.biblionumber %]">[% uncertainpriceorder.title |html %]</a>
95             [% IF ( uncertainpriceorder.author ) %] <em>by</em> [% uncertainpriceorder.author %][% END %]
96             [% IF ( uncertainpriceorder.publishercode ) %]
97                 <br /><em>Publisher:</em> [% uncertainpriceorder.publishercode %]
98                 [%- IF    ( uncertainpriceorder.publicationyear ) -%], [% uncertainpriceorder.publicationyear %]
99                 [%- ELSIF ( uncertainpriceorder.copyrightdate ) -%] [% uncertainpriceorder.copyrightdate %]
100                 [% END %]
101             [% END %]
102             [% IF ( uncertainpriceorder.isbn ) %]<br />[% uncertainpriceorder.isbn %][% END %]
103             <br />
104             <a href="neworderempty.pl?ordernumber=[% uncertainpriceorder.ordernumber %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% uncertainpriceorder.basketno %]">
105                 Edit
106             </a>
107         </td>
108         <td>
109             [% uncertainpriceorder.firstname %] [% uncertainpriceorder.surname %]
110         </td>
111             <td>
112                 <input type="checkbox" name="uncertainprice[% uncertainpriceorder.ordernumber %]" value="1" checked="checked" />
113             </td>
114             <td>
115             <input class="check_uncertain" data-ordernumber="[% uncertainpriceorder.ordernumber %]" type="text" size="10" name="price[% uncertainpriceorder.ordernumber %]" value="[% uncertainpriceorder.listprice %]" />
116             </td>
117             <td>
118         [% IF basket.effective_create_items == 'ordering' %]
119             [% uncertainpriceorder.quantity %]
120             <input type="hidden" name="qty[% uncertainpriceorder.ordernumber %]" value="[% uncertainpriceorder.quantity %]" />
121         [% ELSE %]
122             <input class="check_uncertain" data-ordernumber="[% uncertainpriceorder.ordernumber %]" type="text" size="10" name="qty[% uncertainpriceorder.ordernumber %]" value="[% uncertainpriceorder.quantity %]" />
123         [% END %]
124             </td>
125             </tr>
126             [% END %]
127     </tbody>
128         </table>
129     <fieldset class="action"><input type="submit" value="Save" /></fieldset>
130         </form>
131         [% END %]
132
133 </div>
134 </div>
135 <div class="yui-b">
136 [% INCLUDE 'vendor-menu.inc' %]
137 </div>
138 </div>
139
140 [% MACRO jsinclude BLOCK %]
141     <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu_[% KOHA_VERSION %].js"></script>
142     [% INCLUDE 'datatables.inc' %]
143     <script type="text/javascript">
144         $(document).ready(function() {
145             var uncertainpricet = $("#uncertainpricet").dataTable($.extend(true, {}, dataTablesDefaults, {
146                 "aoColumnDefs": [
147                     { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
148                 ],
149                 "sPaginationType": "four_button"
150             }));
151             $(".check_uncertain").on("change",function(){
152                 var form = document.getElementById("uncertainprices");
153                 var ordernumber = $(this).data("ordernumber");
154                 uncheckbox( form, ordernumber );
155             });
156         });
157         var MSG_INVALIDPRICE = _("ERROR: Price is not a valid number, please check the price and try again!");
158     </script>
159     <script type="text/javascript" src="[% interface %]/[% theme %]/js/acq_[% KOHA_VERSION %].js"></script>
160 [% END %]
161
162 [% INCLUDE 'intranet-bottom.inc' %]