Lines 147-177
elsif ( $phase eq 'New Term step 5' ) {
Link Here
|
147 |
|
147 |
|
148 |
$query_criteria .= " AND $crit='$value'"; |
148 |
$query_criteria .= " AND $crit='$value'"; |
149 |
} |
149 |
} |
150 |
$value = $input->param( $crit . "_start_value" ); |
|
|
151 |
|
150 |
|
152 |
if ($value) { |
151 |
if ( my $date_type_value = $input->param( $crit . "_date_type_value" ) ) { |
153 |
my %tmp_hash; |
152 |
if ( $date_type_value eq 'range' ) { |
154 |
$tmp_hash{'name'} = "$crit Start"; |
153 |
if ( $value = $input->param( $crit . "_start_value" ) ) { |
155 |
$tmp_hash{'value'} = $value; |
154 |
my %tmp_hash; |
156 |
push @criteria_loop, \%tmp_hash; |
155 |
$tmp_hash{'name'} = "$crit Start"; |
157 |
my $value_dt = eval { dt_from_string( $value ) }; |
156 |
$tmp_hash{'value'} = $value; |
158 |
$value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } ) |
157 |
push @criteria_loop, \%tmp_hash; |
159 |
if ( $value_dt ); |
158 |
my $value_dt = eval { dt_from_string( $value ) }; |
160 |
|
159 |
$value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } ) |
161 |
$query_criteria .= " AND $crit >= '$value'"; |
160 |
if ( $value_dt ); |
162 |
} |
161 |
|
163 |
|
162 |
$query_criteria .= " AND $crit >= '$value'"; |
164 |
$value = $input->param( $crit . "_end_value" ); |
163 |
} |
165 |
if ($value) { |
164 |
|
166 |
my %tmp_hash; |
165 |
if ( $value = $input->param( $crit . "_end_value" ) ) { |
167 |
$tmp_hash{'name'} = "$crit End"; |
166 |
my %tmp_hash; |
168 |
$tmp_hash{'value'} = $value; |
167 |
$tmp_hash{'name'} = "$crit End"; |
169 |
push @criteria_loop, \%tmp_hash; |
168 |
$tmp_hash{'value'} = $value; |
170 |
my $value_dt = eval { dt_from_string( $value ) }; |
169 |
push @criteria_loop, \%tmp_hash; |
171 |
$value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } ) |
170 |
my $value_dt = eval { dt_from_string( $value ) }; |
172 |
if ( $value_dt ); |
171 |
$value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } ) |
173 |
|
172 |
if ( $value_dt ); |
174 |
$query_criteria .= " AND $crit <= '$value'"; |
173 |
|
|
|
174 |
$query_criteria .= " AND $crit <= '$value'"; |
175 |
} |
176 |
} |
177 |
# else we want all dates |
175 |
} |
178 |
} |
176 |
} |
179 |
} |
177 |
$template->param( |
180 |
$template->param( |
178 |
- |
|
|