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

(-)a/admin/categorie.pl (-6 / +4 lines)
Lines 42-50 use C4::Context; Link Here
42
use C4::Auth;
42
use C4::Auth;
43
use C4::Branch;
43
use C4::Branch;
44
use C4::Output;
44
use C4::Output;
45
use C4::Dates;
46
use C4::Form::MessagingPreferences;
45
use C4::Form::MessagingPreferences;
47
use Koha::Database;
46
use Koha::Database;
47
use Koha::DateUtils;
48
48
49
sub StringSearch {
49
sub StringSearch {
50
    my ( $searchstring, $type ) = @_;
50
    my ( $searchstring, $type ) = @_;
Lines 172-182 elsif ( $op eq 'add_validate' ) { Link Here
172
    my $dbh = C4::Context->dbh;
172
    my $dbh = C4::Context->dbh;
173
173
174
    if ( $input->param('enrolmentperioddate') ) {
174
    if ( $input->param('enrolmentperioddate') ) {
175
        $input->param(
175
        my $enrolment_dt = eval { dt_from_string( $input->param('enrolmentperioddate') ) };
176
            'enrolmentperioddate' => C4::Dates::format_date_in_iso(
176
        $enrolment_dt = eval { output_pref( { dt => $enrolment_dt, dateonly => 1, dateformat => 'iso' } ) } if ( $enrolment_dt );
177
                $input->param('enrolmentperioddate')
177
        $input->param( 'enrolmentperioddate' => $enrolment_dt );
178
            )
179
        );
180
    }
178
    }
181
179
182
    if ($is_a_modif) {
180
    if ($is_a_modif) {
(-)a/admin/smart-rules.pl (-5 / +5 lines)
Lines 26-32 use C4::Auth; Link Here
26
use C4::Koha;
26
use C4::Koha;
27
use C4::Debug;
27
use C4::Debug;
28
use C4::Branch; # GetBranches
28
use C4::Branch; # GetBranches
29
use C4::Dates qw/format_date format_date_in_iso/;
29
use Koha::DateUtils;
30
use Koha::Database;
30
use Koha::Database;
31
31
32
my $input = CGI->new;
32
my $input = CGI->new;
Lines 126-133 elsif ($op eq 'add') { Link Here
126
    $maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/;
126
    $maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/;
127
    my $issuelength  = $input->param('issuelength');
127
    my $issuelength  = $input->param('issuelength');
128
    my $lengthunit  = $input->param('lengthunit');
128
    my $lengthunit  = $input->param('lengthunit');
129
    my $hardduedate = $input->param('hardduedate');
129
    my $hardduedate = eval { dt_from_string( $input->param('hardduedate') ) };
130
    $hardduedate = format_date_in_iso($hardduedate);
130
    $hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate );
131
    my $hardduedatecompare = $input->param('hardduedatecompare');
131
    my $hardduedatecompare = $input->param('hardduedatecompare');
132
    my $rentaldiscount = $input->param('rentaldiscount');
132
    my $rentaldiscount = $input->param('rentaldiscount');
133
    my $opacitemholds = $input->param('opacitemholds') || 0;
133
    my $opacitemholds = $input->param('opacitemholds') || 0;
Lines 446-452 while (my $row = $sth2->fetchrow_hashref) { Link Here
446
    $row->{'default_humancategorycode'} = 1 if $row->{'humancategorycode'} eq '*';
446
    $row->{'default_humancategorycode'} = 1 if $row->{'humancategorycode'} eq '*';
447
    $row->{'fine'} = sprintf('%.2f', $row->{'fine'});
447
    $row->{'fine'} = sprintf('%.2f', $row->{'fine'});
448
    if ($row->{'hardduedate'} && $row->{'hardduedate'} ne '0000-00-00') {
448
    if ($row->{'hardduedate'} && $row->{'hardduedate'} ne '0000-00-00') {
449
       $row->{'hardduedate'} = format_date( $row->{'hardduedate'});
449
       my $harddue_dt = eval { dt_from_string( $row->{'hardduedate'} ) };
450
       $row->{'hardduedate'} = eval { output_pref( { dt => $harddue_dt, dateonly => 1 } ) } if ( $harddue_dt );
450
       $row->{'hardduedatebefore'} = 1 if ($row->{'hardduedatecompare'} == -1);
451
       $row->{'hardduedatebefore'} = 1 if ($row->{'hardduedatecompare'} == -1);
451
       $row->{'hardduedateexact'} = 1 if ($row->{'hardduedatecompare'} ==  0);
452
       $row->{'hardduedateexact'} = 1 if ($row->{'hardduedatecompare'} ==  0);
452
       $row->{'hardduedateafter'} = 1 if ($row->{'hardduedatecompare'} ==  1);
453
       $row->{'hardduedateafter'} = 1 if ($row->{'hardduedatecompare'} ==  1);
453
- 

Return to bug 14949