Bug 11243: make vendor list distinguish between active and canceled items
[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 [% INCLUDE 'datatables.inc' %]
12 <script type="text/javascript">
13 //<![CDATA[
14 $(document).ready(function() {
15     $("table.baskets").dataTable($.extend(true, {}, dataTablesDefaults, {
16         'sDom': 't',
17         'bPaginate': false,
18         'bFilter': false,
19         'bInfo': false,
20         "aaSorting": [[ 1, "asc" ]],
21         "aoColumns": [
22             null,null,null,null,null,null,{ "sType": "title-string" },null,{ "sType": "title-string" },null
23         ],
24         'aoColumnDefs': [
25             { 'aTargets': [-1], 'bSortable': false }
26         ]
27     }));
28     $("#supplierlist").change(function() {
29         var id = $(this).find("option:selected").val();
30         window.location.href = "#" + id;
31     });
32     $(".modal").on("show", function(){
33         var basket = $(this).data("basketno");
34         var legend = _("Add order to basket") + " " + basket;
35         $(this).find("legend").html(legend);
36     });
37 });
38 //]]>
39 </script>
40
41 </head>
42 <body id="acq_booksellers" class="acq">
43 [% INCLUDE 'header.inc' %]
44 [% INCLUDE 'acquisitions-search.inc' %]
45
46 <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>
47
48 <div id="doc3" class="yui-t2">
49    
50     <div id="bd">
51     <div id="yui-main">
52     <div class="yui-b">
53     
54 [% INCLUDE 'acquisitions-toolbar.inc' %]
55 [% UNLESS ( count == 1 ) %]
56 <h1>You searched on <b>vendor [% supplier %],</b> [% count %] results found</h1>
57 [% END %]
58 [% IF ( loop_suppliers.size ) %]
59     [% UNLESS (count == 1) %]
60         <p>Choose a vendor in the list to jump directly to the right place.
61         <select id="supplierlist">
62             [% FOREACH supplier1 IN loop_suppliers %]
63                 <option value="[% supplier1.booksellerid %]">[% supplier1.name %]</option>
64             [% END %]
65         </select>
66         </p>
67     [% END %]
68     [% IF ( allbaskets ) %]
69         <p><a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&amp;booksellerid=[% booksellerid %]">Show active baskets only</a></p>
70     [% ELSE %]
71         <p><a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&amp;booksellerid=[% booksellerid %]&amp;allbaskets=1">Show all baskets</a></p>
72     [% END %]
73     <div id="acqui_order_supplierlist">
74         [% FOREACH supplier IN loop_suppliers %]
75             <div class="supplier">
76                 <span class="suppliername">
77                     [% IF (supplier.name) %]
78                         <a name="[% supplier.booksellerid %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid %]">[% supplier.name %]</a>
79                     [% ELSE %]
80                         <a name="[% supplier.booksellerid %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid %]">NO NAME</a>
81                     [% END %]
82                 </span>
83                 <span class="action">
84                     [% IF ( CAN_user_acquisition_order_manage ) %]
85                         [% IF ( supplier.active ) %]
86                             <a class="btn btn-small" href="/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% supplier.booksellerid %]&amp;op=add_form"><i class="icon-plus"></i> New basket</a>
87                         [% ELSE %]
88                             (inactive)
89                         [% END %]
90                     [% END %]
91                     <a class="btn btn-small" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% supplier.booksellerid %]"><i class="icon-inbox"></i> Receive shipment</a>
92                 </span>
93                 <div class="baskets">
94                     [% IF ( supplier.loop_basket.size ) %]
95                         <table class="baskets">
96                             <thead>
97                                 <tr>
98                                     <th>No.</th>
99                                     <th>Name</th>
100                                     <th>Item count</th>
101                                     <th>Biblio count</th>
102                                     <th>Items expected</th>
103                                     <th>Created by</th>
104                                     <th>Date</th>
105                                     <th>Basket group</th>
106                                     <th>Closed</th>
107                                     <th>&nbsp;</th>
108                                 </tr>
109                             </thead>
110                             <tbody>
111                                 [% FOREACH basket IN supplier.loop_basket %]
112                                     [% IF ( basket.uncertainprices ) %]
113                                         <tr class="problem">
114                                     [% ELSE %]
115                                         <tr>
116                                     [% END %]
117                                         <td>[% basket.basketno %]</td>
118                                         <td>[% basket.basketname %]</td>
119                                         <td>
120                                             [% basket.total_items %]
121                                             [% IF basket.total_items_cancelled %]
122                                                 ([% basket.total_items_cancelled %] cancelled)
123                                             [% END %]
124                                         </td>
125                                         <td>[% basket.total_biblios %]</td>
126                                         <td>[% basket.expected_items %]</td>
127                                         <td>
128                                             [% basket.authorisedby_firstname %]
129                                             [% basket.authorisedby_surname %]
130                                         </td>
131                                         <td><span title="[% basket.creationdate %]">[% basket.creationdate | $KohaDates %]</span></td>
132                                         <td>
133                                           [% IF basket.basketgroup %]
134                                             [% basketgroup = basket.basketgroup %]
135                                             [% IF basketgroup.closed %]
136                                               [% basketgroup.name %] (closed)
137                                             [% ELSE %]
138                                               <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% basket.booksellerid %]&basketgroupid=[% basketgroup.id %]">[% basketgroup.name %]</a>
139                                             [% END %]
140                                           [% END %]
141                                         </td>
142                                         <td>
143                                             [% IF ( basket.closedate ) %]
144                                                 <span title="[% basket.closedate %]">[% basket.closedate | $KohaDates %]</span>
145                                             [% ELSE %]
146                                                 <span title="9999-99-99"></span>
147                                             [% END %]
148                                         </td>
149                                         <td>
150                                             <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">View</a>
151
152                                             [% UNLESS ( basket.closedate ) %]
153                                                | <a id="addtoBasketLabel[% basket.basketno %]" href="#addtoBasket[% basket.basketno %]" role="button" data-toggle="modal">Add to basket</a>
154                                                 <!-- Modal -->
155                                                 <div id="addtoBasket[% basket.basketno %]" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel[% basket.basketno %]" aria-hidden="true" data-basketno="[% basket.basketname %]">
156                                                     <div class="modal-body">
157                                                         [% INCLUDE 'acquisitions-add-to-basket.inc' booksellerid=supplier.booksellerid basketno=basket.basketno %]
158                                                     </div>
159                                                     <div class="modal-footer">
160                                                         <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
161                                                     </div>
162                                                 </div>
163                                             [% END %]
164                                         </td>
165                                     </tr>
166                                 [% END %][%# FOREACH basket IN supplier.loop_basket %]
167                             </tbody>
168                         </table>
169
170                     [% ELSE %]
171                         <p>No pending baskets</p>
172                     [% END %][%# IF ( supplier.loop_basket.size ) %]
173                 </div>
174             </div>
175         [% END %][%# FOREACH supplier IN loop_suppliers %]
176     </div>
177 [% END %][%# IF ( loop_suppliers.size ) %]
178 </div>
179 </div>
180 <div class="yui-b">
181 [% IF ( booksellerid ) %]
182 [% INCLUDE 'vendor-menu.inc' %]
183 [% END %]
184 [% INCLUDE 'acquisitions-menu.inc' %]
185 </div>
186 </div>
187 [% INCLUDE 'intranet-bottom.inc' %]