Bug 29602: Surround strings with span tag
[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>Search for vendor [% supplier | html %] &rsaquo; Koha</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>Item count</th>
103                                     <th>Bibliographic record count</th>
104                                     <th>Items expected</th>
105                                     <th>[% tp('basket created by', 'Created by') | html %]</th>
106                                     <th>Date</th>
107                                     <th>Basket group</th>
108                                     <th>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 data-order="[% basket.total_items | html %]">
122                                             [% basket.total_items | html %]
123                                             [% IF basket.total_items_cancelled %]
124                                                 ([% basket.total_items_cancelled | html %] cancelled)
125                                             [% END %]
126                                         </td>
127                                         <td data-order="[% basket.total_biblios | html %]">
128                                             [% basket.total_biblios | html %]
129                                             [% IF basket.total_biblios_cancelled %]
130                                                 ([% basket.total_biblios_cancelled | html %] cancelled)
131                                             [% END %]
132                                         </td>
133                                         <td>[% basket.expected_items | html %]</td>
134                                         <td>
135                                             [% IF basket.authorisedby %]
136                                                 [% basket.authorisedby.firstname | html %]
137                                                 [% basket.authorisedby.surname | html %]
138                                             [% END %]
139                                         </td>
140                                         <td data-order="[% basket.creationdate | html %]">[% basket.creationdate | $KohaDates %]</td>
141                                         <td>
142                                           [% IF basket.basketgroup %]
143                                             [% basketgroup = basket.basketgroup %]
144                                             [% IF basketgroup.closed %]
145                                               [% basketgroup.name | html %] <span>(closed)</span>
146                                             [% ELSE %]
147                                               <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&amp;booksellerid=[% basket.booksellerid | uri %]&amp;basketgroupid=[% basketgroup.id | uri %]">[% basketgroup.name | html %]</a>
148                                             [% END %]
149                                           [% END %]
150                                         </td>
151                                         <td data-order="[% basket.closedate | html %]">
152                                             [% basket.closedate | $KohaDates %]
153                                         </td>
154                                         <td class="actions">
155                                         [% IF not basket.closedate and supplier.active %]
156                                             [% IF basket.uncertainprices OR ( basket.total_items && !basket.is_standing ) %]
157                                             <div class="dropup">
158                                                 <div class="btn-group">
159                                                 [%# There should be no space between these two buttons, it would render badly %]
160                                                     <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>
161                                                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="basketactions[% basketn.basketno | html %]">
162                                                         [% IF basket.uncertainprices %]
163                                                         <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>
164                                                         [% ELSIF basket.total_items && !basket.is_standing %]
165                                                         <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>
166                                                         [% END %]
167                                                     </ul>
168                                                 </div>
169                                             </div>
170                                             [% ELSE %]
171                                                 <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>
172                                             [% END %]
173                                             <!-- Modal -->
174                                             <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 %]">
175                                                 <div class="modal-dialog" role="document">
176                                                     <div class="modal-content">
177                                                         <div class="modal-header">
178                                                             <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
179                                                             <h4 class="modal-title" id="addtoBasketLabel[% basket.basketno | html %]">Add order to basket</h4>
180                                                         </div>
181                                                         <div class="modal-body">
182                                                             [% INCLUDE 'acquisitions-add-to-basket.inc' booksellerid=supplier.booksellerid basketno=basket.basketno %]
183                                                         </div>
184                                                         <div class="modal-footer">
185                                                             <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
186                                                         </div>
187                                                     </div><!-- /.modal-content -->
188                                                 </div><!-- /.modal-dialog -->
189                                             </div><!-- /.modal -->
190                                         [% END %]
191                                         </td>
192                                     </tr>
193                                 [% END %][%# FOREACH basket IN supplier.loop_basket %]
194                             </tbody>
195                         </table>
196
197                     [% ELSE %]
198                         <p>No pending baskets</p>
199                     [% END %][%# IF ( supplier.loop_basket.size ) %]
200                 </div>
201             </div>
202         [% END %][%# FOREACH supplier IN loop_suppliers %]
203     </div>
204 [% END %][%# IF ( loop_suppliers.size ) %]
205 </main>
206 </div> <!-- /.col-sm-10.col-sm-push-2 -->
207     <div class="col-sm-2 col-sm-pull-10">
208         <aside>
209             [% IF ( booksellerid ) %]
210                 [% INCLUDE 'vendor-menu.inc' %]
211             [% END %]
212             [% INCLUDE 'acquisitions-menu.inc' %]
213         </aside>
214     </div>
215 </div> <!-- /.row -->
216
217 [% MACRO jsinclude BLOCK %]
218     [% Asset.js("js/acquisitions-menu.js") | $raw %]
219     [% INCLUDE 'datatables.inc' %]
220     [% Asset.js("js/acq.js") | $raw %]
221     <script>
222         $(document).ready(function() {
223             $("table.baskets").dataTable($.extend(true, {}, dataTablesDefaults, {
224                 'sDom': 't',
225                 'bPaginate': false,
226                 'bFilter': false,
227                 'bInfo': false,
228                 "aaSorting": [[ 1, "asc" ]],
229                 "aoColumnDefs": [
230                     { 'aTargets': [-1], 'bSortable': false }
231                 ]
232             }));
233             $("#supplierlist").change(function() {
234                 var id = $(this).find("option:selected").val();
235                 window.location.href = "#" + id;
236             });
237             $(".modal").on("shown.bs.modal", function(){
238                 var basket = $(this).data("basketno");
239                 var legend = _("Add order to basket %s").format(basket);
240                 $(this).find("h4").text( legend );
241                 $(this).find("legend").html(legend);
242                 $(this).find("input:text").focus();
243             });
244             $("#show_all_vendors").hide();
245             $("#show_active_vendors").on('click', function(e){
246                 e.preventDefault();
247                 $(".inactive").hide();
248                 $("#show_active_vendors").hide();
249                 $("#show_all_vendors").show();
250             });
251             $("#show_all_vendors").on('click', function(e){
252                 e.preventDefault();
253                 $(".inactive").show();
254                 $("#show_all_vendors").hide();
255                 $("#show_active_vendors").show();
256             });
257         });
258     </script>
259 [% END %]
260
261 [% INCLUDE 'intranet-bottom.inc' %]