diff --git a/koha-tmpl/intranet-tmpl/default/en/reports/catalogue_out.tmpl b/koha-tmpl/intranet-tmpl/default/en/reports/catalogue_out.tmpl index e847e46228..4c50f90390 100644 --- a/koha-tmpl/intranet-tmpl/default/en/reports/catalogue_out.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/reports/catalogue_out.tmpl @@ -13,7 +13,7 @@
- + @@ -24,7 +24,9 @@ @@ -70,13 +72,29 @@ - + - +
Num/ItemsBarcode/Titles - + + +
    Branch + +
    Document Type + +
diff --git a/reports/catalogue_out.pl b/reports/catalogue_out.pl index 3a7c2424d4..05d5ca5cb3 100755 --- a/reports/catalogue_out.pl +++ b/reports/catalogue_out.pl @@ -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,