Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt
Aleisha f3011690fc Bug 16939: Making all 'add to basket' actions buttons
Edit: Fixing 'clas' typo in addorderiso2709.tt
Edit: Adding actions class to td
Edit: Fixing js error
Edit: circ/reserveratios.tt updated so that the plus icon doesn't show
      if there is no link
Edit: fixing logic in circ/reserveratios.tt
Edit: merge conflicts
Edit: updating buttons to bootstrap 3, which i believe fixes the problem
      in comment 16

To test:

1) Go to Acqui -> find a vendor -> view a basket
2) Click add to basket -> fill in 'for an existing record' and hit search
3) 'View MARC' and 'Order' buttons should show under an Actions column with appropriate icons
4) Click Order
5) Click add item when you are redirected to the New order page (no need to fill in any details)
6) Confirm that 'Edit' and 'Delete' buttons now show under an Actions column with appropriate icons
7) Go back to your basket and click add to basket -> from a subscription (we are skipping from a suggestion because this already has a button before my patch)
8) Confirm that 'Order' shows as a button with appropriate icon
9) Go back to your basket and click add to basket -> from an external source
10) fill in any fields and click search to bring up results
11) 'Order' should now show as a button with appropriate icons. MARC and Card preview have been moved into a dropdown menu - confirm this works as expected. Links have not been changed when clicking on a row
12) Go back to your basket and click add to basket -> from a staged file
13) 'Add orders' should now show as a button with appropriate icon
14) Go back to your basket and click add to basket -> from titles with highest hold ratios
15) 'X to order' should now show as a button with appropriate icon

Sponsored-by: Catalyst IT

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-02 20:27:28 +00:00

184 lines
6.8 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE KohaDates %]
[% USE AuthorisedValues %]
[% USE Branches %]
[% USE ItemTypes %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Circulation &rsaquo; Hold ratios</title>
[% INCLUDE 'doc-head-close.inc' %]
[% Asset.css("css/datatables.css") | $raw %]
<style type="text/css">
.sql { display: none; }
.ulined { text-decoration: underline; }
.ratiolimit { color: blue; cursor: pointer; }
#holdst ul li { list-style: outside url("[% interface | html %]/[% theme | html %]/img/item-bullet.gif") disc; }
</style>
</head>
<body id="circ_reserveratios" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Hold ratios</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<h1>Hold ratios to calculate items needed</h1>
<h3>Calculated on [% todaysdate | $KohaDates %]. From [% from | $KohaDates %]
to [% to | $KohaDates %]</h3>
<p>These items have a hold ratio &ge; [% ratio | html %].</p>
<div class="sql">[% sql | html %]</div>
[% IF ( reserveloop ) %]
<table id="holdst">
<thead>
<tr>
<th>Holds</th>
<th>Items</th>
<th>Hold ratio</th>
<th>Title</th>
<th>Home libraries</th>
<th>Holding libraries</th>
<th>Location</th>
<th>Itype</th>
<th>Call numbers</th>
<th>Items needed</th>
</tr>
</thead>
<tbody>
[% FOREACH reserveloo IN reserveloop %]
<tr>
<td><p>[% reserveloo.reservecount | html %]</p></td>
<td><p>[% reserveloo.itemcount | html %]</p></td>
<td><p class="ratiolimit">[% reserveloo.thisratio | html %]</p></td>
<td> [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %][% reserveloo.title | html %] [% IF ( reserveloo.subtitle ) %][% FOREACH subtitl IN reserveloo.subtitle %][% subtitl.subfield | html %][% END %][% END %]</a>[% IF ( reserveloo.author ) %] by [% reserveloo.author | html %][% END %]
</td>
<td>
<ul>
[% FOREACH homebranch IN reserveloo.homebranch_list %]
<li>[% Branches.GetName ( homebranch ) | html %]</li>
[% END %]
</ul>
</td>
<td>
<ul>
[% FOREACH holdingbranch IN reserveloo.holdingbranch_list %]
<li>[% Branches.GetName ( holdingbranch ) | html %]</li>
[% END %]
</ul>
</td>
<td>
<ul>
[% FOREACH location IN reserveloo.location %]
<li>[% AuthorisedValues.GetByCode( 'LOC', location ) | html %]</li>
[% END %]
</ul>
</td>
<td>
<ul>
[% FOREACH itype IN reserveloo.itype %]
<li>[% ItemTypes.GetDescription( itype ) | html %]</li>
[% END %]
</ul>
</td>
<td>
<ul>
[% FOREACH listcall IN reserveloo.listcall %]
<li>[% listcall | html %]</li>
[% END %]
</ul>
</td>
<td class="actions">
<p>
[% IF ( reserveloo.thisratio_atleast1 ) %]
[% IF ( CAN_user_acquisition && basketno && booksellerid ) %]<!-- [% reserveloo.ratiocalc | html %] -->
<a href="/cgi-bin/koha/acqui/neworderempty.pl?biblionumber=[% reserveloo.biblionumber | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;rr_quantity_to_order=[% reserveloo.ratiocalc | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% reserveloo.ratiocalc | html %] to order</a>
[% ELSE %]
<b>[% reserveloo.ratiocalc | html %] to order</b>
[% END %]
[% IF ( reserveloo.pendingorders ) %]<br><b>[% reserveloo.pendingorders | html %] pending</b>[% END %]
[% ELSE %]
0 to order
[% END %]
</p>
</td>
</tr>
[% END %]
</tbody>
</table>
[% ELSE %]
<b>No items found.</b>
[% END %]
</div>
</div>
<div class="yui-b">
<form action="/cgi-bin/koha/circ/reserveratios.pl" method="post" >
<fieldset class="brief">
<h4>Refine results:</h4>
<ol>
<li>
<label for="ratio">Hold ratio:</label>
<input type="text" size="5" id="ratio" name="ratio" value="[% ratio | html %]" />
<li>
<li>
<label for="include_ordered">Included ordered:</label>
[% IF include_ordered %]
<input id="include_ordered" name="include_ordered" type="checkbox" checked="checked"/>
[% ELSE %]
<input id="include_ordered" name="include_ordered" type="checkbox"/>
[% END %]
<li>
<li>
<label for="from">Start date:</label>
<input type="text" size="10" id="from" name="from" value="[% from | $KohaDates %]" class="datepickerfrom" />
</li>
<li>
<label for="to">End date:</label>
<input size="10" id="to" name="to" value="[% to | $KohaDates %]" type="text" class="datepickerto" />
</li>
</ol>
(inclusive)
<fieldset class="action"><input type="submit" value="Go" class="submit"/></fieldset>
</fieldset>
[% IF ( CAN_user_acquisition && basketno && booksellerid ) %]
<input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
<input type="hidden" name="basketno" value="[% basketno | html %]" />
[% END %]
</form>
</div>
</div>
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
$(document).ready(function() {
$(".ratiolimit").click(function () {
$("#ratio").val($(this).html());
});
$(".ratiolimit").hover(
function () { $(this).toggleClass("ulined") },
function () { $(this).toggleClass("ulined") }
);
$("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, {
"aaSorting": [ [2,'desc'], [3,'asc'] ],
"aoColumnDefs": [
{ "aTargets": [ 0,1,2,8 ], "sType": "natural" },
{ "aTargets": [ 3 ], "sType": "anti-the" },
],
"sPaginationType": "four_button"
}));
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]