projects
/
koha.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug 5549 : Koha::Calendar::addDate should not loop on -1
[koha.git]
/
reports
/
guided_reports.pl
diff --git
a/reports/guided_reports.pl
b/reports/guided_reports.pl
index
f5667a2
..
cb85f39
100755
(executable)
--- a/
reports/guided_reports.pl
+++ b/
reports/guided_reports.pl
@@
-112,9
+112,12
@@
elsif ( $phase eq 'Delete Saved') {
elsif ( $phase eq 'Show SQL'){
my $id = $input->param('reports');
elsif ( $phase eq 'Show SQL'){
my $id = $input->param('reports');
-
my $sql = get_sql
($id);
+
my ($sql,$type,$reportname,$notes) = get_saved_report
($id);
$template->param(
$template->param(
- 'sql' => $sql,
+ 'id' => $id,
+ 'reportname' => $reportname,
+ 'notes' => $notes,
+ 'sql' => $sql,
'showsql' => 1,
);
}
'showsql' => 1,
);
}
@@
-154,6
+157,7
@@
elsif ( $phase eq 'Update SQL'){
update_sql( $id, $sql, $reportname, $notes );
$template->param(
'save_successful' => 1,
update_sql( $id, $sql, $reportname, $notes );
$template->param(
'save_successful' => 1,
+ 'reportname' => $reportname,
'id' => $id,
);
}
'id' => $id,
);
}
@@
-392,6
+396,7
@@
elsif ( $phase eq 'Save Report' ) {
my $id = save_report( $borrowernumber, $sql, $name, $type, $notes );
$template->param(
'save_successful' => 1,
my $id = save_report( $borrowernumber, $sql, $name, $type, $notes );
$template->param(
'save_successful' => 1,
+ 'reportname' => $name,
'id' => $id,
);
}
'id' => $id,
);
}
@@
-420,7
+425,10
@@
elsif ($phase eq 'Run this report'){
for(my $i=0;$i<($#split/2);$i++) {
my ($text,$authorised_value) = split /\|/,$split[$i*2+1];
my $input;
for(my $i=0;$i<($#split/2);$i++) {
my ($text,$authorised_value) = split /\|/,$split[$i*2+1];
my $input;
- if ($authorised_value) {
+ if ($authorised_value eq "date") {
+ $input = 'date';
+ }
+ elsif ($authorised_value) {
my $dbh=C4::Context->dbh;
my @authorised_values;
my %authorised_lib;
my $dbh=C4::Context->dbh;
my @authorised_values;
my %authorised_lib;
@@
-528,6
+536,7
@@
elsif ($phase eq 'Run this report'){
$template->param(
'results' => \@rows,
'sql' => $sql,
$template->param(
'results' => \@rows,
'sql' => $sql,
+ 'id' => $report,
'execute' => 1,
'name' => $name,
'notes' => $notes,
'execute' => 1,
'name' => $name,
'notes' => $notes,
@@
-539,7
+548,7
@@
elsif ($phase eq 'Run this report'){
}
elsif ($phase eq 'Export'){
}
elsif ($phase eq 'Export'){
- binmode STDOUT, ':
utf8
';
+ binmode STDOUT, ':
encoding(UTF-8)
';
# export results to tab separated text or CSV
my $sql = $input->param('sql'); # FIXME: use sql from saved report ID#, not new user-supplied SQL!
# export results to tab separated text or CSV
my $sql = $input->param('sql'); # FIXME: use sql from saved report ID#, not new user-supplied SQL!