Koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt
Owen Leonard 56aa775602 Bug 28082: Add acquisitions toolbar to vendors on vendor search page
This patch makes a number of changes to the vendor search/view template
in order to make it work better in different contexts:

- Add a vendor-specific toolbar under each vendor search result. This
  gives instant access to the options for a new basket, new contract,
  vendor edit, or to receive shipments. A delete button will appear if
  available.
- Add a summary of the number of baskets and subscriptions. This helps
  the user know if there are closed baskets and whether an outstanding
  subscription might be blocking the option to delete. Each number is
  linked to the view of those entries.
- Indicate whether a vendor is inactive. The vendor name appears in a
  different color when it is inactve and is labeled as such.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- To test you should have multiple vendors in your system, some active
  and some inactive. Add some baskets and subscriptions to one or more
  if necessary.
- Go to Acquisitions and submit an empty vendor search to show all
  vendors.
- Verify that the page looks correct and that all controls work as
  expected.
- Open the basket view for a single vendor and compare the two views.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-05-10 15:17:17 -10:00

189 lines
7.6 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Koha %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( booksellername ) %]Orders with uncertain prices for vendor [% booksellername | html %][% ELSE %]Orders with uncertain prices[% END %] &rsaquo; Acquisitions &rsaquo; Koha</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="acq_uncertainprice" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
<ol>
<li>
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
</li>
<li>
<a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
</li>
[% IF ( booksellername ) %]
<li>
<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
</li>
<li>
<a href="#" aria-current="page">
Uncertain prices for vendor [% booksellername | html %]
</a>
</li>
[% ELSE %]
<li>
<a href="#" aria-current="page">
Uncertain prices
</a>
</li>
[% END %]
</ol>
</nav>
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
[% INCLUDE 'acquisitions-toolbar.inc' %]
[% IF ( validate ) %]
[% SET metacontent = '0; url=' _ scriptname _ '?booksellerid=' _ booksellerid %]
<META HTTP-EQUIV=Refresh CONTENT="[% metacontent | html %]">
[% ELSE %]
[% IF ( booksellername ) %]
<h1>Orders with uncertain prices for vendor <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a></h1>
<h2>Contact information</h2>
<p><strong>Address: </strong>
[% booksellerpostal | html %]
[% bookselleraddress1 | html %]
[% bookselleraddress2 | html %]
[% bookselleraddress3 | html %]
[% bookselleraddress4 | html %]
</p>
<p><strong>Phone: </strong>
[% booksellerphone | html %] / Fax:
<dl>
[% FOREACH contact IN contacts %]
<dt><strong>Contact: </strong></dt>
<dd>[% contact.name | html %]
[% contact.position | html %]
[% contact.phone | html %]
[% contact.altphone | html %]
[% contact.email | html %]
[% contact.notes | html %]
</dd>
[% END %]
</dl>
[% IF ( booksellernotes ) %]
<p><strong>Notes: </strong>
[% booksellernotes | html %]</p>
[% END %]
[% END %]
<h1>Orders with uncertain prices</h1>
<form action="[% scriptname | html %]" method="post">
<input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
<label for="owner">Orders from:</label>
<select id="owner" name="owner">
[% IF ( owner ) %]
<option value="0">Everyone</option>
<option value="1" selected="selected">me</option>
[% ELSE %]
<option value="0" selected="selected">Everyone</option>
<option value="1">me</option>
[% END %]
</select>
<input type="submit" value="Filter" />
</form>
<form action="[% scriptname | html %]" method="post" id="uncertainprices">
<input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
<input type="hidden" name="op" value="validate" />
<table id="uncertainpricet">
<thead>
<tr>
<th>Basket</th>
<th>[% tp('noun', 'Order') | html %]</th>
<th>By</th>
<th>Uncertain</th>
<th>Price</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
[% FOREACH uncertainpriceorder IN uncertainpriceorders %]
<tr>
<td>
[% uncertainpriceorder.basketname | html %]
</td>
<td>
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% uncertainpriceorder.biblionumber | uri %]">[% uncertainpriceorder.title | html %]</a>
[% IF ( uncertainpriceorder.author ) %] <em>by</em> [% uncertainpriceorder.author | html %][% END %]
[% IF ( uncertainpriceorder.publishercode ) %]
<br /><em>Publisher:</em> [% uncertainpriceorder.publishercode | html %]
[%- IF ( uncertainpriceorder.publicationyear ) -%], [% uncertainpriceorder.publicationyear | html %]
[%- ELSIF ( uncertainpriceorder.copyrightdate ) -%] [% uncertainpriceorder.copyrightdate | html %]
[% END %]
[% END %]
[% IF ( uncertainpriceorder.isbn ) %]<br />[% uncertainpriceorder.isbn | html %][% END %]
<br />
<a href="neworderempty.pl?ordernumber=[% uncertainpriceorder.ordernumber | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% uncertainpriceorder.basketno | uri %]">
Edit
</a>
</td>
<td>
[% uncertainpriceorder.firstname | html %] [% uncertainpriceorder.surname | html %]
</td>
<td>
<input type="checkbox" name="uncertainprice[% uncertainpriceorder.ordernumber | html %]" value="1" checked="checked" />
</td>
<td>
<input class="check_uncertain" data-ordernumber="[% uncertainpriceorder.ordernumber | html %]" type="text" size="10" name="price[% uncertainpriceorder.ordernumber | html %]" value="[% uncertainpriceorder.listprice | html %]" />
</td>
<td>
[% IF basket.effective_create_items == 'ordering' %]
[% uncertainpriceorder.quantity | html %]
<input type="hidden" name="qty[% uncertainpriceorder.ordernumber | html %]" value="[% uncertainpriceorder.quantity | html %]" />
[% ELSE %]
<input class="check_uncertain" data-ordernumber="[% uncertainpriceorder.ordernumber | html %]" type="text" size="10" name="qty[% uncertainpriceorder.ordernumber | html %]" value="[% uncertainpriceorder.quantity | html %]" />
[% END %]
</td>
</tr>
[% END %]
</tbody>
</table>
<fieldset class="action"><input type="submit" value="Save" /></fieldset>
</form>
[% END %]
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'vendor-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/acquisitions-menu.js") | $raw %]
[% Asset.js("js/acq.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
<script>
$(document).ready(function() {
var uncertainpricet = $("#uncertainpricet").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
],
"sPaginationType": "full"
}));
$(".check_uncertain").on("change",function(){
var form = document.getElementById("uncertainprices");
var ordernumber = $(this).data("ordernumber");
uncheckbox( form, ordernumber );
});
});
</script>
[% Asset.js("js/acq.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]