Bug 27846: (follow-up) Add id back to breadcrumbs container
[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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
21     <ol>
22         <li>
23             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
24         </li>
25         <li>
26             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
27         </li>
28         <li>
29             <a href="#" aria-current="page">
30                 Search for vendor <em>[% supplier | html %]</em>
31             </a>
32         </li>
33     </ol>
34 </nav>
35
36 <div class="main container-fluid">
37     <div class="row">
38         <div class="col-sm-10 col-sm-push-2">
39             <main>
40
41 [% INCLUDE 'acquisitions-toolbar.inc' %]
42 [% UNLESS ( count == 1 ) %]
43     [% UNLESS count %]
44         <h1>Your search returned no results.</h1>
45     [% ELSIF ( supplier.length < 1 ) %]
46         <h1>Vendor search: [% count | html %] results found</h1>
47     [% ELSE %]
48         <h1>Vendor search: [% count | html %] results found for '[% supplier | html %]'</h1>
49     [% END %]
50 [% END %]
51 [% IF ( loop_suppliers.size ) %]
52     [% UNLESS (count == 1) %]
53         <p>Choose a vendor in the list to jump directly to the right place.
54         <select id="supplierlist">
55             [% FOREACH supplier1 IN loop_suppliers %]
56                 <option value="[% supplier1.booksellerid | html %]">[% supplier1.name | html %]</option>
57             [% END %]
58         </select>
59         </p>
60     [% END %]
61     [% IF ( allbaskets ) %]
62         <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier | uri %]&amp;booksellerid=[% booksellerid | uri %]">Show active baskets only</a>
63     [% ELSE %]
64         <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;allbaskets=1">Show all baskets</a>
65     [% END %]
66     [% UNLESS booksellerid %]
67         | <a href="#" id="show_active_vendors">Show active vendors only</a><a href="#" id="show_all_vendors">Show all vendors</a>
68     [% END %]
69     <div id="acqui_order_supplierlist">
70         [% FOREACH supplier IN loop_suppliers %]
71             [% IF ( supplier.active ) %]
72                 <div class="supplier">
73             [% ELSE %]
74                 <div class="supplier inactive">
75             [% END %]
76                 <span class="suppliername">
77                     [% IF (supplier.name) %]
78                         <a name="[% supplier.booksellerid | html %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid | uri %]">[% supplier.name | html %]</a>
79                     [% ELSE %]
80                         <a name="[% supplier.booksellerid | html %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid | uri %]">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-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>
87                         [% ELSE %]
88                             (inactive)
89                         [% END %]
90                     [% END %]
91                         [% IF ( supplier.loop_basket.size ) %]
92                     <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>
93                         [% END %]
94                 </span>
95                 <div class="baskets">
96                     [% IF ( supplier.loop_basket.size ) %]
97                         <table class="baskets">
98                             <thead>
99                                 <tr>
100                                     <th>No.</th>
101                                     <th>Name</th>
102                                     <th class="title-numeric">Item count</th>
103                                     <th class="title-numeric">Bibliographic record count</th>
104                                     <th>Items expected</th>
105                                     <th>[% tp('basket created by', 'Created by') | html %]</th>
106                                     <th class="title-string">Date</th>
107                                     <th>Basket group</th>
108                                     <th class="title-string">Closed</th>
109                                     <th class="noExport">Actions</th>
110                                 </tr>
111                             </thead>
112                             <tbody>
113                                 [% FOREACH basket IN supplier.loop_basket %]
114                                     [% IF ( basket.uncertainprices ) %]
115                                         <tr class="problem">
116                                     [% ELSE %]
117                                         <tr>
118                                     [% END %]
119                                         <td>[% basket.basketno | html %]</td>
120                                         <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">[% basket.basketname | html %]</a></td>
121                                         <td>
122                                             <span title="[% basket.total_items | html %]">[% basket.total_items | html %]
123                                                 [% IF basket.total_items_cancelled %]
124                                                     ([% basket.total_items_cancelled | html %] cancelled)
125                                                 [% END %]
126                                             </span>
127                                         </td>
128                                         <td>
129                                             <span title="[% basket.total_biblios | html %]">[% basket.total_biblios | html %]
130                                                 [% IF basket.total_biblios_cancelled %]
131                                                     ([% basket.total_biblios_cancelled | html %] cancelled)
132                                                 [% END %]
133                                             </span>
134                                         </td>
135                                         <td>[% basket.expected_items | html %]</td>
136                                         <td>
137                                             [% IF basket.authorisedby %]
138                                                 [% basket.authorisedby.firstname | html %]
139                                                 [% basket.authorisedby.surname | html %]
140                                             [% END %]
141                                         </td>
142                                         <td><span title="[% basket.creationdate | html %]">[% basket.creationdate | $KohaDates %]</span></td>
143                                         <td>
144                                           [% IF basket.basketgroup %]
145                                             [% basketgroup = basket.basketgroup %]
146                                             [% IF basketgroup.closed %]
147                                               [% basketgroup.name | html %] (closed)
148                                             [% ELSE %]
149                                               <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&amp;booksellerid=[% basket.booksellerid | uri %]&amp;basketgroupid=[% basketgroup.id | uri %]">[% basketgroup.name | html %]</a>
150                                             [% END %]
151                                           [% END %]
152                                         </td>
153                                         <td>
154                                             [% IF ( basket.closedate ) %]
155                                                 <span title="[% basket.closedate | html %]">[% basket.closedate | $KohaDates %]</span>
156                                             [% ELSE %]
157                                                 <span title="9999-99-99"></span>
158                                             [% END %]
159                                         </td>
160                                         <td class="actions">
161                                         [% IF not basket.closedate and supplier.active %]
162                                             [% IF basket.uncertainprices OR ( basket.total_items && !basket.is_standing ) %]
163                                             <div class="dropup">
164                                                 <div class="btn-group">
165                                                 [%# There should be no space between these two buttons, it would render badly %]
166                                                     <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>
167                                                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="basketactions[% basketn.basketno | html %]">
168                                                         [% IF basket.uncertainprices %]
169                                                         <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>
170                                                         [% ELSIF basket.total_items && !basket.is_standing %]
171                                                         <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>
172                                                         [% END %]
173                                                     </ul>
174                                                 </div>
175                                             </div>
176                                             [% ELSE %]
177                                                 <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>
178                                             [% END %]
179                                             <!-- Modal -->
180                                             <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 %]">
181                                                 <div class="modal-dialog">
182                                                     <div class="modal-content">
183                                                         <div class="modal-body">
184                                                             [% INCLUDE 'acquisitions-add-to-basket.inc' booksellerid=supplier.booksellerid basketno=basket.basketno %]
185                                                         </div>
186                                                         <div class="modal-footer">
187                                                             <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
188                                                         </div>
189                                                     </div>
190                                                 </div>
191                                             </div>
192                                         [% END %]
193                                         </td>
194                                     </tr>
195                                 [% END %][%# FOREACH basket IN supplier.loop_basket %]
196                             </tbody>
197                         </table>
198
199                     [% ELSE %]
200                         <p>No pending baskets</p>
201                     [% END %][%# IF ( supplier.loop_basket.size ) %]
202                 </div>
203             </div>
204         [% END %][%# FOREACH supplier IN loop_suppliers %]
205     </div>
206 [% END %][%# IF ( loop_suppliers.size ) %]
207 </main>
208 </div> <!-- /.col-sm-10.col-sm-push-2 -->
209     <div class="col-sm-2 col-sm-pull-10">
210         <aside>
211             [% IF ( booksellerid ) %]
212                 [% INCLUDE 'vendor-menu.inc' %]
213             [% END %]
214             [% INCLUDE 'acquisitions-menu.inc' %]
215         </aside>
216     </div>
217 </div> <!-- /.row -->
218
219 [% MACRO jsinclude BLOCK %]
220     [% Asset.js("js/acquisitions-menu.js") | $raw %]
221     [% INCLUDE 'datatables.inc' %]
222     [% Asset.js("js/acq.js") | $raw %]
223     <script>
224         $(document).ready(function() {
225             $("table.baskets").dataTable($.extend(true, {}, dataTablesDefaults, {
226                 'sDom': 't',
227                 'bPaginate': false,
228                 'bFilter': false,
229                 'bInfo': false,
230                 "aaSorting": [[ 1, "asc" ]],
231                 "aoColumnDefs": [
232                     { "sType": "title-string", "aTargets" : [ "title-string" ] },
233                     { "sType": "title-numeric", "aTargets" : [ "title-numeric" ] },
234                     { 'aTargets': [-1], 'bSortable': false }
235                 ]
236             }));
237             $("#supplierlist").change(function() {
238                 var id = $(this).find("option:selected").val();
239                 window.location.href = "#" + id;
240             });
241             $(".modal").on("show", function(){
242                 var basket = $(this).data("basketno");
243                 var legend = _("Add order to basket %s").format(basket);
244                 $(this).find("legend").html(legend);
245             });
246             $("#show_all_vendors").hide();
247             $("#show_active_vendors").on('click', function(e){
248                 e.preventDefault();
249                 $(".inactive").hide();
250                 $("#show_active_vendors").hide();
251                 $("#show_all_vendors").show();
252             });
253             $("#show_all_vendors").on('click', function(e){
254                 e.preventDefault();
255                 $(".inactive").show();
256                 $("#show_all_vendors").hide();
257                 $("#show_active_vendors").show();
258             });
259         });
260     </script>
261 [% END %]
262
263 [% INCLUDE 'intranet-bottom.inc' %]