|
Lines 220-226
elsif ( $phase eq 'Update SQL'){
Link Here
|
| 220 |
my $cache_expiry_units = $input->param('cache_expiry_units'); |
220 |
my $cache_expiry_units = $input->param('cache_expiry_units'); |
| 221 |
my $public = $input->param('public'); |
221 |
my $public = $input->param('public'); |
| 222 |
my $save_anyway = $input->param('save_anyway'); |
222 |
my $save_anyway = $input->param('save_anyway'); |
| 223 |
|
|
|
| 224 |
my @errors; |
223 |
my @errors; |
| 225 |
|
224 |
|
| 226 |
# if we have the units, then we came from creating a report from SQL and thus need to handle converting units |
225 |
# if we have the units, then we came from creating a report from SQL and thus need to handle converting units |
|
Lines 734-739
elsif ($phase eq 'Run this report'){
Link Here
|
| 734 |
} elsif ( $authorised_value eq "date" ) { |
733 |
} elsif ( $authorised_value eq "date" ) { |
| 735 |
# require a date, provide a date picker |
734 |
# require a date, provide a date picker |
| 736 |
$input = 'date'; |
735 |
$input = 'date'; |
|
|
736 |
} elsif ( $authorised_value eq "list" ) { |
| 737 |
# require a list, provide a textarea |
| 738 |
$input = 'textarea'; |
| 737 |
} else { |
739 |
} else { |
| 738 |
# defined $authorised_value, and not 'date' |
740 |
# defined $authorised_value, and not 'date' |
| 739 |
my $dbh=C4::Context->dbh; |
741 |
my $dbh=C4::Context->dbh; |
|
Lines 1118-1124
sub get_prepped_report {
Link Here
|
| 1118 |
if ($split[$i*2+1] =~ /\|\s*date\s*$/) { |
1120 |
if ($split[$i*2+1] =~ /\|\s*date\s*$/) { |
| 1119 |
$quoted = output_pref({ dt => dt_from_string($quoted), dateformat => 'iso', dateonly => 1 }) if $quoted; |
1121 |
$quoted = output_pref({ dt => dt_from_string($quoted), dateformat => 'iso', dateonly => 1 }) if $quoted; |
| 1120 |
} |
1122 |
} |
| 1121 |
$quoted = C4::Context->dbh->quote($quoted); |
1123 |
unless( $split[$i*2+1] =~ /\|\s*list\s*$/ && $quoted ){ |
|
|
1124 |
$quoted = C4::Context->dbh->quote($quoted); |
| 1125 |
} else { |
| 1126 |
my @list = split /\n/, $quoted; |
| 1127 |
my @quoted_list; |
| 1128 |
foreach my $item ( @list ){ |
| 1129 |
$item =~ s/\r//; |
| 1130 |
push @quoted_list, C4::Context->dbh->quote($item); |
| 1131 |
} |
| 1132 |
$quoted="(".join(",",@quoted_list).")"; |
| 1133 |
} |
| 1122 |
$sql =~ s/<<$split[$i*2+1]>>/$quoted/; |
1134 |
$sql =~ s/<<$split[$i*2+1]>>/$quoted/; |
| 1123 |
} |
1135 |
} |
| 1124 |
return $sql,$headers; |
1136 |
return $sql,$headers; |
| 1125 |
- |
|
|