View | Details | Raw Unified | Return to bug 28224
Collapse All | Expand All

(-)a/acqui/duplicate_orders.pl (-2 / +8 lines)
Lines 73-80 my $to_placed_on = Link Here
73
  eval { dt_from_string( scalar $input->param('to') )   } || dt_from_string;
73
  eval { dt_from_string( scalar $input->param('to') )   } || dt_from_string;
74
74
75
unless ( $input->param('from') ) {
75
unless ( $input->param('from') ) {
76
    # Fill the form with year-1
76
    if ( C4::Context->preference('OrderSearchFromDate') ) {
77
    $from_placed_on->set_time_zone('floating')->subtract( years => 1 );
77
        my $from_days = C4::Context->preference('OrderSearchFromDate');
78
        $from_placed_on->set_time_zone('floating')->subtract( days => $from_days );
79
    } else {
80
81
        # Fill the form with year-1
82
        $from_placed_on->set_time_zone('floating')->subtract( years => 1 );
83
    }
78
}
84
}
79
$filters->{from_placed_on} = $from_placed_on;
85
$filters->{from_placed_on} = $from_placed_on;
80
$filters->{to_placed_on}   = $to_placed_on;
86
$filters->{to_placed_on}   = $to_placed_on;
(-)a/acqui/histsearch.pl (-2 / +9 lines)
Lines 95-103 my $filters = { Link Here
95
my $from_placed_on = eval { dt_from_string( scalar $input->param('from') ) } || dt_from_string;
95
my $from_placed_on = eval { dt_from_string( scalar $input->param('from') ) } || dt_from_string;
96
my $to_placed_on   = eval { dt_from_string( scalar $input->param('to')   ) } || dt_from_string;
96
my $to_placed_on   = eval { dt_from_string( scalar $input->param('to')   ) } || dt_from_string;
97
unless ( $input->param('from') ) {
97
unless ( $input->param('from') ) {
98
    # Fill the form with year-1
98
    if ( C4::Context->preference('OrderSearchFromDate') ) {
99
    $from_placed_on->set_time_zone('floating')->subtract( years => 1 );
99
        my $from_days = C4::Context->preference('OrderSearchFromDate');
100
        $from_placed_on->set_time_zone('floating')->subtract( days => $from_days );
101
    } else {
102
103
        # Fill the form with year-1
104
        $from_placed_on->set_time_zone('floating')->subtract( years => 1 );
105
    }
100
}
106
}
107
101
$filters->{from_placed_on} = $from_placed_on;
108
$filters->{from_placed_on} = $from_placed_on;
102
$filters->{to_placed_on}   = $to_placed_on;
109
$filters->{to_placed_on}   = $to_placed_on;
103
my $additional_fields = Koha::AdditionalFields->search( { tablename => 'aqbasket', searchable => 1 } );
110
my $additional_fields = Koha::AdditionalFields->search( { tablename => 'aqbasket', searchable => 1 } );
(-)a/installer/data/mysql/atomicupdate/bug_28224_order_search_from_date.pl (+20 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "28224",
5
    description => "Customize the from date on the acq adcanced search form",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Do you stuffs here
11
        $dbh->do(
12
            q{ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
13
            ('OrderSearchFromDate','',NULL,'Set the default from date for the order search to this many days ago. If empty, date will be set to one year ago.','Integer')}
14
        );
15
16
        # sysprefs
17
        say $out "Added new system preference 'OrderSearchFromDate'";
18
19
    },
20
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 544-549 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
544
('OPACOpenURLItemTypes', '', NULL, 'Show the OpenURL link only for these item types', 'Free'),
544
('OPACOpenURLItemTypes', '', NULL, 'Show the OpenURL link only for these item types', 'Free'),
545
('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free'),
545
('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free'),
546
('OrderPriceRounding','','|nearest_cent','Local preference for rounding orders before calculations to ensure correct calculations','Choice'),
546
('OrderPriceRounding','','|nearest_cent','Local preference for rounding orders before calculations to ensure correct calculations','Choice'),
547
('OrderSearchFromDate','',NULL,'Set the default from date for the order search to this many days ago. If empty, date will be set to one year ago.','Integer'),
547
('OverDriveCirculation','0','Enable client to see their OverDrive account','','YesNo'),
548
('OverDriveCirculation','0','Enable client to see their OverDrive account','','YesNo'),
548
('OverDriveClientKey','','Client key for OverDrive integration','30','Free'),
549
('OverDriveClientKey','','Client key for OverDrive integration','30','Free'),
549
('OverDriveClientSecret','','Client key for OverDrive integration','30','Free'),
550
('OverDriveClientSecret','','Client key for OverDrive integration','30','Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref (-1 / +6 lines)
Lines 113-118 Acquisitions: Link Here
113
            - '<br>If you choose <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EmailAddressForSuggestions">EmailAddressForSuggestions</a> you have to enter a valid email address:'
113
            - '<br>If you choose <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EmailAddressForSuggestions">EmailAddressForSuggestions</a> you have to enter a valid email address:'
114
            - pref: EmailAddressForSuggestions
114
            - pref: EmailAddressForSuggestions
115
              class: email
115
              class: email
116
        -
117
            - "Set the default 'From' date in the acquisition adavanced search form to a date"
118
            - pref: OrderSearchFromDate
119
              default: ''
120
              class: integer
121
            - "days ago. If left empty, the date will be set to be one year ago."
116
    Printing:
122
    Printing:
117
        -
123
        -
118
            - Use the
124
            - Use the
119
- 

Return to bug 28224