Bugzilla – Attachment 20306 Details for
Bug 10718
items with no checkouts report does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10718 - items with no checkouts report does not work
0001-Bug-10718-items-with-no-checkouts-report-does-not-wo.patch (text/plain), 4.14 KB, created by
Fridolin Somers
on 2013-08-13 13:50:06 UTC
(
hide
)
Description:
Bug 10718 - items with no checkouts report does not work
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2013-08-13 13:50:06 UTC
Size:
4.14 KB
patch
obsolete
>From 1f7740d951d160d8233498e49e7dffd430f697be Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Tue, 13 Aug 2013 14:55:32 +0200 >Subject: [PATCH 1/5] Bug 10718 - items with no checkouts report does not work > >Bug 8124 has commented the option to download results items with no checkouts report into a file. >But the perl code of this page uses the export into a file has default behavior since the input "output" is no more present. >The consequence is that there are never results in page. > >This patch removes the code concerning file output from template and perl. >Such a feature exists in guided reports. > >Test plan : >Play with cgi-bin/koha/reports/catalogue_out.pl form and see if you get results >--- > reports/catalogue_out.pl | 55 +++++----------------------------------------- > 1 file changed, 5 insertions(+), 50 deletions(-) > >diff --git a/reports/catalogue_out.pl b/reports/catalogue_out.pl >index 8a22a18..fb41c26 100755 >--- a/reports/catalogue_out.pl >+++ b/reports/catalogue_out.pl >@@ -24,11 +24,9 @@ use CGI; > use C4::Auth; > use C4::Context; > use C4::Debug; >-use C4::Branch; # GetBranches >+use C4::Branch; # GetBranchesLoop > use C4::Output; > use C4::Koha; # GetItemTypes >-use C4::Reports; # GetDelimiterChoices >-use C4::Circulation; > # use Date::Manip; # TODO: add not borrowed since date X criteria > use Data::Dumper; > >@@ -43,8 +41,7 @@ my $do_it = $input->param('do_it'); > my $limit = $input->param("Limit"); > my $column = $input->param("Criteria"); > my @filters = $input->param("Filter"); >-my $output = $input->param("output"); >-my $basename = $input->param("basename") || 'catalogue_out'; >+ > my ($template, $borrowernumber, $cookie) = get_template_and_user({ > template_name => "reports/catalogue_out.tmpl", > query => $input, >@@ -54,57 +51,17 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({ > debug => 1, > }); > >-our $sep = $input->param("sep"); >-$sep = "\t" if ((! defined $sep) or $sep eq 'tabulation'); >- > $template->param(do_it => $do_it); > if ($do_it) { > my $results = calculate($limit, $column, \@filters); >- if ($output eq "screen") { >- # Printing results to screen >- $template->param(mainloop => $results); >- output_html_with_http_headers $input, $cookie, $template->output; >- } else { >- # Printing to a csv file FIXME: This is broken rather badly, if it ever worked at all here. >- print $input->header( >- -type => 'application/vnd.sun.xml.calc', >- -encoding => 'utf-8', >- -attachment=>"$basename.csv", >- -filename =>"$basename.csv" ); >- my $cols = @$results[0]->{loopcol}; >- my $lines = @$results[0]->{looprow}; >-# header >- print "num /". @$results[0]->{column} .$sep; >-# Other header >- foreach my $col ( @$cols ) { >- print $col->{coltitle}.$sep; >- } >- print "Total\n"; >-# Table >- foreach my $line ( @$lines ) { >- my $x = $line->{loopcell}; # FIXME: No Such thing. >- print $line->{rowtitle}.$sep; >- foreach my $cell (@$x) { >- print $cell->{value}.$sep; >- } >- print $line->{totalrow}, "\n"; >- } >-# footer >- print "TOTAL"; >- foreach my $col ( @$cols ) { >- print $sep.$col->{totalcol}; >- } >- print $sep.@$results[0]->{total}; >- } >+ $template->param(mainloop => $results); >+ output_html_with_http_headers $input, $cookie, $template->output; > exit; # in either case, exit after do_it > } > > # Displaying choices (i.e., not do_it) >-my @values; >-my %select; > >-my @mime = ( map { +{type =>$_} } (split /[;:]/, 'CSV') ); # FIXME translation >-my $itemtypes = GetItemTypes; >+my $itemtypes = GetItemTypes(); > my @itemtypeloop; > foreach (sort {$itemtypes->{$a}->{description} cmp $itemtypes->{$b}->{description}} keys %$itemtypes) { > push @itemtypeloop, { >@@ -114,8 +71,6 @@ foreach (sort {$itemtypes->{$a}->{description} cmp $itemtypes->{$b}->{descriptio > } > > $template->param( >- CGIextChoice => \@mime, >- CGIsepChoice => GetDelimiterChoices, > itemtypeloop => \@itemtypeloop, > branchloop => GetBranchesLoop($input->param("branch") || C4::Context->userenv->{branch}), > ); >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10718
:
20306
|
20307
|
20308
|
20309
|
20310
|
20570
|
20600
|
20886
|
20887