Bug 4969: Do not jump to the top on click
[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="[% interface %]/[% theme %]/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         "aoColumnDefs": [
22             { "sType": "title-string", "aTargets" : [ "title-string" ] },
23             { "sType": "title-numeric", "aTargets" : [ "title-numeric" ] },
24             { 'aTargets': [-1], 'bSortable': false }
25         ]
26     }));
27     $("#supplierlist").change(function() {
28         var id = $(this).find("option:selected").val();
29         window.location.href = "#" + id;
30     });
31     $(".modal").on("show", function(){
32         var basket = $(this).data("basketno");
33         var legend = _("Add order to basket %s").format(basket);
34         $(this).find("legend").html(legend);
35     });
36     $("#show_all_vendors").hide();
37     $("#show_active_vendors").on('click', function(e){
38         e.preventDefault();
39         $(".inactive").hide();
40         $("#show_active_vendors").hide();
41         $("#show_all_vendors").show();
42     });
43     $("#show_all_vendors").on('click', function(e){
44         e.preventDefault();
45         $(".inactive").show();
46         $("#show_all_vendors").hide();
47         $("#show_active_vendors").show();
48     });
49 });
50 //]]>
51 </script>
52
53 </head>
54 <body id="acq_booksellers" class="acq">
55 [% INCLUDE 'header.inc' %]
56 [% INCLUDE 'acquisitions-search.inc' %]
57
58 <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>
59
60 <div id="doc3" class="yui-t2">
61    
62     <div id="bd">
63     <div id="yui-main">
64     <div class="yui-b">
65     
66 [% INCLUDE 'acquisitions-toolbar.inc' %]
67 [% UNLESS ( count == 1 ) %]
68     [% UNLESS count %]
69         <h1>Your search returned no results.</h1>
70     [% ELSIF ( supplier.length < 1 ) %]
71         <h1>Vendor search: [% count %] results found</h1>
72     [% ELSE %]
73         <h1>Vendor search: [% count %] results found for '[% supplier %]'</h1>
74     [% END %]
75 [% END %]
76 [% IF ( loop_suppliers.size ) %]
77     [% UNLESS (count == 1) %]
78         <p>Choose a vendor in the list to jump directly to the right place.
79         <select id="supplierlist">
80             [% FOREACH supplier1 IN loop_suppliers %]
81                 <option value="[% supplier1.booksellerid %]">[% supplier1.name %]</option>
82             [% END %]
83         </select>
84         </p>
85     [% END %]
86     [% IF ( allbaskets ) %]
87         <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&amp;booksellerid=[% booksellerid %]">Show active baskets only</a>
88     [% ELSE %]
89         <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&amp;booksellerid=[% booksellerid %]&amp;allbaskets=1">Show all baskets</a>
90     [% END %]
91     | <a href="#" id="show_active_vendors">Show active vendors only</a><a href="#" id="show_all_vendors">Show all vendors</a>
92     <div id="acqui_order_supplierlist">
93         [% FOREACH supplier IN loop_suppliers %]
94             [% IF ( supplier.active ) %]
95                 <div class="supplier">
96             [% ELSE %]
97                 <div class="supplier inactive">
98             [% END %]
99                 <span class="suppliername">
100                     [% IF (supplier.name) %]
101                         <a name="[% supplier.booksellerid %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid %]">[% supplier.name %]</a>
102                     [% ELSE %]
103                         <a name="[% supplier.booksellerid %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid %]">NO NAME</a>
104                     [% END %]
105                 </span>
106                 <span class="action">
107                     [% IF ( CAN_user_acquisition_order_manage ) %]
108                         [% IF ( supplier.active ) %]
109                             <a class="btn btn-default btn-sm" href="/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% supplier.booksellerid %]&amp;op=add_form"><i class="fa fa-plus"></i> New basket</a>
110                         [% ELSE %]
111                             (inactive)
112                         [% END %]
113                     [% END %]
114                         [% IF ( supplier.loop_basket.size ) %]
115                     <a class="btn btn-default btn-sm" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% supplier.booksellerid %]"><i class="fa fa-inbox"></i> Receive shipment</a>
116                         [% END %]
117                 </span>
118                 <div class="baskets">
119                     [% IF ( supplier.loop_basket.size ) %]
120                         <table class="baskets">
121                             <thead>
122                                 <tr>
123                                     <th>No.</th>
124                                     <th>Name</th>
125                                     <th class="title-numeric">Item count</th>
126                                     <th class="title-numeric">Biblio count</th>
127                                     <th>Items expected</th>
128                                     <th>Created by</th>
129                                     <th class="title-string">Date</th>
130                                     <th>Basket group</th>
131                                     <th class="title-string">Closed</th>
132                                     <th>Actions</th>
133                                 </tr>
134                             </thead>
135                             <tbody>
136                                 [% FOREACH basket IN supplier.loop_basket %]
137                                     [% IF ( basket.uncertainprices ) %]
138                                         <tr class="problem">
139                                     [% ELSE %]
140                                         <tr>
141                                     [% END %]
142                                         <td>[% basket.basketno %]</td>
143                                         <td>[% basket.basketname %]</td>
144                                         <td>
145                                             <span title="[% basket.total_items %]">[% basket.total_items %]
146                                                 [% IF basket.total_items_cancelled %]
147                                                     ([% basket.total_items_cancelled %] cancelled)
148                                                 [% END %]
149                                             </span>
150                                         </td>
151                                         <td>
152                                             <span title="[% basket.total_biblios %]">[% basket.total_biblios %]
153                                                 [% IF basket.total_biblios_cancelled %]
154                                                     ([% basket.total_biblios_cancelled %] cancelled)
155                                                 [% END %]
156                                             </span>
157                                         </td>
158                                         <td>[% basket.expected_items %]</td>
159                                         <td>
160                                             [% basket.authorisedby_firstname %]
161                                             [% basket.authorisedby_surname %]
162                                         </td>
163                                         <td><span title="[% basket.creationdate %]">[% basket.creationdate | $KohaDates %]</span></td>
164                                         <td>
165                                           [% IF basket.basketgroup %]
166                                             [% basketgroup = basket.basketgroup %]
167                                             [% IF basketgroup.closed %]
168                                               [% basketgroup.name %] (closed)
169                                             [% ELSE %]
170                                               <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&amp;booksellerid=[% basket.booksellerid %]&amp;basketgroupid=[% basketgroup.id %]">[% basketgroup.name %]</a>
171                                             [% END %]
172                                           [% END %]
173                                         </td>
174                                         <td>
175                                             [% IF ( basket.closedate ) %]
176                                                 <span title="[% basket.closedate %]">[% basket.closedate | $KohaDates %]</span>
177                                             [% ELSE %]
178                                                 <span title="9999-99-99"></span>
179                                             [% END %]
180                                         </td>
181                                         <td class="actions">
182                                             <a class="btn btn-default btn-xs" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]"><i class="fa fa-eye"></i> View</a>
183
184                                             [% IF not basket.closedate and supplier.active %]
185                                                 <a class="btn btn-default btn-xs" id="addtoBasketLabel[% basket.basketno %]" href="#addtoBasket[% basket.basketno %]" role="button" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a>
186                                                 <!-- Modal -->
187                                                 <div id="addtoBasket[% basket.basketno %]" class="modal" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel[% basket.basketno %]" aria-hidden="true" data-basketno="[% basket.basketname %]">
188                                                     <div class="modal-dialog">
189                                                     <div class="modal-content">
190                                                     <div class="modal-body">
191                                                         [% INCLUDE 'acquisitions-add-to-basket.inc' booksellerid=supplier.booksellerid basketno=basket.basketno %]
192                                                     </div>
193                                                     <div class="modal-footer">
194                                                         <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
195                                                     </div>
196                                                     </div>
197                                                     </div>
198                                                 </div>
199                                             [% END %]
200                                         </td>
201                                     </tr>
202                                 [% END %][%# FOREACH basket IN supplier.loop_basket %]
203                             </tbody>
204                         </table>
205
206                     [% ELSE %]
207                         <p>No pending baskets</p>
208                     [% END %][%# IF ( supplier.loop_basket.size ) %]
209                 </div>
210             </div>
211         [% END %][%# FOREACH supplier IN loop_suppliers %]
212     </div>
213 [% END %][%# IF ( loop_suppliers.size ) %]
214 </div>
215 </div>
216 <div class="yui-b">
217 [% IF ( booksellerid ) %]
218 [% INCLUDE 'vendor-menu.inc' %]
219 [% END %]
220 [% INCLUDE 'acquisitions-menu.inc' %]
221 </div>
222 </div>
223 [% INCLUDE 'intranet-bottom.inc' %]