#use warnings; FIXME - Bug 2505
use CGI;
use Text::CSV;
+use URI::Escape;
use C4::Reports::Guided;
use C4::Auth qw/:DEFAULT get_session/;
use C4::Output;
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 = qq(<input id="date_$text" type="text" value="" size="10" name="sql_params">
+ <img id="date_picker_$text" alt="Show Calendar" src="/intranet-tmpl/prog/en/lib/calendar/cal.gif">
+ <script type="text/javascript">
+ Calendar.setup(
+ {
+ inputField : "date_$text",
+ ifFormat : "%Y-%m-%d",
+ button : "date_picker_$text"
+ }
+ );
+ </script>
+ );
+ }
+ elsif ($authorised_value) {
my $dbh=C4::Context->dbh;
my @authorised_values;
my %authorised_lib;
my $totpages = int($total/$limit) + (($total % $limit) > 0 ? 1 : 0);
my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report&phase=Run%20this%20report";
+ if (@sql_params) {
+ $url = join('&sql_params=', $url, map { URI::Escape::uri_escape($_) } @sql_params);
+ }
$template->param(
'results' => \@rows,
'sql' => $sql,
}
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!