Bug Fixing.

Displaying more precise description, barcodes and not itemnumbers, titles and authors...
......
Maybe could be good to group items on biblios, so that multiple items for one biblio would not come out.... AND... not get a biblio that is not issuable... Should we use biblios more than items ?????
This commit is contained in:
hdl 2005-12-19 13:33:04 +00:00
parent af848f1656
commit e4ecfc708a
2 changed files with 65 additions and 13 deletions

View File

@ -13,7 +13,7 @@
<br>
<table>
<tr >
<th class="reports">Num/Items</th>
<th class="reports">Barcode/Titles</th>
<!-- TMPL_LOOP NAME="loopcol" -->
<th class="reports"><!-- TMPL_VAR NAME="coltitle" --></th>
<!-- /TMPL_LOOP -->
@ -24,7 +24,9 @@
<!-- TMPL_VAR NAME="rowtitle" --></td>
<!-- TMPL_LOOP NAME="loopcell" -->
<!-- TMPL_IF NAME="hilighted" --><td class="hilighted"><!-- TMPL_ELSE --><td ><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="value" --><!-- TMPL_VAR NAME="value" --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="title" --><b><!-- TMPL_VAR NAME="title" --></b><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="author" --><!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="barcode" --> <i><!-- TMPL_VAR NAME="barcode" --></i><!-- /TMPL_IF -->
</td>
<!-- /TMPL_LOOP -->
</tr>
@ -70,13 +72,29 @@
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Branch</td>
<td><input type="text" name="Filter" value=""></td>
<td>
<select name="Filter">
<option value="">All branches</option>
<!-- TMPL_LOOP name="branchloop" -->
<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name
="branchname" --></option>
<!-- /TMPL_LOOP -->
</select>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>Document Type</td>
<td><input type="text" name="Filter" value=""></td>
<td>
<select name="Filter">
<option value="">All Item Types</option>
<!-- TMPL_LOOP name="itemtypeloop" -->
<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name
="description" --></option>
<!-- /TMPL_LOOP -->
</select>
</td>
</tr>
</tbody>
</table>

View File

@ -132,10 +132,35 @@ if ($do_it) {
-values => \@dels,
-size => 1,
-multiple => 0 );
#doctype
my $itemtypes = getitemtypes;
my @itemtypeloop;
foreach my $thisitemtype (keys %$itemtypes) {
# my $selected = 1 if $thisbranch eq $branch;
my %row =(value => $thisitemtype,
# selected => $selected,
description => $itemtypes->{$thisitemtype}->{'description'},
);
push @itemtypeloop, \%row;
}
#branch
my $branches = getallbranches;
my @branchloop;
foreach my $thisbranch (keys %$branches) {
# my $selected = 1 if $thisbranch eq $branch;
my %row =(value => $thisbranch,
# selected => $selected,
branchname => $branches->{$thisbranch}->{'branchname'},
);
push @branchloop, \%row;
}
$template->param(
CGIextChoice => $CGIextChoice,
CGIsepChoice => $CGIsepChoice
CGIsepChoice => $CGIsepChoice,
itemtypeloop =>\@itemtypeloop,
branchloop =>\@branchloop,
);
output_html_with_http_headers $input, $cookie, $template->output;
}
@ -231,9 +256,9 @@ sub calculate {
my $strcalc ;
# Processing average loanperiods
$strcalc .= "SELECT CONCAT( items.itemnumber, \" \",biblioitems.biblioitemnumber)";
$strcalc .= "SELECT items.barcode, biblio.title, biblio.biblionumber, biblio.author";
$strcalc .= " , $colfield " if ($colfield);
$strcalc .= " FROM (items LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber) LEFT JOIN issues ON issues.itemnumber=items.itemnumber WHERE issues.itemnumber is null";
$strcalc .= " FROM (items LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber LEFT JOIN biblio ON biblio.biblionumber=items.biblionumber) LEFT JOIN issues ON issues.itemnumber=items.itemnumber WHERE issues.itemnumber is null";
# @$filters[0]=~ s/\*/%/g if (@$filters[0]);
# $strcalc .= " AND issues.timestamp <= '" . @$filters[0] ."'" if ( @$filters[0] );
# @$filters[1]=~ s/\*/%/g if (@$filters[1]);
@ -263,10 +288,13 @@ sub calculate {
my $previous_col;
my $i=1;
while (my @data = $dbcalc->fetchrow) {
my ($row, $col )=@data;
my ($barcode,$title,$bibnum,$author, $col )=@data;
$col = "zzEMPTY" if ($col eq undef);
$i=1 if (($previous_col) and not($col eq $previous_col));
$table[$i]->{$col}=$row;
$table[$i]->{$col}->{'barcode'}=$barcode;
$table[$i]->{$col}->{'title'}=$title;
$table[$i]->{$col}->{'bibnum'}=$bibnum;
$table[$i]->{$col}->{'author'}=$author;
# warn " ".$i." ".$col. " ".$row;
$i++;
$previous_col=$col;
@ -281,13 +309,19 @@ sub calculate {
# and the number matches the number of columns
my $colcount=0;
foreach my $col ( @loopcol ) {
my $value;
my ($barcode, $author, $title, $bibnum);
if (@loopcol){
$value =$table[$i]->{(($col->{coltitle} eq "NULL") or ($col->{coltitle} eq "Global"))?"zzEMPTY":$col->{coltitle}};
$barcode =$table[$i]->{(($col->{coltitle} eq "NULL") or ($col->{coltitle} eq "Global"))?"zzEMPTY":$col->{coltitle}}->{'barcode'};
$title =$table[$i]->{(($col->{coltitle} eq "NULL") or ($col->{coltitle} eq "Global"))?"zzEMPTY":$col->{coltitle}}->{'title'};
$author =$table[$i]->{(($col->{coltitle} eq "NULL") or ($col->{coltitle} eq "Global"))?"zzEMPTY":$col->{coltitle}}->{'author'};
$bibnum =$table[$i]->{(($col->{coltitle} eq "NULL") or ($col->{coltitle} eq "Global"))?"zzEMPTY":$col->{coltitle}}->{'bibnum'};
} else {
$value =$table[$i]->{"zzEMPTY"};
$barcode =$table[$i]->{"zzEMPTY"}->{'barcode'};
$title =$table[$i]->{"zzEMPTY"}->{'title'};
$author =$table[$i]->{"zzEMPTY"}->{'author'};
$bibnum =$table[$i]->{"zzEMPTY"}->{'bibnum'};
}
push @loopcell, {value => $value} ;
push @loopcell, {author=> $author, title=>$title,bibnum=>$bibnum,barcode=>$barcode} ;
}
push @looprow,{ 'rowtitle' => $i ,
'loopcell' => \@loopcell,