# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use strict;
+#use warnings; FIXME - Bug 2505
use CGI;
use C4::Auth;
use C4::Output;
use C4::Koha;
use C4::Circulation;
use C4::Members;
+use C4::Reports;
use C4::Debug;
use C4::Dates qw(format_date format_date_in_iso);
}
my $output = $input->param("output");
my $basename = $input->param("basename");
-# my $mime = $input->param("MIME");
-my $del = $input->param("sep");
my ($template, $borrowernumber, $cookie)
= get_template_and_user({template_name => $fullreportname,
query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => {reports => 1},
+ flagsrequired => {reports => '*'},
debug => 1,
});
+our $sep = $input->param("sep");
+$sep = "\t" if ($sep eq 'tabulation');
$template->param(do_it => $do_it,
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
);
-filename=>"$basename.csv" );
my $cols = @$results[0]->{loopcol};
my $lines = @$results[0]->{looprow};
- my $sep;
- $sep =C4::Context->preference("delimiter");
# header top-right
print @$results[0]->{line} ."/". @$results[0]->{column} .$sep;
# Other header
my @values;
# here each element returned by map is a hashref, get it?
-my @mime = ( map { +{type =>$_} } (split /[;:]/,C4::Context->preference("MIME")) );
-my @delim = ( map { +{delim=>$_} } (split //,C4::Context->preference("delimiter")) );
+my @mime = ( map { {type =>$_} } (split /[;:]/, 'CSV') ); # FIXME translation
+my $delims = GetDelimiterChoices;
my $branches = GetBranches;
my @branchloop;
foreach (sort keys %$branches) {
$template->param(
mimeloop => \@mime,
- seploop => \@delim,
+ CGIseplist => $delims,
branchloop => \@branchloop,
itemtypeloop => \@itemtypeloop,
borcatloop => \@borcatloop,
print DEBUG "rows: ", $sth2->rows, "\n";
while (my @row = $sth2->fetchrow) {
$columns{($row[0] ||'NULL')}++;
- push @loopcol, +{ coltitle => $row[0] || 'NULL' };
+ push @loopcol, { coltitle => $row[0] || 'NULL' };
}
$strsth2 =~ s/old_issues/issues/g;
$debug and print DEBUG "rows: ", $sth2->rows, "\n";
while (my @row = $sth2->fetchrow) {
$columns{($row[0] ||'NULL')}++;
- push @loopcol, +{ coltitle => $row[0] || 'NULL' };
+ push @loopcol, { coltitle => $row[0] || 'NULL' };
}
$debug and print DEBUG "full array: ", Dumper(\%columns), "\n";
+ }else{
+ $columns{''} = 1;
}
#Initialization of cell values.....
foreach my $id (@ranked_ids) {
my @loopcell;
foreach my $key (@cols_in_order) {
- push @loopcell, {
+ if($column){
+ push @loopcell, {
value => $patrons{$id}->{name},
+ reference => $id,
count => $patrons{$id}->{allcols}->{$key},
+ };
+ }else{
+ push @loopcell, {
+ value => $patrons{$id}->{name},
reference => $id,
- };
+ count => $patrons{$id}->{total},
+ };
+ }
}
push @looprow,{ 'rowtitle' => $i++ ,
'loopcell' => \@loopcell,
$globalline{loopfilter}=\@loopfilter;
# the core of the table
$globalline{looprow} = \@looprow;
- $globalline{loopcol} = [ map {+{coltitle=>$_}} @cols_in_order ];
+ $globalline{loopcol} = [ map {{coltitle=>$_}} @cols_in_order ];
# the foot (totals by borrower type)
$globalline{loopfooter} = [];
$globalline{total}= $grantotal; # FIXME: useless