Bug 9824: Make it possible to apply/cancel switch
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / booksellers.tt
1 [% USE KohaDates %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Search for vendor [% supplier %]</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 <style type="text/css">
6 #vendors td{
7         vertical-align: top;
8 }
9 </style>
10 <link rel="stylesheet" href="[% themelang %]/css/datatables.css" />
11 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
12 [% INCLUDE 'datatables-strings.inc' %]
13 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
14 <script type="text/javascript">
15 //<![CDATA[
16 $(document).ready(function() {
17     [% IF (dateformat == 'metric') %]
18         dt_add_type_uk_date();
19     [% END %]
20     $("table.baskets").dataTable($.extend(true, {}, dataTablesDefaults, {
21         'sDom': 't',
22         'bPaginate': false,
23         'bFilter': false,
24         'bInfo': false,
25         "aaSorting": [[ 1, "asc" ]],
26         'aoColumnDefs': [
27             { 'aTargets': [-1], 'bSortable': false }
28         ]
29     }));
30     $("#supplierlist").change(function() {
31         var id = $(this).find("option:selected").val();
32         window.location.href = "#" + id;
33     });
34 });
35 //]]>
36 </script>
37
38 </head>
39 <body id="acq_booksellers" class="acq">
40 [% INCLUDE 'header.inc' %]
41 [% INCLUDE 'acquisitions-search.inc' %]
42
43 <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; Search for vendor <em>[% supplier %]</em> </div>
44
45 <div id="doc3" class="yui-t2">
46    
47     <div id="bd">
48     <div id="yui-main">
49     <div class="yui-b">
50     
51 [% INCLUDE 'acquisitions-toolbar.inc' %]
52 [% UNLESS ( count == 1 ) %]
53 <h1>You searched on <b>vendor [% supplier %],</b> [% count %] results found</h1>
54 [% END %]
55 [% IF ( loop_suppliers.size ) %]
56     [% UNLESS (count == 1) %]
57         <p>Choose a vendor in the list to jump directly to the right place.
58         <select id="supplierlist">
59             [% FOREACH supplier1 IN loop_suppliers %]
60                 <option value="[% supplier1.booksellerid %]">[% supplier1.name %]</option>
61             [% END %]
62         </select>
63         </p>
64     [% END %]
65     <p>
66     [% IF ( allbaskets ) %]
67         <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&booksellerid=[% booksellerid %]">Apply filter</a>
68     [% ELSE %]
69         <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&booksellerid=[% booksellerid %]&allbaskets=1">Cancel filter</a>
70     [% END %]
71     </p>
72     <div id="acqui_order_supplierlist">
73         [% FOREACH supplier IN loop_suppliers %]
74             <div class="supplier">
75                 <span class="suppliername">
76                     [% IF (supplier.name) %]
77                         <a name="[% supplier.booksellerid %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid %]">[% supplier.name %]</a>
78                     [% ELSE %]
79                         <a name="[% supplier.booksellerid %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid %]">NO NAME</a>
80                     [% END %]
81                 </span>
82                 <span class="action">
83                     [% IF ( CAN_user_acquisition_order_manage ) %]
84                         [% IF ( supplier.active ) %]
85                             <input type="button" value="New basket" onclick="window.location.href='/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% supplier.booksellerid %]&amp;op=add_form'" />
86                         [% ELSE %]
87                             (inactive)
88                         [% END %]
89                     [% END %]
90                     <input type="button" value="Receive shipment" onclick="window.location.href='/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% supplier.booksellerid %]'" />
91                 </span>
92                 <div class="baskets">
93                     [% IF ( supplier.loop_basket.size ) %]
94                         <table class="baskets">
95                             <thead>
96                                 <tr>
97                                     <th>No.</th>
98                                     <th>Name</th>
99                                     <th>Item count</th>
100                                     <th>Biblio count</th>
101                                     <th>Items expected</th>
102                                     <th>Created by</th>
103                                     <th>Date</th>
104                                     <th>&nbsp;</th>
105                                 </tr>
106                             </thead>
107                             <tbody>
108                                 [% FOREACH basket IN supplier.loop_basket %]
109                                     [% IF ( basket.uncertainprices ) %]
110                                         <tr class="problem">
111                                     [% ELSE %]
112                                         <tr>
113                                     [% END %]
114                                         <td>[% basket.basketno %]</td>
115                                         <td>[% basket.basketname %]</td>
116                                         <td>[% basket.total_items %]</td>
117                                         <td>[% basket.total_biblios %]</td>
118                                         <td>[% basket.expected_items %]</td>
119                                         <td>
120                                             [% basket.authorisedby_firstname %]
121                                             [% basket.authorisedby_surname %]
122                                         </td>
123                                         <td>[% basket.creationdate | $KohaDates %]</td>
124                                         <td>
125                                             [% IF ( basket.closedate ) %]
126                                                 closed on [% basket.closedate | $KohaDates %]
127                                                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">View</a>
128                                             [% ELSE %]
129                                                 [% IF ( basket.active ) %]
130                                                     <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">Modify</a>
131                                                 [% ELSE %]
132                                                     <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">View</a>
133                                                 [% END %]
134                                             [% END %]
135                                         </td>
136                                     </tr>
137                                 [% END %][%# FOREACH basket IN supplier.loop_basket %]
138                             </tbody>
139                         </table>
140                     [% ELSE %]
141                         <p>No pending baskets</p>
142                     [% END %][%# IF ( supplier.loop_basket.size ) %]
143                 </div>
144             </div>
145         [% END %][%# FOREACH supplier IN loop_suppliers %]
146     </div>
147 [% END %][%# IF ( loop_suppliers.size ) %]
148 </div>
149 </div>
150 <div class="yui-b">
151 [% IF ( booksellerid ) %]
152 [% INCLUDE 'vendor-menu.inc' %]
153 [% END %]
154 [% INCLUDE 'acquisitions-menu.inc' %]
155 </div>
156 </div>
157 [% INCLUDE 'intranet-bottom.inc' %]