-elsif ($phase eq 'New Term step 5'){
- # Confirmation screen
- my $areas = C4::Reports::Guided::get_report_areas();
- my $area = $input->param('area');
- my $areaname = $areas->[$area - 1]->{'name'};
- my $columnstring = $input->param('columnstring');
- my $definition_name=$input->param('definition_name');
- my $definition_description=$input->param('definition_description');
- my @criteria = $input->param('criteria_column');
- my $query_criteria;
- my @criteria_loop;
- foreach my $crit (@criteria) {
- my $value = $input->param( $crit . "_value" );
- if ($value) {
- my %tmp_hash;
- $tmp_hash{'name'}=$crit;
- $tmp_hash{'value'} = $value;
- push @criteria_loop,\%tmp_hash;
- if ($value =~ C4::Dates->regexp(C4::Context->preference('dateformat'))) {
- my $date = C4::Dates->new($value);
- $value = $date->output("iso");
- }
- $query_criteria .= " AND $crit='$value'";
- }
- $value = $input->param( $crit . "_start_value" );
- if ($value) {
- my %tmp_hash;
- $tmp_hash{'name'}="$crit Start";
- $tmp_hash{'value'} = $value;
- push @criteria_loop,\%tmp_hash;
- if ($value =~ C4::Dates->regexp(C4::Context->preference('dateformat'))) {
- my $date = C4::Dates->new($value);
- $value = $date->output("iso");
- }
- $query_criteria .= " AND $crit >= '$value'";
- }
- $value = $input->param( $crit . "_end_value" );
- if ($value) {
- my %tmp_hash;
- $tmp_hash{'name'}="$crit End";
- $tmp_hash{'value'} = $value;
- push @criteria_loop,\%tmp_hash;
- if ($value =~ C4::Dates->regexp(C4::Context->preference('dateformat'))) {
- my $date = C4::Dates->new($value);
- $value = $date->output("iso");
- }
- $query_criteria .= " AND $crit <= '$value'";
- }
- }
- $template->param( 'step_5' => 1,
- 'area' => $area,
- 'areaname' => $areaname,
- 'definition_name' => $definition_name,
- 'definition_description' => $definition_description,
- 'query' => $query_criteria,
- 'columnstring' => $columnstring,
- 'criteria_loop' => \@criteria_loop,
- );
+elsif ( $phase eq 'New Term step 5' ) {
+ # Confirmation screen
+ my $columnstring = $input->param('columnstring');
+ my @criteria = $input->param('criteria_column');
+ my $query_criteria;
+ my @criteria_loop;
+
+ foreach my $crit (@criteria) {
+ my $value = $input->param( $crit . "_value" );
+ if ($value) {
+ my %tmp_hash;
+ $tmp_hash{'name'} = $crit;
+ $tmp_hash{'value'} = $value;
+ push @criteria_loop, \%tmp_hash;
+ if ( $value =~ C4::Dates->regexp( C4::Context->preference('dateformat') ) ) {
+ my $date = C4::Dates->new($value);
+ $value = $date->output("iso");
+ }
+ $query_criteria .= " AND $crit='$value'";
+ }
+ $value = $input->param( $crit . "_start_value" );
+ if ($value) {
+ my %tmp_hash;
+ $tmp_hash{'name'} = "$crit Start";
+ $tmp_hash{'value'} = $value;
+ push @criteria_loop, \%tmp_hash;
+ if ( $value =~ C4::Dates->regexp( C4::Context->preference('dateformat') ) ) {
+ my $date = C4::Dates->new($value);
+ $value = $date->output("iso");
+ }
+ $query_criteria .= " AND $crit >= '$value'";
+ }
+ $value = $input->param( $crit . "_end_value" );
+ if ($value) {
+ my %tmp_hash;
+ $tmp_hash{'name'} = "$crit End";
+ $tmp_hash{'value'} = $value;
+ push @criteria_loop, \%tmp_hash;
+ if ( $value =~ C4::Dates->regexp( C4::Context->preference('dateformat') ) ) {
+ my $date = C4::Dates->new($value);
+ $value = $date->output("iso");
+ }
+ $query_criteria .= " AND $crit <= '$value'";
+ }
+ }
+ my %report_areas = map @$_, get_report_areas();
+ $template->param(
+ 'step_5' => 1,
+ 'area' => $area,
+ 'areaname' => $report_areas{$area},
+ 'definition_name' => $definition_name,
+ 'definition_description' => $definition_description,
+ 'query' => $query_criteria,
+ 'columnstring' => $columnstring,
+ 'criteria_loop' => \@criteria_loop,
+ );