/
reserveratios.tt
188 lines (180 loc) · 7.15 KB
/
reserveratios.tt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Circulation › Hold Ratios</title>
[% INCLUDE 'doc-head-close.inc' %]
<!-- Additions to enable Calendar system -->
<link rel="stylesheet" type="text/css" href="[% themelang %]/lib/calendar/calendar-system.css" />
<!-- End of additions --><!-- Additions to enable Calendar system -->
<script type="text/javascript" src="[% themelang %]/lib/calendar/calendar.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/calendar/calendar-en.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/calendar/calendar-setup.js"></script>
<!-- End of additions -->
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
<script type="text/javascript" language="JavaScript">
//<![CDATA[
$.tablesorter.addParser({
id: 'articles',
is: function(s) {return false; },
format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
type: 'text'
});
$(document).ready(function() {
$("th a").hide();
$(".ratiolimit").click(function () {
$("#ratio").val($(this).html());
});
$(".ratiolimit").hover(
function () { $(this).toggleClass("ulined") },
function () { $(this).toggleClass("ulined") }
);
$.tablesorter.defaults.widgets = ['zebra'];
$("#holdst:has(tbody tr)").tablesorter({ // only add sort if the table has a body and rows
sortList: [[0,1]],
headers: { 1: { sorter: 'articles' }}
});
});
//]]>
</script>
<style type="text/css">
.sql { display: none; }
.ulined { text-decoration: underline; }
.ratiolimit { color: blue; cursor: pointer; }
</style>
</head>
<body>
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> › 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 %]. From [% from %]
to [% to %]</h3>
<p>These items have a hold ratio ≥ [% ratio %].</p>
<div class="sql">[% DEFAULT sql="" %]</div>
[% IF ( reserveloop ) %]
<table id="holdst">
<thead> <tr>
<th>Holds
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=reservecount&from=[% from %]&to=[% to %]">Sort</a>
</th>
<th>Items
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=itemcount&from=[% from %]&to=[% to %]">Sort</a>
</th>
<th>Hold Ratio</th>
<th>Title
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=biblio&from=[% from %]&to=[% to %]">Sort</a>
</th>
<th>Holding Libraries
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=branch&from=[% from %]&to=[% to %]">Sort</a>
</th>
<th>Location
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=location&from=[% from %]&to=[% to %]">Sort</a>
</th>
<th>Itype
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=itype&from=[% from %]&to=[% to %]">Sort</a>
</th>
<th>Call Numbers
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&order=callnumber&from=[% from %]&to=[% to %]">Sort</a>
</th>
<th>Items Needed
</th>
</tr></thead>
<tbody>[% FOREACH reserveloo IN reserveloop %]
<tr>
<td><p>[% reserveloo.reservecount %]</p></td>
<td><p>[% reserveloo.itemcount %]</p></td>
<td><p class="ratiolimit">[% reserveloo.thisratio %]</p></td>
<td> [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %][% reserveloo.title |html %] [% IF ( reserveloo.subtitle ) %][% FOREACH subtitl IN reserveloo.subtitle %][% subtitl.subfield %][% END %][% END %]</a>[% IF ( reserveloo.author ) %] by [% reserveloo.author %][% END %]
</td>
<td><p>[% reserveloo.listbranch %]</p></td>
<td><p>[% reserveloo.location %]</p></td>
<td><p>[% reserveloo.itype %]</p></td>
<td><p>[% reserveloo.listcall %]</p></td>
<td>[% IF ( reserveloo.thisratio_atleast1 ) %]<p><b>[% reserveloo.ratiocalc %] to order</b></p>[% END %]</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 %]" /></li>
<li><label for="from">
Start date:
</label>
<input type="text" size="10" id="from" name="from" value="[% from %]" />
<img src="[% themelang %]/lib/calendar/cal.gif" border="0" id="openCalendarFrom" style="cursor: pointer;" alt="" />
<script language="JavaScript" type="text/javascript">
function validate1(date) {
var day = date.getDate();
var month = date.getMonth() + 1;
var year = date.getFullYear();
var weekDay = date.getDay();
var dayMonth = month + '-' + day;
var dateString = year + '-' + month + '-' + day;
var dateTo = document.getElementById('to').value.split("-");
var limitDate = new Date(dateTo[0], (dateTo[1] - 1), dateTo[2]);
if (date > limitDate) {
return true;
} else {
return false;
}
}
Calendar.setup(
{
inputField : "from",
ifFormat : "[% DHTMLcalendar_dateformat %]",
button : "openCalendarFrom",
disableFunc : validate1,
dateStatusFunc : validate1
}
);
</script></li>
<li><label for="to" >
End date:
</label>
<input size="10" id="to" name="to" value="[% to %]" type="text" />
<img src="[% themelang %]/lib/calendar/cal.gif" alt="" id="openCalendarTo" style="cursor: pointer;" border="0" />
<script type="text/javascript">
function validate2(date) {
var day = date.getDate();
var month = date.getMonth() + 1;
var year = date.getFullYear();
var weekDay = date.getDay();
var dayMonth = month + '-' + day;
var dateString = year + '-' + month + '-' + day;
var dateFrom = document.getElementById('from').value.split("-");
var limitDate = new Date(dateFrom[0], (dateFrom[1] - 1), dateFrom[2]);
if (limitDate > date) {
return true;
} else {
return false;
}
}
Calendar.setup(
{
inputField : "to",
ifFormat : "[% DHTMLcalendar_dateformat %]",
button : "openCalendarTo",
disableFunc : validate2,
dateStatusFunc : validate2
}
);
</script></li></ol>
(inclusive)
<fieldset class="action"><input type="submit" value="Go" class="submit"/></fieldset>
</fieldset>
</form>
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]