+[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Search for vendor [% supplier %]</title>
[% INCLUDE 'doc-head-close.inc' %]
vertical-align: top;
}
</style>
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<link rel="stylesheet" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
//<![CDATA[
- $(document).ready(function() {
- $("#vendorst").tablesorter({
- headers: {
- 3: {
- sorter: false
- }
- }
- });
- });
- //]]>
+$(document).ready(function() {
+ $("table.baskets").dataTable($.extend(true, {}, dataTablesDefaults, {
+ 'sDom': 't',
+ 'bPaginate': false,
+ 'bFilter': false,
+ 'bInfo': false,
+ "aaSorting": [[ 1, "asc" ]],
+ "aoColumns": [
+ null,null,null,null,null,null,{ "sType": "title-string" },{ "sType": "title-string" },null
+ ],
+ 'aoColumnDefs': [
+ { 'aTargets': [-1], 'bSortable': false }
+ ]
+ }));
+ $("#supplierlist").change(function() {
+ var id = $(this).find("option:selected").val();
+ window.location.href = "#" + id;
+ });
+ $(".modal").on("show", function(){
+ var basket = $(this).data("basketno");
+ var legend = _("Add order to basket") + " " + basket;
+ $(this).find("legend").html(legend);
+ });
+});
+//]]>
</script>
</head>
-<body>
+<body id="acq_booksellers" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › Search for Vendor <em>[% supplier %]</em> </div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › Search for vendor <em>[% supplier %]</em> </div>
<div id="doc3" class="yui-t2">
<div class="yui-b">
[% INCLUDE 'acquisitions-toolbar.inc' %]
-[% IF ( count == 1 ) %]
-<h1> [% supplier_name %] </h1>
-[% ELSE %]
+[% UNLESS ( count == 1 ) %]
<h1>You searched on <b>vendor [% supplier %],</b> [% count %] results found</h1>
[% END %]
-[% IF ( loop_suppliers ) %]
+[% IF ( loop_suppliers.size ) %]
+ [% UNLESS (count == 1) %]
+ <p>Choose a vendor in the list to jump directly to the right place.
+ <select id="supplierlist">
+ [% FOREACH supplier1 IN loop_suppliers %]
+ <option value="[% supplier1.booksellerid %]">[% supplier1.name %]</option>
+ [% END %]
+ </select>
+ </p>
+ [% END %]
+ [% IF ( allbaskets ) %]
+ <p><a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&booksellerid=[% booksellerid %]">Show active baskets only</a></p>
+ [% ELSE %]
+ <p><a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&booksellerid=[% booksellerid %]&allbaskets=1">Show all baskets</a></p>
+ [% END %]
<div id="acqui_order_supplierlist">
- <table id="vendorst">
- <thead>
- <tr>
- <th>Order</th>
- <th>Order receive</th>
- <th>Vendor</th>
- <th> </th>
- </tr>
- </thead>
- <tbody>
- [% FOREACH loop_supplier IN loop_suppliers %]
- [% UNLESS ( loop.odd ) %]
- <tr class="highlight">
- [% ELSE %]
- <tr>
- [% END %]
- <td>[% IF ( CAN_user_acquisition_order_manage ) %]
- [% IF ( loop_supplier.active ) %]
- <a href="basketheader.pl?booksellerid=[% loop_supplier.supplierid %]&op=add_form">New basket</a>
+ [% FOREACH supplier IN loop_suppliers %]
+ <div class="supplier">
+ <span class="suppliername">
+ [% IF (supplier.name) %]
+ <a name="[% supplier.booksellerid %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid %]">[% supplier.name %]</a>
[% ELSE %]
- Inactive
+ <a name="[% supplier.booksellerid %]" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% supplier.booksellerid %]">NO NAME</a>
[% END %]
+ </span>
+ <span class="action">
+ [% IF ( CAN_user_acquisition_order_manage ) %]
+ [% IF ( supplier.active ) %]
+ <a class="btn btn-small" href="/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% supplier.booksellerid %]&op=add_form"><i class="icon-plus"></i> New basket</a>
+ [% ELSE %]
+ (inactive)
+ [% END %]
[% END %]
- </td>
- <td> <a href="parcels.pl?supplierid=[% loop_supplier.supplierid %]">Receive shipment</a>
- </td>
- [% IF ( loop_supplier.name ) %]
- <td><a href="supplier.pl?supplierid=[% loop_supplier.supplierid %]">[% loop_supplier.name %]</a></td>
- [% ELSE %]
- <td><a href="supplier.pl?supplierid=[% loop_supplier.supplierid %]">NO NAME</a></td>
- [% END %]
- <td> <table>
- [% IF ( loop_supplier.loop_basket ) %]
- <tr>
- <th>Basket (#)</th>
- <th>Items</th>
- <th>Created by</th>
- <th>Date</th>
- <th> </th>
- </tr>
- [% FOREACH loop_baske IN loop_supplier.loop_basket %]
- [% IF ( loop_baske.uncertainprices ) %]
- <tr class="problem">
- [% ELSE %]
- [% UNLESS ( loop.odd ) %]
- <tr class="highlight">
- [% ELSE %]
+ <a class="btn btn-small" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% supplier.booksellerid %]"><i class="icon-inbox"></i> Receive shipment</a>
+ </span>
+ <div class="baskets">
+ [% IF ( supplier.loop_basket.size ) %]
+ <table class="baskets">
+ <thead>
<tr>
- [% END %]
- [% END %]
- <td>[% loop_baske.basketname %] (#[% loop_baske.basketno %])</td>
- <td>[% loop_baske.total %]</td>
- <td> [% loop_baske.firstname %]
- [% loop_baske.surname %]
- </td>
- <td>[% loop_baske.creationdate %]</td>
- <td> [% IF ( loop_baske.closedate ) %]
- closed on [% loop_baske.closedate %]
- <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_baske.basketno %]">View</a>
- [% ELSE %]
- [% IF ( loop_baske.active ) %]
- <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_baske.basketno %]">modify</a>
+ <th>No.</th>
+ <th>Name</th>
+ <th>Item count</th>
+ <th>Biblio count</th>
+ <th>Items expected</th>
+ <th>Created by</th>
+ <th>Date</th>
+ <th>Closed</th>
+ <th> </th>
+ </tr>
+ </thead>
+ <tbody>
+ [% FOREACH basket IN supplier.loop_basket %]
+ [% IF ( basket.uncertainprices ) %]
+ <tr class="problem">
+ [% ELSE %]
+ <tr>
+ [% END %]
+ <td>[% basket.basketno %]</td>
+ <td>[% basket.basketname %]</td>
+ <td>[% basket.total_items %]</td>
+ <td>[% basket.total_biblios %]</td>
+ <td>[% basket.expected_items %]</td>
+ <td>
+ [% basket.authorisedby_firstname %]
+ [% basket.authorisedby_surname %]
+ </td>
+ <td><span title="[% basket.creationdate %]">[% basket.creationdate | $KohaDates %]</span></td>
+ <td>
+ [% IF ( basket.closedate ) %]
+ <span title="[% basket.closedate %]">[% basket.closedate | $KohaDates %]</span>
[% ELSE %]
- <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_baske.basketno %]">View</a>
+ <span title="9999-99-99"></span>
[% END %]
- [% END %]
- </td>
- </tr>
- [% END %]
- [% ELSE %]
- <tr><td>No pending baskets</td></tr>
- [% END %]
+ </td>
+ <td>
+ <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">View</a>
+
+ [% UNLESS ( basket.closedate ) %]
+ | <a id="addtoBasketLabel[% basket.basketno %]" href="#addtoBasket[% basket.basketno %]" role="button" data-toggle="modal">Add to basket</a>
+ <!-- Modal -->
+ <div id="addtoBasket[% basket.basketno %]" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel[% basket.basketno %]" aria-hidden="true" data-basketno="[% basket.basketname %]">
+ <div class="modal-body">
+ [% INCLUDE 'acquisitions-add-to-basket.inc' booksellerid=supplier.booksellerid basketno=basket.basketno %]
+ </div>
+ <div class="modal-footer">
+ <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
+ </div>
+ </div>
+ [% END %]
+ </td>
+ </tr>
+ [% END %][%# FOREACH basket IN supplier.loop_basket %]
+ </tbody>
</table>
- </td>
- </tr>
- [% END %]
- </tbody>
- </table>
- </div>
- [% END %]
+
+ [% ELSE %]
+ <p>No pending baskets</p>
+ [% END %][%# IF ( supplier.loop_basket.size ) %]
+ </div>
+ </div>
+ [% END %][%# FOREACH supplier IN loop_suppliers %]
+ </div>
+[% END %][%# IF ( loop_suppliers.size ) %]
</div>
</div>
<div class="yui-b">
+[% IF ( booksellerid ) %]
+[% INCLUDE 'vendor-menu.inc' %]
+[% END %]
[% INCLUDE 'acquisitions-menu.inc' %]
</div>
</div>