diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt
index f356cd9b02..c21af0d68d 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt
@@ -189,28 +189,20 @@
[% END %]
[% IF ( column.date ) %]
-
Choose:
+
+
+
+
+
+
+
+ Start of date range
+
+ [% INCLUDE 'date-format.inc' %]
+ End of date range
+
+ [% INCLUDE 'date-format.inc' %]
+
[% END %]
[% IF ( column.text ) %]
diff --git a/reports/dictionary.pl b/reports/dictionary.pl
index 964f76f581..ae6fe7dd15 100755
--- a/reports/dictionary.pl
+++ b/reports/dictionary.pl
@@ -147,31 +147,34 @@ elsif ( $phase eq 'New Term step 5' ) {
$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;
- my $value_dt = eval { dt_from_string( $value ) };
- $value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } )
- if ( $value_dt );
+ if ( my $date_type_value = $input->param( $crit . "_date_type_value" ) ) {
+ if ( $date_type_value eq 'range' ) {
+ if ( $value = $input->param( $crit . "_start_value" ) ) {
+ my %tmp_hash;
+ $tmp_hash{'name'} = "$crit Start";
+ $tmp_hash{'value'} = $value;
+ push @criteria_loop, \%tmp_hash;
+ my $value_dt = eval { dt_from_string( $value ) };
+ $value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } )
+ if ( $value_dt );
- $query_criteria .= " AND $crit >= '$value'";
- }
+ $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;
- my $value_dt = eval { dt_from_string( $value ) };
- $value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } )
- if ( $value_dt );
+ if ( $value = $input->param( $crit . "_end_value" ) ) {
+ my %tmp_hash;
+ $tmp_hash{'name'} = "$crit End";
+ $tmp_hash{'value'} = $value;
+ push @criteria_loop, \%tmp_hash;
+ my $value_dt = eval { dt_from_string( $value ) };
+ $value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } )
+ if ( $value_dt );
- $query_criteria .= " AND $crit <= '$value'";
+ $query_criteria .= " AND $crit <= '$value'";
+ }
+ }
+ # else we want all dates
}
}
$template->param(