Additional fix for Bug 3550, Use GetRecordValue to get the subtitle

- Adding subtitle to Hold Ratio report output
- Sorting by default on ratio, descending
- Adding author
- Removing description

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Owen Leonard 2011-01-07 05:34:11 -05:00 committed by Chris Cormack
parent 86df2d1efa
commit 05c240953a
2 changed files with 6 additions and 6 deletions

View file

@ -28,6 +28,7 @@ use C4::Auth;
use C4::Dates qw/format_date format_date_in_iso/;
use C4::Debug;
use Date::Calc qw/Today Add_Delta_YM/;
use C4::Biblio qw/GetMarcBiblio GetRecordValue GetFrameworkCode/;
my $input = new CGI;
my $order = $input->param('order') || '';
@ -144,6 +145,8 @@ while ( my $data = $sth->fetchrow_hashref ) {
my $thisratio = $data->{reservecount} / $data->{itemcount};
my $ratiocalc = ($thisratio / $ratio);
($thisratio / $ratio) >= 1 or next; # TODO: tighter targeting -- get ratio limit into SQL using HAVING clause
my $record = GetMarcBiblio($data->{biblionumber});
$data->{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($data->{biblionumber}));
push(
@reservedata,
{
@ -151,6 +154,7 @@ while ( my $data = $sth->fetchrow_hashref ) {
priority => $data->{priority},
name => $data->{borrower},
title => $data->{title},
subtitle => $data->{subtitle},
author => $data->{author},
notes => $data->{notes},
itemnum => $data->{itemnumber},

View file

@ -28,7 +28,7 @@ $.tablesorter.addParser({
);
$.tablesorter.defaults.widgets = ['zebra'];
$("#holdst:has(tbody tr)").tablesorter({ // only add sort if the table has a body and rows
sortList: [[0,0]],
sortList: [[0,1]],
headers: { 1: { sorter: 'articles' }}
});
});
@ -91,11 +91,7 @@ $.tablesorter.addParser({
<td><p><!-- TMPL_VAR NAME="reservecount" --></p></td>
<td><p><!-- TMPL_VAR NAME="itemcount" --></p></td>
<td><p class="ratiolimit"><!-- TMPL_VAR NAME="thisratio" --></p></td>
<td><p>
<!-- TMPL_INCLUDE NAME="biblio-default-view.inc" --><!-- TMPL_VAR NAME="title" escape="html" --> <!-- TMPL_VAR NAME="subtitle" -->
</a>
</p>
<p><!-- TMPL_VAR NAME="notes" --></p>
<td><!-- TMPL_INCLUDE NAME="biblio-default-view.inc" --><!-- TMPL_VAR NAME="title" escape="html" --> <!-- TMPL_IF NAME="subtitle" --><!-- TMPL_LOOP NAME="subtitle" --><!-- TMPL_VAR NAME="subfield" --><!-- /TMPL_LOOP --><!-- /TMPL_IF --></a><!-- TMPL_IF NAME="author" --> by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF -->
</td>
<td><p><!-- TMPL_VAR NAME="listbranch" --></p></td>
<td><p><!-- TMPL_VAR NAME="location" --></p></td>