Bug 24648: Contextualization of past tense 'Created'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / booksellers.tt
1 [% PROCESS 'i18n.inc' %]
2 [% USE raw %]
3 [% USE Asset %]
4 [% USE KohaDates %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha &rsaquo; Search for vendor [% supplier | html %]</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 <style>
10 #vendors td{
11         vertical-align: top;
12 }
13 </style>
14 </head>
15
16 <body id="acq_booksellers" class="acq">
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'acquisitions-search.inc' %]
19
20 <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 | html %]</em> </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 [% INCLUDE 'acquisitions-toolbar.inc' %]
28 [% UNLESS ( count == 1 ) %]
29     [% UNLESS count %]
30         <h1>Your search returned no results.</h1>
31     [% ELSIF ( supplier.length < 1 ) %]
32         <h1>Vendor search: [% count | html %] results found</h1>
33     [% ELSE %]
34         <h1>Vendor search: [% count | html %] results found for '[% supplier | html %]'</h1>
35     [% END %]
36 [% END %]
37 [% IF ( loop_suppliers.size ) %]
38     [% UNLESS (count == 1) %]
39         <p>Choose a vendor in the list to jump directly to the right place.
40         <select id="supplierlist">
41             [% FOREACH supplier1 IN loop_suppliers %]
42                 <option value="[% supplier1.booksellerid | html %]">[% supplier1.name | html %]</option>
43             [% END %]
44         </select>
45         </p>
46     [% END %]
47     [% IF ( allbaskets ) %]
48         <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier | uri %]&amp;booksellerid=[% booksellerid | uri %]">Show active baskets only</a>
49     [% ELSE %]
50         <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;allbaskets=1">Show all baskets</a>
51     [% END %]
52     [% UNLESS booksellerid %]
53         | <a href="#" id="show_active_vendors">Show active vendors only</a><a href="#" id="show_all_vendors">Show all vendors</a>
54     [% END %]
55     <div id="acqui_order_supplierlist">
56         [% FOREACH supplier IN loop_suppliers %]
57             [% IF ( supplier.active ) %]
58                 <div class="supplier">
59             [% ELSE %]
60                 <div class="supplier inactive">
61             [% END %]
62                 <span class="suppliername">
63                     [% IF (supplier.name) %]
64                         <a name="[% supplier.booksellerid | html %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid | uri %]">[% supplier.name | html %]</a>
65                     [% ELSE %]
66                         <a name="[% supplier.booksellerid | html %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid | uri %]">NO NAME</a>
67                     [% END %]
68                 </span>
69                 <span class="action">
70                     [% IF ( CAN_user_acquisition_order_manage ) %]
71                         [% IF ( supplier.active ) %]
72                             <a class="btn btn-default btn-sm" href="/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% supplier.booksellerid | uri %]&amp;op=add_form"><i class="fa fa-plus"></i> New basket</a>
73                         [% ELSE %]
74                             (inactive)
75                         [% END %]
76                     [% END %]
77                         [% IF ( supplier.loop_basket.size ) %]
78                     <a class="btn btn-default btn-sm" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% supplier.booksellerid | uri %]"><i class="fa fa-inbox"></i> Receive shipment</a>
79                         [% END %]
80                 </span>
81                 <div class="baskets">
82                     [% IF ( supplier.loop_basket.size ) %]
83                         <table class="baskets">
84                             <thead>
85                                 <tr>
86                                     <th>No.</th>
87                                     <th>Name</th>
88                                     <th class="title-numeric">Item count</th>
89                                     <th class="title-numeric">Bibliographic record count</th>
90                                     <th>Items expected</th>
91                                     <th>[% tp('basket created by', 'Created by') | html %]</th>
92                                     <th class="title-string">Date</th>
93                                     <th>Basket group</th>
94                                     <th class="title-string">Closed</th>
95                                     <th>Actions</th>
96                                 </tr>
97                             </thead>
98                             <tbody>
99                                 [% FOREACH basket IN supplier.loop_basket %]
100                                     [% IF ( basket.uncertainprices ) %]
101                                         <tr class="problem">
102                                     [% ELSE %]
103                                         <tr>
104                                     [% END %]
105                                         <td>[% basket.basketno | html %]</td>
106                                         <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">[% basket.basketname | html %]</a></td>
107                                         <td>
108                                             <span title="[% basket.total_items | html %]">[% basket.total_items | html %]
109                                                 [% IF basket.total_items_cancelled %]
110                                                     ([% basket.total_items_cancelled | html %] cancelled)
111                                                 [% END %]
112                                             </span>
113                                         </td>
114                                         <td>
115                                             <span title="[% basket.total_biblios | html %]">[% basket.total_biblios | html %]
116                                                 [% IF basket.total_biblios_cancelled %]
117                                                     ([% basket.total_biblios_cancelled | html %] cancelled)
118                                                 [% END %]
119                                             </span>
120                                         </td>
121                                         <td>[% basket.expected_items | html %]</td>
122                                         <td>
123                                             [% IF basket.authorisedby %]
124                                                 [% basket.authorisedby.firstname | html %]
125                                                 [% basket.authorisedby.surname | html %]
126                                             [% END %]
127                                         </td>
128                                         <td><span title="[% basket.creationdate | html %]">[% basket.creationdate | $KohaDates %]</span></td>
129                                         <td>
130                                           [% IF basket.basketgroup %]
131                                             [% basketgroup = basket.basketgroup %]
132                                             [% IF basketgroup.closed %]
133                                               [% basketgroup.name | html %] (closed)
134                                             [% ELSE %]
135                                               <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&amp;booksellerid=[% basket.booksellerid | uri %]&amp;basketgroupid=[% basketgroup.id | uri %]">[% basketgroup.name | html %]</a>
136                                             [% END %]
137                                           [% END %]
138                                         </td>
139                                         <td>
140                                             [% IF ( basket.closedate ) %]
141                                                 <span title="[% basket.closedate | html %]">[% basket.closedate | $KohaDates %]</span>
142                                             [% ELSE %]
143                                                 <span title="9999-99-99"></span>
144                                             [% END %]
145                                         </td>
146                                         <td class="actions">
147                                         [% IF not basket.closedate and supplier.active %]
148                                             [% IF basket.uncertainprices OR ( basket.total_items && !basket.is_standing ) %]
149                                             <div class="dropup">
150                                                 <div class="btn-group">
151                                                 [%# There should be no space between these two buttons, it would render badly %]
152                                                     <a class="btn btn-default btn-xs" id="addtoBasketLabel[% basket.basketno | html %]" href="#addtoBasket[% basket.basketno | html %]" role="button" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a><a class="btn btn-default btn-xs dropdown-toggle" id="basketactions[% basket.basknetno | html %]" role="button" data-toggle="dropdown" href="#"><b class="caret"></b></a>
153                                                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="basketactions[% basketn.basketno | html %]">
154                                                         [% IF basket.uncertainprices %]
155                                                         <li><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% basket.booksellerid | uri %]&owner=1"><i class="fa fa-usd"></i> Uncertain prices</a></li>
156                                                         [% ELSIF basket.total_items && !basket.is_standing %]
157                                                         <li><a href="/cgi-bin/koha/acqui/basket.pl?op=close&basketno=[% basket.basketno | uri %]&booksellerid=[% basket.booksellerid | uri %]"><i class="fa fa-times-circle"></i> Close this basket</a></li>
158                                                         [% END %]
159                                                     </ul>
160                                                 </div>
161                                             </div>
162                                             [% ELSE %]
163                                                 <a class="btn btn-default btn-xs" id="addtoBasketLabel[% basket.basketno | html %]" href="#addtoBasket[% basket.basketno | html %]" role="button" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a>
164                                             [% END %]
165                                             <!-- Modal -->
166                                             <div id="addtoBasket[% basket.basketno | html %]" class="modal" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel[% basket.basketno | html %]" aria-hidden="true" data-basketno="[% basket.basketname | html %]">
167                                                 <div class="modal-dialog">
168                                                     <div class="modal-content">
169                                                         <div class="modal-body">
170                                                             [% INCLUDE 'acquisitions-add-to-basket.inc' booksellerid=supplier.booksellerid basketno=basket.basketno %]
171                                                         </div>
172                                                         <div class="modal-footer">
173                                                             <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
174                                                         </div>
175                                                     </div>
176                                                 </div>
177                                             </div>
178                                         [% END %]
179                                         </td>
180                                     </tr>
181                                 [% END %][%# FOREACH basket IN supplier.loop_basket %]
182                             </tbody>
183                         </table>
184
185                     [% ELSE %]
186                         <p>No pending baskets</p>
187                     [% END %][%# IF ( supplier.loop_basket.size ) %]
188                 </div>
189             </div>
190         [% END %][%# FOREACH supplier IN loop_suppliers %]
191     </div>
192 [% END %][%# IF ( loop_suppliers.size ) %]
193 </main>
194 </div> <!-- /.col-sm-10.col-sm-push-2 -->
195     <div class="col-sm-2 col-sm-pull-10">
196         <aside>
197             [% IF ( booksellerid ) %]
198                 [% INCLUDE 'vendor-menu.inc' %]
199             [% END %]
200             [% INCLUDE 'acquisitions-menu.inc' %]
201         </aside>
202     </div>
203 </div> <!-- /.row -->
204
205 [% MACRO jsinclude BLOCK %]
206     [% Asset.js("js/acquisitions-menu.js") | $raw %]
207     [% INCLUDE 'datatables.inc' %]
208     [% Asset.js("js/acq.js") | $raw %]
209     <script>
210         $(document).ready(function() {
211             $("table.baskets").dataTable($.extend(true, {}, dataTablesDefaults, {
212                 'sDom': 't',
213                 'bPaginate': false,
214                 'bFilter': false,
215                 'bInfo': false,
216                 "aaSorting": [[ 1, "asc" ]],
217                 "aoColumnDefs": [
218                     { "sType": "title-string", "aTargets" : [ "title-string" ] },
219                     { "sType": "title-numeric", "aTargets" : [ "title-numeric" ] },
220                     { 'aTargets': [-1], 'bSortable': false }
221                 ]
222             }));
223             $("#supplierlist").change(function() {
224                 var id = $(this).find("option:selected").val();
225                 window.location.href = "#" + id;
226             });
227             $(".modal").on("show", function(){
228                 var basket = $(this).data("basketno");
229                 var legend = _("Add order to basket %s").format(basket);
230                 $(this).find("legend").html(legend);
231             });
232             $("#show_all_vendors").hide();
233             $("#show_active_vendors").on('click', function(e){
234                 e.preventDefault();
235                 $(".inactive").hide();
236                 $("#show_active_vendors").hide();
237                 $("#show_all_vendors").show();
238             });
239             $("#show_all_vendors").on('click', function(e){
240                 e.preventDefault();
241                 $(".inactive").show();
242                 $("#show_all_vendors").hide();
243                 $("#show_active_vendors").show();
244             });
245         });
246     </script>
247 [% END %]
248
249 [% INCLUDE 'intranet-bottom.inc' %]