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

(-)a/C4/Acquisition.pm (-9 / +4 lines)
Lines 27-33 use C4::Biblio qw( GetMarcFromKohaField GetMarcStructure IsMarcStructureInternal Link Here
27
use C4::Contract qw( GetContract );
27
use C4::Contract qw( GetContract );
28
use C4::Log qw( logaction );
28
use C4::Log qw( logaction );
29
use C4::Templates qw(gettemplate);
29
use C4::Templates qw(gettemplate);
30
use Koha::DateUtils qw( dt_from_string output_pref );
30
use Koha::DateUtils qw( dt_from_string );
31
use Koha::Acquisition::Baskets;
31
use Koha::Acquisition::Baskets;
32
use Koha::Acquisition::Booksellers;
32
use Koha::Acquisition::Booksellers;
33
use Koha::Acquisition::Orders;
33
use Koha::Acquisition::Orders;
Lines 1372-1384 sub ModReceiveOrder { Link Here
1372
    my $received_items = $params->{received_items};
1372
    my $received_items = $params->{received_items};
1373
1373
1374
    my $dbh = C4::Context->dbh;
1374
    my $dbh = C4::Context->dbh;
1375
    $datereceived = output_pref(
1375
    $datereceived = $datereceived ? dt_from_string( $datereceived ) : dt_from_string;
1376
        {
1376
    $datereceived = $datereceived->ymd;
1377
            dt => ( $datereceived ? dt_from_string( $datereceived ) : dt_from_string ),
1378
            dateformat => 'iso',
1379
            dateonly => 1,
1380
        }
1381
    );
1382
1377
1383
    my $suggestionid = GetSuggestionFromBiblionumber( $biblionumber );
1378
    my $suggestionid = GetSuggestionFromBiblionumber( $biblionumber );
1384
    if ($suggestionid) {
1379
    if ($suggestionid) {
Lines 2704-2710 sub CloseInvoice { Link Here
2704
2699
2705
Reopen an invoice
2700
Reopen an invoice
2706
2701
2707
Equivalent to ModInvoice(invoiceid => $invoiceid, closedate => output_pref({ dt=>dt_from_string, dateonly=>1, otputpref=>'iso' }))
2702
Equivalent to ModInvoice(invoiceid => $invoiceid, closedate => $closedate );
2708
2703
2709
=cut
2704
=cut
2710
2705
(-)a/C4/Barcodes/annual.pm (+1 lines)
Lines 24-29 use Carp qw( carp ); Link Here
24
24
25
use C4::Context;
25
use C4::Context;
26
26
27
# FIXME We should certainly remove output_pref from here
27
use Koha::DateUtils qw( dt_from_string output_pref );
28
use Koha::DateUtils qw( dt_from_string output_pref );
28
29
29
use vars qw(@ISA);
30
use vars qw(@ISA);
(-)a/C4/Barcodes/hbyymmincr.pm (+1 lines)
Lines 23-28 use Carp qw( carp ); Link Here
23
23
24
use C4::Context;
24
use C4::Context;
25
25
26
# FIXME We should certainly remove output_pref from here
26
use Koha::DateUtils qw( dt_from_string output_pref );
27
use Koha::DateUtils qw( dt_from_string output_pref );
27
28
28
use constant WIDTH => 4; # FIXME: too small for sizeable or multi-branch libraries?
29
use constant WIDTH => 4; # FIXME: too small for sizeable or multi-branch libraries?
(-)a/C4/Circulation.pm (-19 / +15 lines)
Lines 24-30 use POSIX qw( floor ); Link Here
24
use YAML::XS;
24
use YAML::XS;
25
use Encode;
25
use Encode;
26
26
27
use Koha::DateUtils qw( dt_from_string output_pref );
28
use C4::Context;
27
use C4::Context;
29
use C4::Stats qw( UpdateStats );
28
use C4::Stats qw( UpdateStats );
30
use C4::Reserves qw( CheckReserves CanItemBeReserved MoveReserve ModReserve ModReserveMinusPriority RevertWaitingStatus IsItemOnHoldAndFound IsAvailableForItemLevelRequest ItemsAnyAvailableAndNotRestricted );
29
use C4::Reserves qw( CheckReserves CanItemBeReserved MoveReserve ModReserve ModReserveMinusPriority RevertWaitingStatus IsItemOnHoldAndFound IsAvailableForItemLevelRequest ItemsAnyAvailableAndNotRestricted );
Lines 43-49 use Koha::Account; Link Here
43
use Koha::AuthorisedValues;
42
use Koha::AuthorisedValues;
44
use Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue;
43
use Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue;
45
use Koha::Biblioitems;
44
use Koha::Biblioitems;
46
use Koha::DateUtils qw( dt_from_string output_pref );
45
use Koha::DateUtils qw( dt_from_string );
47
use Koha::Calendar;
46
use Koha::Calendar;
48
use Koha::Checkouts;
47
use Koha::Checkouts;
49
use Koha::Illrequests;
48
use Koha::Illrequests;
Lines 798-804 sub CanBookBeIssued { Link Here
798
    my $now = dt_from_string();
797
    my $now = dt_from_string();
799
    $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron_unblessed );
798
    $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron_unblessed );
800
    if (DateTime->compare($duedate,$now) == -1 ) { # duedate cannot be before now
799
    if (DateTime->compare($duedate,$now) == -1 ) { # duedate cannot be before now
801
         $needsconfirmation{INVALID_DATE} = output_pref($duedate);
800
         $needsconfirmation{INVALID_DATE} = $duedate;
802
    }
801
    }
803
802
804
    my $fees = Koha::Charges::Fees->new(
803
    my $fees = Koha::Charges::Fees->new(
Lines 1235-1253 sub CanBookBeIssued { Link Here
1235
        my $check = checkHighHolds( $item_object, $patron );
1234
        my $check = checkHighHolds( $item_object, $patron );
1236
1235
1237
        if ( $check->{exceeded} ) {
1236
        if ( $check->{exceeded} ) {
1237
            my $highholds = {
1238
                num_holds  => $check->{outstanding},
1239
                duration   => $check->{duration},
1240
                returndate => $check->{due_date},
1241
            };
1238
            if ($override_high_holds) {
1242
            if ($override_high_holds) {
1239
                $alerts{HIGHHOLDS} = {
1243
                $alerts{HIGHHOLDS} = $highholds;
1240
                    num_holds  => $check->{outstanding},
1241
                    duration   => $check->{duration},
1242
                    returndate => output_pref( { dt => dt_from_string($check->{due_date}), dateformat => 'iso', timeformat => '24hr' }),
1243
                };
1244
            }
1244
            }
1245
            else {
1245
            else {
1246
                $needsconfirmation{HIGHHOLDS} = {
1246
                $needsconfirmation{HIGHHOLDS} = $highholds;
1247
                    num_holds  => $check->{outstanding},
1248
                    duration   => $check->{duration},
1249
                    returndate => output_pref( { dt => dt_from_string($check->{due_date}), dateformat => 'iso', timeformat => '24hr' }),
1250
                };
1251
            }
1247
            }
1252
        }
1248
        }
1253
    }
1249
    }
Lines 1462-1469 Calculated if empty. Link Here
1462
1458
1463
=item C<$cancelreserve> is 1 to override and cancel any pending reserves for the item (optional).
1459
=item C<$cancelreserve> is 1 to override and cancel any pending reserves for the item (optional).
1464
1460
1465
=item C<$issuedate> is the date to issue the item in iso (YYYY-MM-DD) format (optional).
1461
=item C<$issuedate> is a DateTime object for the date to issue the item (optional).
1466
Defaults to today.  Unlike C<$datedue>, NOT a DateTime object, unfortunately.
1462
Defaults to today.
1467
1463
1468
AddIssue does the following things :
1464
AddIssue does the following things :
1469
1465
Lines 1635-1642 sub AddIssue { Link Here
1635
1631
1636
            my $issue_attributes = {
1632
            my $issue_attributes = {
1637
                borrowernumber  => $borrower->{'borrowernumber'},
1633
                borrowernumber  => $borrower->{'borrowernumber'},
1638
                issuedate       => $issuedate->strftime('%Y-%m-%d %H:%M:%S'),
1634
                issuedate       => $issuedate,
1639
                date_due        => $datedue->strftime('%Y-%m-%d %H:%M:%S'),
1635
                date_due        => $datedue,
1640
                branchcode      => C4::Context->userenv->{'branch'},
1636
                branchcode      => C4::Context->userenv->{'branch'},
1641
                onsite_checkout => $onsite_checkout,
1637
                onsite_checkout => $onsite_checkout,
1642
                auto_renew      => $auto_renew ? 1 : 0,
1638
                auto_renew      => $auto_renew ? 1 : 0,
Lines 4417-4423 sub _CalculateAndUpdateFine { Link Here
4417
                itemnumber     => $issue->itemnumber,
4413
                itemnumber     => $issue->itemnumber,
4418
                borrowernumber => $issue->borrowernumber,
4414
                borrowernumber => $issue->borrowernumber,
4419
                amount         => $amount,
4415
                amount         => $amount,
4420
                due            => output_pref($datedue),
4416
                due            => $datedue,
4421
            });
4417
            });
4422
        }
4418
        }
4423
        elsif ($return_date) {
4419
        elsif ($return_date) {
Lines 4430-4436 sub _CalculateAndUpdateFine { Link Here
4430
                itemnumber     => $issue->itemnumber,
4426
                itemnumber     => $issue->itemnumber,
4431
                borrowernumber => $issue->borrowernumber,
4427
                borrowernumber => $issue->borrowernumber,
4432
                amount         => 0,
4428
                amount         => 0,
4433
                due            => output_pref($datedue),
4429
                due            => $datedue,
4434
            });
4430
            });
4435
        }
4431
        }
4436
    }
4432
    }
(-)a/C4/ILSDI/Services.pm (-18 / +5 lines)
Lines 698-703 sub RenewLoan { Link Here
698
    # Hashref building
698
    # Hashref building
699
    my $out;
699
    my $out;
700
    $out->{'renewals'} = $issue->renewals_count;
700
    $out->{'renewals'} = $issue->renewals_count;
701
    # FIXME Unusual date formatting
701
    $out->{date_due}   = dt_from_string($issue->date_due)->strftime('%Y-%m-%d %H:%M');
702
    $out->{date_due}   = dt_from_string($issue->date_due)->strftime('%Y-%m-%d %H:%M');
702
    $out->{'success'}  = $renewal[0];
703
    $out->{'success'}  = $renewal[0];
703
    $out->{'error'}    = $renewal[1];
704
    $out->{'error'}    = $renewal[1];
Lines 778-792 sub HoldTitle { Link Here
778
    return { code => 'libraryNotPickupLocation' } unless $destination->pickup_location;
779
    return { code => 'libraryNotPickupLocation' } unless $destination->pickup_location;
779
    return { code => 'cannotBeTransferred' } unless $biblio->can_be_transferred({ to => $destination });
780
    return { code => 'cannotBeTransferred' } unless $biblio->can_be_transferred({ to => $destination });
780
781
781
    my $resdate;
782
    my $resdate = $cgi->param('start_date');
782
    if ( $cgi->param('start_date') ) {
783
    my $expdate = $cgi->param('expiry_date');
783
        $resdate = $cgi->param('start_date');
784
    }
785
786
    my $expdate;
787
    if ( $cgi->param('expiry_date') ) {
788
        $expdate = $cgi->param('expiry_date');
789
    }
790
784
791
    # Add the reserve
785
    # Add the reserve
792
    #    $branch,    $borrowernumber, $biblionumber,
786
    #    $branch,    $borrowernumber, $biblionumber,
Lines 880-894 sub HoldItem { Link Here
880
    my $canitembereserved = C4::Reserves::CanItemBeReserved( $patron, $item, $branch )->{status};
874
    my $canitembereserved = C4::Reserves::CanItemBeReserved( $patron, $item, $branch )->{status};
881
    return { code => $canitembereserved } unless $canitembereserved eq 'OK';
875
    return { code => $canitembereserved } unless $canitembereserved eq 'OK';
882
876
883
    my $resdate;
877
    my $resdate = $cgi->param('start_date');
884
    if ( $cgi->param('start_date') ) {
878
    my $expdate = $cgi->param('expiry_date');
885
        $resdate = $cgi->param('start_date');
886
    }
887
888
    my $expdate;
889
    if ( $cgi->param('expiry_date') ) {
890
        $expdate = $cgi->param('expiry_date');
891
    }
892
879
893
    # Add the reserve
880
    # Add the reserve
894
    my $priority = C4::Reserves::CalculatePriority($biblionumber);
881
    my $priority = C4::Reserves::CalculatePriority($biblionumber);
(-)a/C4/Items.pm (-6 / +2 lines)
Lines 52-58 use Carp qw( croak ); Link Here
52
use C4::Context;
52
use C4::Context;
53
use C4::Koha;
53
use C4::Koha;
54
use C4::Biblio qw( GetMarcStructure TransformMarcToKoha );
54
use C4::Biblio qw( GetMarcStructure TransformMarcToKoha );
55
use Koha::DateUtils qw( dt_from_string output_pref );
56
use MARC::Record;
55
use MARC::Record;
57
use C4::ClassSource qw( GetClassSort GetClassSources GetClassSource );
56
use C4::ClassSource qw( GetClassSort GetClassSources GetClassSource );
58
use C4::Log qw( logaction );
57
use C4::Log qw( logaction );
Lines 61-67 use DateTime::Format::MySQL; Link Here
61
                  # debugging; so please don't remove this
60
                  # debugging; so please don't remove this
62
61
63
use Koha::AuthorisedValues;
62
use Koha::AuthorisedValues;
64
use Koha::DateUtils qw( dt_from_string output_pref );
63
use Koha::DateUtils qw( dt_from_string );
65
use Koha::Database;
64
use Koha::Database;
66
65
67
use Koha::Biblioitems;
66
use Koha::Biblioitems;
Lines 403-412 The last optional parameter allows for passing skip_record_index through to the Link Here
403
sub ModDateLastSeen {
402
sub ModDateLastSeen {
404
    my ( $itemnumber, $leave_item_lost, $params ) = @_;
403
    my ( $itemnumber, $leave_item_lost, $params ) = @_;
405
404
406
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
407
408
    my $item = Koha::Items->find($itemnumber);
405
    my $item = Koha::Items->find($itemnumber);
409
    $item->datelastseen($today);
406
    $item->datelastseen(dt_from_string);
410
    $item->itemlost(0) unless $leave_item_lost;
407
    $item->itemlost(0) unless $leave_item_lost;
411
    $item->store({ log_action => 0, skip_record_index => $params->{skip_record_index}, skip_holds_queue => $params->{skip_holds_queue} });
408
    $item->store({ log_action => 0, skip_record_index => $params->{skip_record_index}, skip_holds_queue => $params->{skip_holds_queue} });
412
}
409
}
Lines 587-593 sub GetItemsForInventory { Link Here
587
    }
584
    }
588
585
589
    if ($datelastseen) {
586
    if ($datelastseen) {
590
        $datelastseen = output_pref({ str => $datelastseen, dateformat => 'iso', dateonly => 1 });
591
        push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)';
587
        push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)';
592
        push @bind_params, $datelastseen;
588
        push @bind_params, $datelastseen;
593
    }
589
    }
(-)a/C4/Letters.pm (-1 / +1 lines)
Lines 29-35 use C4::Members; Link Here
29
use C4::Log qw( logaction );
29
use C4::Log qw( logaction );
30
use C4::SMS;
30
use C4::SMS;
31
use C4::Templates;
31
use C4::Templates;
32
use Koha::DateUtils qw( dt_from_string output_pref );
33
use Koha::SMS::Providers;
32
use Koha::SMS::Providers;
34
33
35
use Koha::Email;
34
use Koha::Email;
Lines 783-788 sub _parseletter { Link Here
783
    # in callers ( by changing / formatting values )
782
    # in callers ( by changing / formatting values )
784
    my $values = $values_in ? { %$values_in } : {};
783
    my $values = $values_in ? { %$values_in } : {};
785
784
785
    # FIXME Dates formatting must be done in notice's templates
786
    if ( $table eq 'borrowers' && $values->{'dateexpiry'} ){
786
    if ( $table eq 'borrowers' && $values->{'dateexpiry'} ){
787
        $values->{'dateexpiry'} = output_pref({ dt => dt_from_string( $values->{'dateexpiry'} ), dateonly => 1 });
787
        $values->{'dateexpiry'} = output_pref({ dt => dt_from_string( $values->{'dateexpiry'} ), dateonly => 1 });
788
    }
788
    }
(-)a/C4/Members.pm (+1 lines)
Lines 596-601 sub IssueSlip { Link Here
596
596
597
            # FIXME We keep newdate and timestamp for backward compatibility (from GetNewsToDisplay)
597
            # FIXME We keep newdate and timestamp for backward compatibility (from GetNewsToDisplay)
598
            # But we should remove them and adjust the existing templates in a db rev
598
            # But we should remove them and adjust the existing templates in a db rev
599
            # FIXME This must be formatted in the notice template
599
            my $published_on_dt = output_pref({ dt => dt_from_string( $all->{published_on} ), dateonly => 1 });
600
            my $published_on_dt = output_pref({ dt => dt_from_string( $all->{published_on} ), dateonly => 1 });
600
            $all->{newdate} = $published_on_dt;
601
            $all->{newdate} = $published_on_dt;
601
            $all->{timestamp} = $published_on_dt;
602
            $all->{timestamp} = $published_on_dt;
(-)a/C4/Overdues.pm (-3 / +3 lines)
Lines 31-36 use C4::Accounts; Link Here
31
use C4::Context;
31
use C4::Context;
32
use Koha::Account::Lines;
32
use Koha::Account::Lines;
33
use Koha::Account::Offsets;
33
use Koha::Account::Offsets;
34
use Koha::DateUtils qw( output_pref );
34
use Koha::Libraries;
35
use Koha::Libraries;
35
use Koha::Recalls;
36
use Koha::Recalls;
36
use Koha::Logger;
37
use Koha::Logger;
Lines 512-518 has the book on loan. Link Here
512
513
513
C<$amount> is the current amount owed by the patron.
514
C<$amount> is the current amount owed by the patron.
514
515
515
C<$due> is the due date formatted to the currently specified date format
516
C<$due> is the date
516
517
517
C<&UpdateFine> looks up the amount currently owed on the given item
518
C<&UpdateFine> looks up the amount currently owed on the given item
518
and sets it to C<$amount>, creating, if necessary, a new entry in the
519
and sets it to C<$amount>, creating, if necessary, a new entry in the
Lines 552-558 sub UpdateFine { Link Here
552
553
553
    my $accountline;
554
    my $accountline;
554
    my $total_amount_other = 0.00;
555
    my $total_amount_other = 0.00;
555
    my $due_qr = qr/$due/;
556
    # Cycle through the fines and
556
    # Cycle through the fines and
557
    # - find line that relates to the requested $itemnum
557
    # - find line that relates to the requested $itemnum
558
    # - accumulate fines for other items
558
    # - accumulate fines for other items
Lines 610-616 sub UpdateFine { Link Here
610
                    items     => $itemnum,
610
                    items     => $itemnum,
611
                },
611
                },
612
            ) };
612
            ) };
613
            my $desc = $letter ? $letter->{content} : "Item $itemnum - due $due";
613
            my $desc = $letter ? $letter->{content} : sprintf("Item %s - due %s", $itemnum, output_pref($due) );
614
614
615
            my $account = Koha::Account->new({ patron_id => $borrowernumber });
615
            my $account = Koha::Account->new({ patron_id => $borrowernumber });
616
            $accountline = $account->add_debit(
616
            $accountline = $account->add_debit(
(-)a/C4/Reports/Guided.pm (-2 / +1 lines)
Lines 25-31 use JSON qw( from_json ); Link Here
25
use C4::Context;
25
use C4::Context;
26
use C4::Templates qw/themelanguage/;
26
use C4::Templates qw/themelanguage/;
27
use C4::Koha qw( GetAuthorisedValues );
27
use C4::Koha qw( GetAuthorisedValues );
28
use Koha::DateUtils qw( dt_from_string output_pref );
28
use Koha::DateUtils qw( dt_from_string );
29
use Koha::Patrons;
29
use Koha::Patrons;
30
use Koha::Reports;
30
use Koha::Reports;
31
use C4::Output;
31
use C4::Output;
Lines 753-759 sub get_saved_reports { Link Here
753
    my (@cond,@args);
753
    my (@cond,@args);
754
    if ($filter) {
754
    if ($filter) {
755
        if (my $date = $filter->{date}) {
755
        if (my $date = $filter->{date}) {
756
            $date = eval { output_pref( { dt => dt_from_string( $date ), dateonly => 1, dateformat => 'iso' }); };
757
            push @cond, "DATE(last_modified) = ? OR
756
            push @cond, "DATE(last_modified) = ? OR
758
                         DATE(last_run) = ?";
757
                         DATE(last_run) = ?";
759
            push @args, $date, $date;
758
            push @args, $date, $date;
(-)a/C4/Reserves.pm (-12 / +3 lines)
Lines 38-44 use Koha::Biblios; Link Here
38
use Koha::Calendar;
38
use Koha::Calendar;
39
use Koha::CirculationRules;
39
use Koha::CirculationRules;
40
use Koha::Database;
40
use Koha::Database;
41
use Koha::DateUtils qw( dt_from_string output_pref );
41
use Koha::DateUtils qw( dt_from_string );
42
use Koha::Hold;
42
use Koha::Hold;
43
use Koha::Holds;
43
use Koha::Holds;
44
use Koha::ItemTypes;
44
use Koha::ItemTypes;
Lines 194-203 sub AddReserve { Link Here
194
    my $itemtype       = $params->{itemtype};
194
    my $itemtype       = $params->{itemtype};
195
    my $non_priority   = $params->{non_priority};
195
    my $non_priority   = $params->{non_priority};
196
196
197
    $resdate = output_pref( { str => dt_from_string( $resdate ), dateonly => 1, dateformat => 'iso' })
197
    $resdate ||= dt_from_string;
198
        or output_pref({ dt => dt_from_string, dateonly => 1, dateformat => 'iso' });
199
200
    $patron_expiration_date = output_pref({ str => $patron_expiration_date, dateonly => 1, dateformat => 'iso' });
201
198
202
    # if we have an item selectionned, and the pickup branch is the same as the holdingbranch
199
    # if we have an item selectionned, and the pickup branch is the same as the holdingbranch
203
    # of the document, we force the value $priority and $found .
200
    # of the document, we force the value $priority and $found .
Lines 1123-1129 sub ModReserve { Link Here
1123
            if C4::Context->preference('HoldsLog');
1120
            if C4::Context->preference('HoldsLog');
1124
1121
1125
        # The only column that can be updated for a found hold is the expiration date
1122
        # The only column that can be updated for a found hold is the expiration date
1126
        $hold->expirationdate(dt_from_string($date))->store();
1123
        $hold->expirationdate($date)->store();
1127
    }
1124
    }
1128
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1125
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1129
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
1126
        logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
Lines 1147-1153 sub ModReserve { Link Here
1147
1144
1148
        if ( defined( $suspend_until ) ) {
1145
        if ( defined( $suspend_until ) ) {
1149
            if ( $suspend_until ) {
1146
            if ( $suspend_until ) {
1150
                $suspend_until = eval { dt_from_string( $suspend_until ) };
1151
                $hold->suspend_hold( $suspend_until );
1147
                $hold->suspend_hold( $suspend_until );
1152
            } else {
1148
            } else {
1153
                # If the hold is suspended leave the hold suspended, but convert it to an indefinite hold.
1149
                # If the hold is suspended leave the hold suspended, but convert it to an indefinite hold.
Lines 1520-1527 be cleared when it is unsuspended. Link Here
1520
sub ToggleSuspend {
1516
sub ToggleSuspend {
1521
    my ( $reserve_id, $suspend_until ) = @_;
1517
    my ( $reserve_id, $suspend_until ) = @_;
1522
1518
1523
    $suspend_until = dt_from_string($suspend_until) if ($suspend_until);
1524
1525
    my $hold = Koha::Holds->find( $reserve_id );
1519
    my $hold = Koha::Holds->find( $reserve_id );
1526
1520
1527
    if ( $hold->is_suspended ) {
1521
    if ( $hold->is_suspended ) {
Lines 1555-1563 sub SuspendAll { Link Here
1555
    my $suspend_until  = $params{'suspend_until'}  || undef;
1549
    my $suspend_until  = $params{'suspend_until'}  || undef;
1556
    my $suspend = defined( $params{'suspend'} ) ? $params{'suspend'} : 1;
1550
    my $suspend = defined( $params{'suspend'} ) ? $params{'suspend'} : 1;
1557
1551
1558
    $suspend_until = eval { dt_from_string($suspend_until) }
1559
      if ( defined($suspend_until) );
1560
1561
    return unless ( $borrowernumber || $biblionumber );
1552
    return unless ( $borrowernumber || $biblionumber );
1562
1553
1563
    my $params;
1554
    my $params;
(-)a/C4/Search/History.pm (+1 lines)
Lines 51-56 sub add_to_session { Link Here
51
        query_cgi  => $query_cgi,
51
        query_cgi  => $query_cgi,
52
        total      => "$total",
52
        total      => "$total",
53
        type       => $type,
53
        type       => $type,
54
        # FIXME We shouldn't store the formatted date
54
        time       => output_pref( { dt => $now, dateformat => 'iso', timeformat => '24hr' } ),
55
        time       => output_pref( { dt => $now, dateformat => 'iso', timeformat => '24hr' } ),
55
        id         => $id,
56
        id         => $id,
56
    };
57
    };
(-)a/C4/Serials.pm (-45 lines)
Lines 37-43 use C4::Log qw( logaction ); # logaction Link Here
37
use C4::Serials::Frequency qw( GetSubscriptionFrequency );
37
use C4::Serials::Frequency qw( GetSubscriptionFrequency );
38
use C4::Serials::Numberpattern;
38
use C4::Serials::Numberpattern;
39
use Koha::AdditionalFieldValues;
39
use Koha::AdditionalFieldValues;
40
use Koha::DateUtils qw( dt_from_string output_pref );
41
use Koha::Serial;
40
use Koha::Serial;
42
use Koha::Subscriptions;
41
use Koha::Subscriptions;
43
use Koha::Subscription::Histories;
42
use Koha::Subscription::Histories;
Lines 426-448 sub GetSubscriptionsFromBiblionumber { Link Here
426
    $sth->execute($biblionumber);
425
    $sth->execute($biblionumber);
427
    my @res;
426
    my @res;
428
    while ( my $subs = $sth->fetchrow_hashref ) {
427
    while ( my $subs = $sth->fetchrow_hashref ) {
429
        $subs->{startdate}     = output_pref( { dt => dt_from_string( $subs->{startdate} ),     dateonly => 1 } );
430
        $subs->{histstartdate} = output_pref( { dt => dt_from_string( $subs->{histstartdate} ), dateonly => 1 } );
431
        if ( defined $subs->{histenddate} ) {
432
           $subs->{histenddate}   = output_pref( { dt => dt_from_string( $subs->{histenddate} ),   dateonly => 1 } );
433
        } else {
434
            $subs->{histenddate} = "";
435
        }
436
        $subs->{opacnote}     //= "";
428
        $subs->{opacnote}     //= "";
437
        $subs->{ "periodicity" . $subs->{periodicity} }     = 1;
429
        $subs->{ "periodicity" . $subs->{periodicity} }     = 1;
438
        $subs->{ "numberpattern" . $subs->{numberpattern} } = 1;
430
        $subs->{ "numberpattern" . $subs->{numberpattern} } = 1;
439
        $subs->{ "status" . $subs->{'status'} }             = 1;
431
        $subs->{ "status" . $subs->{'status'} }             = 1;
440
432
441
        if (not defined $subs->{enddate} ) {
442
            $subs->{enddate} = '';
443
        } else {
444
            $subs->{enddate} = output_pref( { dt => dt_from_string( $subs->{enddate}), dateonly => 1 } );
445
        }
446
        $subs->{'abouttoexpire'}       = abouttoexpire( $subs->{'subscriptionid'} );
433
        $subs->{'abouttoexpire'}       = abouttoexpire( $subs->{'subscriptionid'} );
447
        $subs->{'subscriptionexpired'} = HasSubscriptionExpired( $subs->{'subscriptionid'} );
434
        $subs->{'subscriptionexpired'} = HasSubscriptionExpired( $subs->{'subscriptionid'} );
448
        $subs->{cannotedit} = not can_edit_subscription( $subs );
435
        $subs->{cannotedit} = not can_edit_subscription( $subs );
Lines 676-688 sub GetSerials { Link Here
676
663
677
    while ( my $line = $sth->fetchrow_hashref ) {
664
    while ( my $line = $sth->fetchrow_hashref ) {
678
        $line->{ "status" . $line->{status} } = 1;                                         # fills a "statusX" value, used for template status select list
665
        $line->{ "status" . $line->{status} } = 1;                                         # fills a "statusX" value, used for template status select list
679
        for my $datefield ( qw( planneddate publisheddate) ) {
680
            if ($line->{$datefield} && $line->{$datefield}!~m/^00/) {
681
                $line->{$datefield} =  output_pref( { dt => dt_from_string( $line->{$datefield} ), dateonly => 1 } );
682
            } else {
683
                $line->{$datefield} = q{};
684
            }
685
        }
686
        push @serials, $line;
666
        push @serials, $line;
687
    }
667
    }
688
668
Lines 699-711 sub GetSerials { Link Here
699
    while ( ( my $line = $sth->fetchrow_hashref ) && $counter < $count ) {
679
    while ( ( my $line = $sth->fetchrow_hashref ) && $counter < $count ) {
700
        $counter++;
680
        $counter++;
701
        $line->{ "status" . $line->{status} } = 1;                                         # fills a "statusX" value, used for template status select list
681
        $line->{ "status" . $line->{status} } = 1;                                         # fills a "statusX" value, used for template status select list
702
        for my $datefield ( qw( planneddate publisheddate) ) {
703
            if ($line->{$datefield} && $line->{$datefield}!~m/^00/) {
704
                $line->{$datefield} = output_pref( { dt => dt_from_string( $line->{$datefield} ), dateonly => 1 } );
705
            } else {
706
                $line->{$datefield} = q{};
707
            }
708
        }
709
682
710
        push @serials, $line;
683
        push @serials, $line;
711
    }
684
    }
Lines 750-764 sub GetSerials2 { Link Here
750
723
751
    while ( my $line = $sth->fetchrow_hashref ) {
724
    while ( my $line = $sth->fetchrow_hashref ) {
752
        $line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list
725
        $line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list
753
        # Format dates for display
754
        for my $datefield ( qw( planneddate publisheddate ) ) {
755
            if (!defined($line->{$datefield}) || $line->{$datefield} =~m/^00/) {
756
                $line->{$datefield} = q{};
757
            }
758
            else {
759
                $line->{$datefield} = output_pref( { dt => dt_from_string( $line->{$datefield} ), dateonly => 1 } );
760
            }
761
        }
762
        push @serials, $line;
726
        push @serials, $line;
763
    }
727
    }
764
    return @serials;
728
    return @serials;
Lines 1899-1913 sub GetLateOrMissingIssues { Link Here
1899
    $sth->execute( EXPECTED, LATE, CLAIMED );
1863
    $sth->execute( EXPECTED, LATE, CLAIMED );
1900
    my @issuelist;
1864
    my @issuelist;
1901
    while ( my $line = $sth->fetchrow_hashref ) {
1865
    while ( my $line = $sth->fetchrow_hashref ) {
1902
1903
        if ($line->{planneddate} && $line->{planneddate} !~/^0+\-/) {
1904
            $line->{planneddateISO} = $line->{planneddate};
1905
            $line->{planneddate} = output_pref( { dt => dt_from_string( $line->{"planneddate"} ), dateonly => 1 } );
1906
        }
1907
        if ($line->{claimdate} && $line->{claimdate} !~/^0+\-/) {
1908
            $line->{claimdateISO} = $line->{claimdate};
1909
            $line->{claimdate}   = output_pref( { dt => dt_from_string( $line->{"claimdate"} ), dateonly => 1 } );
1910
        }
1911
        $line->{"status".$line->{status}}   = 1;
1866
        $line->{"status".$line->{status}}   = 1;
1912
1867
1913
        my $subscription_object = Koha::Subscriptions->find($line->{subscriptionid});
1868
        my $subscription_object = Koha::Subscriptions->find($line->{subscriptionid});
(-)a/Koha/Hold.pm (-3 / +3 lines)
Lines 82-95 sub age { Link Here
82
82
83
=head3 suspend_hold
83
=head3 suspend_hold
84
84
85
my $hold = $hold->suspend_hold( $suspend_until_dt );
85
my $hold = $hold->suspend_hold( $suspend_until );
86
86
87
=cut
87
=cut
88
88
89
sub suspend_hold {
89
sub suspend_hold {
90
    my ( $self, $dt ) = @_;
90
    my ( $self, $date ) = @_;
91
91
92
    my $date = $dt ? $dt->clone()->truncate( to => 'day' )->datetime : undef;
92
    $date &&= dt_from_string($date)->truncate( to => 'day' )->datetime;
93
93
94
    if ( $self->is_found ) {    # We can't suspend found holds
94
    if ( $self->is_found ) {    # We can't suspend found holds
95
        if ( $self->is_waiting ) {
95
        if ( $self->is_waiting ) {
(-)a/Koha/Item.pm (-5 / +1 lines)
Lines 163-173 sub store { Link Here
163
                && !$pre_mod_item->$field )
163
                && !$pre_mod_item->$field )
164
            {
164
            {
165
                my $field_on = "${field}_on";
165
                my $field_on = "${field}_on";
166
                $self->$field_on(
166
                $self->$field_on(dt_from_string);
167
                    DateTime::Format::MySQL->format_datetime(
168
                        dt_from_string()
169
                    )
170
                );
171
            }
167
            }
172
        }
168
        }
173
169
(-)a/Koha/Patrons/Import.pm (+1 lines)
Lines 57-62 Further pod documentation needed here. Link Here
57
=cut
57
=cut
58
58
59
has 'today_iso' => ( is => 'ro', lazy => 1,
59
has 'today_iso' => ( is => 'ro', lazy => 1,
60
    # FIXME We shouldn't need to call output_pref here, passing a DateTime object should work
60
    default => sub { output_pref( { dt => dt_from_string(), dateonly => 1, dateformat => 'iso' } ); }, );
61
    default => sub { output_pref( { dt => dt_from_string(), dateonly => 1, dateformat => 'iso' } ); }, );
61
62
62
has 'text_csv' => ( is => 'rw', lazy => 1,
63
has 'text_csv' => ( is => 'rw', lazy => 1,
(-)a/Koha/REST/V1/Clubs/Holds.pm (-6 lines)
Lines 26-32 use Koha::Patrons; Link Here
26
use Koha::Holds;
26
use Koha::Holds;
27
use Koha::Clubs;
27
use Koha::Clubs;
28
use Koha::Club::Hold;
28
use Koha::Club::Hold;
29
use Koha::DateUtils qw( dt_from_string output_pref );
30
29
31
use Scalar::Util qw( blessed );
30
use Scalar::Util qw( blessed );
32
use Try::Tiny qw( catch try );
31
use Try::Tiny qw( catch try );
Lines 103-113 sub add { Link Here
103
            );
102
            );
104
        }
103
        }
105
104
106
        # AddReserve expects date to be in syspref format
107
        if ($expiration_date) {
108
            $expiration_date = output_pref( dt_from_string( $expiration_date, 'rfc3339' ) );
109
        }
110
111
        my $club_hold = Koha::Club::Hold::add(
105
        my $club_hold = Koha::Club::Hold::add(
112
            {
106
            {
113
                club_id             => $club_id,
107
                club_id             => $club_id,
(-)a/Koha/REST/V1/Holds.pm (-26 / +8 lines)
Lines 26-32 use C4::Reserves; Link Here
26
use Koha::Items;
26
use Koha::Items;
27
use Koha::Patrons;
27
use Koha::Patrons;
28
use Koha::Holds;
28
use Koha::Holds;
29
use Koha::DateUtils qw( dt_from_string output_pref );
29
use Koha::DateUtils qw( dt_from_string );
30
30
31
use List::MoreUtils qw( any );
31
use List::MoreUtils qw( any );
32
use Try::Tiny qw( catch try );
32
use Try::Tiny qw( catch try );
Lines 183-193 sub add { Link Here
183
183
184
        my $priority = C4::Reserves::CalculatePriority($biblio_id);
184
        my $priority = C4::Reserves::CalculatePriority($biblio_id);
185
185
186
        # AddReserve expects date to be in syspref format
187
        if ($expiration_date) {
188
            $expiration_date = output_pref( { dt => dt_from_string($expiration_date, 'iso'), dateformat => 'iso', dateonly => 1 } );
189
        }
190
191
        my $hold_id = C4::Reserves::AddReserve(
186
        my $hold_id = C4::Reserves::AddReserve(
192
            {
187
            {
193
                branchcode       => $pickup_library_id,
188
                branchcode       => $pickup_library_id,
Lines 280-298 sub edit { Link Here
280
        $pickup_library_id //= $hold->branchcode;
275
        $pickup_library_id //= $hold->branchcode;
281
        my $priority         = $body->{priority} // $hold->priority;
276
        my $priority         = $body->{priority} // $hold->priority;
282
        # suspended_until can also be set to undef
277
        # suspended_until can also be set to undef
283
        my $suspended_until =
278
        my $suspended_until = $body->{suspended_until} || $hold->suspend_until;
284
          exists $body->{suspended_until}
285
          ? dt_from_string( $body->{suspended_until}, 'rfc3339' )
286
          : $hold->suspend_until     && dt_from_string( $hold->suspend_until,     'iso' );
287
279
288
        my $params = {
280
        my $params = {
289
            reserve_id    => $hold_id,
281
            reserve_id    => $hold_id,
290
            branchcode    => $pickup_library_id,
282
            branchcode    => $pickup_library_id,
291
            rank          => $priority,
283
            rank          => $priority,
292
            suspend_until => $suspended_until
284
            suspend_until => $suspended_until,
293
              ? output_pref({ dt => $suspended_until, dateformat => 'iso', dateonly => 1 })
285
            itemnumber    => $hold->itemnumber,
294
              : '',
295
            itemnumber    => $hold->itemnumber
296
        };
286
        };
297
287
298
        C4::Reserves::ModReserve($params);
288
        C4::Reserves::ModReserve($params);
Lines 356-378 sub suspend { Link Here
356
    }
346
    }
357
347
358
    return try {
348
    return try {
359
        my $date = ($end_date) ? dt_from_string( $end_date, 'iso' ) : undef;
349
        $hold->suspend_hold($end_date);
360
        $hold->suspend_hold($date);
361
        $hold->discard_changes;
350
        $hold->discard_changes;
362
        $c->res->headers->location( $c->req->url->to_string );
351
        $c->res->headers->location( $c->req->url->to_string );
363
        my $suspend_end_date;
352
364
        if ($hold->suspend_until) {
353
        my $suspend_until = $end_date ? dt_from_string($hold->suspend_until)->ymd : undef;
365
            $suspend_end_date = output_pref({
366
                dt         => dt_from_string( $hold->suspend_until, 'iso' ),
367
                dateformat => 'iso',
368
                dateonly   => 1
369
                }
370
            );
371
        }
372
        return $c->render(
354
        return $c->render(
373
            status  => 201,
355
            status  => 201,
374
            openapi => {
356
            openapi => {
375
                end_date => $suspend_end_date
357
                end_date => $suspend_until,
376
            }
358
            }
377
        );
359
        );
378
    }
360
    }
(-)a/Koha/Report.pm (-10 / +10 lines)
Lines 20-26 use Modern::Perl; Link Here
20
20
21
use Koha::Database;
21
use Koha::Database;
22
use Koha::Reports;
22
use Koha::Reports;
23
use Koha::DateUtils qw( dt_from_string output_pref );
23
#use Koha::DateUtils qw( dt_from_string output_pref );
24
24
25
use base qw(Koha::Object);
25
use base qw(Koha::Object);
26
#
26
#
Lines 159-173 sub prep_report { Link Here
159
159
160
        # if there are special regexp chars, we must \ them
160
        # if there are special regexp chars, we must \ them
161
        $split[ $i * 2 + 1 ] =~ s/(\||\?|\.|\*|\(|\)|\%)/\\$1/g;
161
        $split[ $i * 2 + 1 ] =~ s/(\||\?|\.|\*|\(|\)|\%)/\\$1/g;
162
        if ( $split[ $i * 2 + 1 ] =~ /\|\s*date\s*$/ ) {
162
        #if ( $split[ $i * 2 + 1 ] =~ /\|\s*date\s*$/ ) {
163
            $quoted = output_pref(
163
        #    $quoted = output_pref(
164
                {
164
        #        {
165
                    dt         => dt_from_string($quoted),
165
        #            dt         => dt_from_string($quoted),
166
                    dateformat => 'iso',
166
        #            dateformat => 'iso',
167
                    dateonly   => 1
167
        #            dateonly   => 1
168
                }
168
        #        }
169
            ) if $quoted;
169
        #    ) if $quoted;
170
        }
170
        #}
171
        unless ( $split[ $i * 2 + 1 ] =~ /\|\s*list\s*$/ && $quoted ) {
171
        unless ( $split[ $i * 2 + 1 ] =~ /\|\s*list\s*$/ && $quoted ) {
172
            $quoted = C4::Context->dbh->quote($quoted);
172
            $quoted = C4::Context->dbh->quote($quoted);
173
        }
173
        }
(-)a/acqui/duplicate_orders.pl (-5 / +3 lines)
Lines 28-34 use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget GetBudgetPerio Link Here
28
use Koha::Acquisition::Baskets;
28
use Koha::Acquisition::Baskets;
29
use Koha::Acquisition::Currencies;
29
use Koha::Acquisition::Currencies;
30
use Koha::Acquisition::Orders;
30
use Koha::Acquisition::Orders;
31
use Koha::DateUtils qw( dt_from_string output_pref );
31
use Koha::DateUtils qw( dt_from_string );
32
32
33
my $input    = CGI->new;
33
my $input    = CGI->new;
34
my $basketno = $input->param('basketno');
34
my $basketno = $input->param('basketno');
Lines 76-85 unless ( $input->param('from') ) { Link Here
76
    # Fill the form with year-1
76
    # Fill the form with year-1
77
    $from_placed_on->set_time_zone('floating')->subtract( years => 1 );
77
    $from_placed_on->set_time_zone('floating')->subtract( years => 1 );
78
}
78
}
79
$filters->{from_placed_on} =
79
$filters->{from_placed_on} = $from_placed_on;
80
  output_pref( { dt => $from_placed_on, dateformat => 'iso', dateonly => 1 } ),
80
$filters->{to_placed_on}   = $to_placed_on;
81
  $filters->{to_placed_on} =
82
  output_pref( { dt => $to_placed_on, dateformat => 'iso', dateonly => 1 } ),
83
81
84
  my ( @result_order_loop, @selected_order_loop );
82
  my ( @result_order_loop, @selected_order_loop );
85
my @ordernumbers = split ',', scalar $input->param('ordernumbers') || '';
83
my @ordernumbers = split ',', scalar $input->param('ordernumbers') || '';
(-)a/acqui/histsearch.pl (-3 / +3 lines)
Lines 55-61 use C4::Auth qw( get_template_and_user ); Link Here
55
use C4::Output qw( output_html_with_http_headers );
55
use C4::Output qw( output_html_with_http_headers );
56
use C4::Acquisition qw( GetHistory );
56
use C4::Acquisition qw( GetHistory );
57
use Koha::AdditionalFields;
57
use Koha::AdditionalFields;
58
use Koha::DateUtils qw( dt_from_string output_pref );
58
use Koha::DateUtils qw( dt_from_string );
59
59
60
my $input = CGI->new;
60
my $input = CGI->new;
61
my $do_search               = $input->param('do_search') || 0;
61
my $do_search               = $input->param('do_search') || 0;
Lines 97-104 unless ( $input->param('from') ) { Link Here
97
    # Fill the form with year-1
97
    # Fill the form with year-1
98
    $from_placed_on->set_time_zone('floating')->subtract( years => 1 );
98
    $from_placed_on->set_time_zone('floating')->subtract( years => 1 );
99
}
99
}
100
$filters->{from_placed_on} = output_pref( { dt => $from_placed_on, dateformat => 'iso', dateonly => 1 } );
100
$filters->{from_placed_on} = $from_placed_on;
101
$filters->{to_placed_on} = output_pref( { dt => $to_placed_on, dateformat => 'iso', dateonly => 1 } );
101
$filters->{to_placed_on}   = $to_placed_on;
102
my $additional_fields = Koha::AdditionalFields->search( { tablename => 'aqbasket', searchable => 1 } );
102
my $additional_fields = Koha::AdditionalFields->search( { tablename => 'aqbasket', searchable => 1 } );
103
$template->param( available_additional_fields => $additional_fields );
103
$template->param( available_additional_fields => $additional_fields );
104
my @additional_field_filters;
104
my @additional_field_filters;
(-)a/acqui/invoice.pl (-2 / +2 lines)
Lines 102-109 elsif ( $op && $op eq 'mod' ) { Link Here
102
    ModInvoice(
102
    ModInvoice(
103
        invoiceid             => $invoiceid,
103
        invoiceid             => $invoiceid,
104
        invoicenumber         => $invoicenumber,
104
        invoicenumber         => $invoicenumber,
105
        shipmentdate          => scalar output_pref( { str => scalar $input->param('shipmentdate'), dateformat => 'iso', dateonly => 1 } ),
105
        shipmentdate          => scalar $input->param('shipmentdate'),
106
        billingdate           => scalar output_pref( { str => scalar $input->param('billingdate'),  dateformat => 'iso', dateonly => 1 } ),
106
        billingdate           => scalar $input->param('billingdate'),
107
        shipmentcost          => $shipmentcost,
107
        shipmentcost          => $shipmentcost,
108
        shipmentcost_budgetid => $shipment_budget_id
108
        shipmentcost_budgetid => $shipment_budget_id
109
    );
109
    );
(-)a/acqui/invoices.pl (-10 / +5 lines)
Lines 34-40 use C4::Output qw( output_html_with_http_headers ); Link Here
34
34
35
use C4::Acquisition qw( GetInvoices GetInvoice );
35
use C4::Acquisition qw( GetInvoices GetInvoice );
36
use C4::Budgets qw( GetBudget GetBudgets CanUserUseBudget );
36
use C4::Budgets qw( GetBudget GetBudgets CanUserUseBudget );
37
use Koha::DateUtils qw( dt_from_string output_pref );
37
use Koha::DateUtils qw( dt_from_string );
38
use Koha::Acquisition::Booksellers;
38
use Koha::Acquisition::Booksellers;
39
39
40
my $input = CGI->new;
40
my $input = CGI->new;
Lines 62-81 my $branch = $input->param('branch'); Link Here
62
my $message_id       = $input->param('message_id');
62
my $message_id       = $input->param('message_id');
63
my $op               = $input->param('op');
63
my $op               = $input->param('op');
64
64
65
$shipmentdatefrom and $shipmentdatefrom = eval { dt_from_string( $shipmentdatefrom ) };
66
$shipmentdateto   and $shipmentdateto   = eval { dt_from_string( $shipmentdateto ) };
67
$billingdatefrom  and $billingdatefrom  = eval { dt_from_string( $billingdatefrom ) };
68
$billingdateto    and $billingdateto    = eval { dt_from_string( $billingdateto ) };
69
70
my $invoices = [];
65
my $invoices = [];
71
if ( $op and $op eq 'do_search' ) {
66
if ( $op and $op eq 'do_search' ) {
72
    @{$invoices} = GetInvoices(
67
    @{$invoices} = GetInvoices(
73
        invoicenumber    => $invoicenumber,
68
        invoicenumber    => $invoicenumber,
74
        supplierid       => $supplierid,
69
        supplierid       => $supplierid,
75
        shipmentdatefrom => $shipmentdatefrom ? output_pref( { str => $shipmentdatefrom, dateformat => 'iso' } ) : undef,
70
        shipmentdatefrom => $shipmentdatefrom,
76
        shipmentdateto   => $shipmentdateto   ? output_pref( { str => $shipmentdateto,   dateformat => 'iso' } ) : undef,
71
        shipmentdateto   => $shipmentdateto,
77
        billingdatefrom  => $billingdatefrom  ? output_pref( { str => $billingdatefrom,  dateformat => 'iso' } ) : undef,
72
        billingdatefrom  => $billingdatefrom,
78
        billingdateto    => $billingdateto    ? output_pref( { str => $billingdateto,    dateformat => 'iso' } ) : undef,
73
        billingdateto    => $billingdateto,
79
        isbneanissn      => $isbneanissn,
74
        isbneanissn      => $isbneanissn,
80
        title            => $title,
75
        title            => $title,
81
        author           => $author,
76
        author           => $author,
(-)a/acqui/lateorders.pl (-23 / +9 lines)
Lines 49-55 use C4::Auth qw( get_template_and_user ); Link Here
49
use C4::Output qw( output_html_with_http_headers );
49
use C4::Output qw( output_html_with_http_headers );
50
use C4::Context;
50
use C4::Context;
51
use C4::Letters qw( SendAlerts GetLetters );
51
use C4::Letters qw( SendAlerts GetLetters );
52
use Koha::DateUtils qw( dt_from_string output_pref );
52
use Koha::DateUtils qw( dt_from_string );
53
use Koha::Acquisition::Orders qw( filter_by_lates );
53
use Koha::Acquisition::Orders qw( filter_by_lates );
54
use Koha::CsvProfiles;
54
use Koha::CsvProfiles;
55
55
Lines 70-94 my $delay = $input->param('delay') // 0; Link Here
70
my $estimateddeliverydatefrom = $input->param('estimateddeliverydatefrom');
70
my $estimateddeliverydatefrom = $input->param('estimateddeliverydatefrom');
71
my $estimateddeliverydateto   = $input->param('estimateddeliverydateto');
71
my $estimateddeliverydateto   = $input->param('estimateddeliverydateto');
72
72
73
my $estimateddeliverydatefrom_dt =
74
  $estimateddeliverydatefrom
75
  ? dt_from_string($estimateddeliverydatefrom)
76
  : undef;
77
78
# Get the "date to" param. If it is not defined and $delay is not defined too, it is the today's date.
73
# Get the "date to" param. If it is not defined and $delay is not defined too, it is the today's date.
79
my $estimateddeliverydateto_dt = $estimateddeliverydateto
74
$estimateddeliverydateto ||=
80
    ? dt_from_string($estimateddeliverydateto)
75
  ( not defined $delay and not defined $estimateddeliverydatefrom )
81
    : ( not defined $delay and not defined $estimateddeliverydatefrom)
76
  ? dt_from_string()
82
        ? dt_from_string()
77
  : undef;
83
        : undef;
84
85
# Format the output of "date from" and "date to"
86
if ($estimateddeliverydatefrom_dt) {
87
    $estimateddeliverydatefrom = output_pref({dt => $estimateddeliverydatefrom_dt, dateonly => 1});
88
}
89
if ($estimateddeliverydateto_dt) {
90
    $estimateddeliverydateto = output_pref({dt => $estimateddeliverydateto_dt, dateonly => 1});
91
}
92
78
93
my $branch     = $input->param('branch');
79
my $branch     = $input->param('branch');
94
my $op         = $input->param('op');
80
my $op         = $input->param('op');
Lines 123-135 my @lateorders = Koha::Acquisition::Orders->filter_by_lates( Link Here
123
    {
109
    {
124
        delay        => $delay,
110
        delay        => $delay,
125
        (
111
        (
126
            $estimateddeliverydatefrom_dt
112
            $estimateddeliverydatefrom
127
            ? ( estimated_from => $estimateddeliverydatefrom_dt )
113
            ? ( estimated_from => $estimateddeliverydatefrom )
128
            : ()
114
            : ()
129
        ),
115
        ),
130
        (
116
        (
131
            $estimateddeliverydateto_dt
117
            $estimateddeliverydateto
132
            ? ( estimated_to => $estimateddeliverydateto_dt )
118
            ? ( estimated_to => $estimateddeliverydateto )
133
            : ()
119
            : ()
134
        )
120
        )
135
    },
121
    },
(-)a/acqui/orderreceive.pl (-1 / +1 lines)
Lines 119-125 my $creator = Koha::Patrons->find( $order->created_by ); Link Here
119
119
120
my $budget = GetBudget( $order->budget_id );
120
my $budget = GetBudget( $order->budget_id );
121
121
122
my $datereceived = $order->datereceived ? dt_from_string( $order->datereceived ) : dt_from_string;
122
my $datereceived = $order->datereceived || dt_from_string;
123
123
124
# get option values for TaxRates syspref
124
# get option values for TaxRates syspref
125
my @gst_values = map {
125
my @gst_values = map {
(-)a/acqui/parcels.pl (-4 / +3 lines)
Lines 75-81 use C4::Acquisition qw( GetInvoices GetInvoice AddInvoice ); Link Here
75
use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget );
75
use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget );
76
76
77
use Koha::Acquisition::Booksellers;
77
use Koha::Acquisition::Booksellers;
78
use Koha::DateUtils qw( output_pref dt_from_string );
78
use Koha::DateUtils qw( dt_from_string );
79
79
80
my $input          = CGI->new;
80
my $input          = CGI->new;
81
my $booksellerid     = $input->param('booksellerid');
81
my $booksellerid     = $input->param('booksellerid');
Lines 100-106 my $invoicenumber = $input->param('invoice'); Link Here
100
my $shipmentcost = $input->param('shipmentcost');
100
my $shipmentcost = $input->param('shipmentcost');
101
my $shipmentcost_budgetid = $input->param('shipmentcost_budgetid');
101
my $shipmentcost_budgetid = $input->param('shipmentcost_budgetid');
102
my $shipmentdate = $input->param('shipmentdate');
102
my $shipmentdate = $input->param('shipmentdate');
103
$shipmentdate and $shipmentdate = output_pref({ str => $shipmentdate, dateformat => 'iso', dateonly => 1 });
104
103
105
if ( $op and $op eq 'new' ) {
104
if ( $op and $op eq 'new' ) {
106
    if ( C4::Context->preference('AcqWarnOnDuplicateInvoice') ) {
105
    if ( C4::Context->preference('AcqWarnOnDuplicateInvoice') ) {
Lines 140-147 my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid ); Link Here
140
my @parcels = GetInvoices(
139
my @parcels = GetInvoices(
141
    supplierid => $booksellerid,
140
    supplierid => $booksellerid,
142
    invoicenumber => $code,
141
    invoicenumber => $code,
143
    ( $datefrom ? ( shipmentdatefrom => output_pref({ dt => dt_from_string($datefrom), dateformat => 'iso' }) ) : () ),
142
    ( $datefrom ? ( shipmentdatefrom => $datefrom ) : () ),
144
    ( $dateto   ? ( shipmentdateto   => output_pref({ dt => dt_from_string($dateto),   dateformat => 'iso' }) )    : () ),
143
    ( $dateto   ? ( shipmentdateto   => $dateto   ) : () ),
145
    order_by => $order
144
    order_by => $order
146
);
145
);
147
my $count_parcels = @parcels;
146
my $count_parcels = @parcels;
(-)a/admin/aqbudgetperiods.pl (-5 / +4 lines)
Lines 47-53 script to administer the budget periods table Link Here
47
use Modern::Perl;
47
use Modern::Perl;
48
48
49
use CGI qw ( -utf8 );
49
use CGI qw ( -utf8 );
50
use Koha::DateUtils qw( dt_from_string );
51
use JSON qw( encode_json );
50
use JSON qw( encode_json );
52
use Koha::Database;
51
use Koha::Database;
53
use C4::Koha;
52
use C4::Koha;
Lines 72-79 my $op = $input->param('op')||"else"; Link Here
72
# get only the columns of aqbudgetperiods in budget_period_hashref
71
# get only the columns of aqbudgetperiods in budget_period_hashref
73
my @columns = Koha::Database->new()->schema->source('Aqbudgetperiod')->columns;
72
my @columns = Koha::Database->new()->schema->source('Aqbudgetperiod')->columns;
74
my $budget_period_hashref = { map { join(' ',@columns) =~ /$_/ ? ( $_ => scalar $input->param($_) )  : () } keys( %{$input->Vars()} ) } ;
73
my $budget_period_hashref = { map { join(' ',@columns) =~ /$_/ ? ( $_ => scalar $input->param($_) )  : () } keys( %{$input->Vars()} ) } ;
75
$budget_period_hashref->{budget_period_startdate} = dt_from_string( scalar $input->param('budget_period_startdate') );
74
$budget_period_hashref->{budget_period_startdate} = $input->param('budget_period_startdate');
76
$budget_period_hashref->{budget_period_enddate}   = dt_from_string( scalar $input->param('budget_period_enddate') );
75
$budget_period_hashref->{budget_period_enddate}   = $input->param('budget_period_enddate');
77
76
78
$searchfield =~ s/\,//g;
77
$searchfield =~ s/\,//g;
79
78
Lines 190-197 elsif ( $op eq 'duplicate_form'){ Link Here
190
elsif ( $op eq 'duplicate_budget' ){
189
elsif ( $op eq 'duplicate_budget' ){
191
    die "please specify a budget period id\n" if( !defined $budget_period_id || $budget_period_id eq '' );
190
    die "please specify a budget period id\n" if( !defined $budget_period_id || $budget_period_id eq '' );
192
191
193
    my $budget_period_startdate = dt_from_string scalar $input->param('budget_period_startdate');
192
    my $budget_period_startdate = $input->param('budget_period_startdate');
194
    my $budget_period_enddate   = dt_from_string scalar $input->param('budget_period_enddate');
193
    my $budget_period_enddate   = $input->param('budget_period_enddate');
195
    my $budget_period_description = $input->param('budget_period_description');
194
    my $budget_period_description = $input->param('budget_period_description');
196
    my $amount_change_percentage = $input->param('amount_change_percentage');
195
    my $amount_change_percentage = $input->param('amount_change_percentage');
197
    my $amount_change_round_increment = $input->param('amount_change_round_increment');
196
    my $amount_change_round_increment = $input->param('amount_change_round_increment');
(-)a/admin/aqcontract.pl (-13 / +7 lines)
Lines 32-38 use C4::Contract qw( Link Here
32
    GetContracts
32
    GetContracts
33
    ModContract
33
    ModContract
34
);
34
);
35
use Koha::DateUtils qw( dt_from_string output_pref );
35
use Koha::DateUtils qw( dt_from_string );
36
36
37
use Koha::Acquisition::Booksellers;
37
use Koha::Acquisition::Booksellers;
38
38
Lines 96-103 elsif ( $op eq 'add_validate' ) { Link Here
96
96
97
    my $is_a_modif = $input->param("is_a_modif");
97
    my $is_a_modif = $input->param("is_a_modif");
98
98
99
    my $contractstart_dt = eval { dt_from_string( scalar $input->param('contractstartdate') ); };
99
    my $contractstart_dt = $input->param('contractstartdate');
100
    my $contractend_dt = eval { dt_from_string( scalar $input->param('contractenddate') ); };
100
    my $contractend_dt = $input->param('contractenddate');
101
    unless ( $contractstart_dt and $contractend_dt ) {
101
    unless ( $contractstart_dt and $contractend_dt ) {
102
        my $today = dt_from_string;
102
        my $today = dt_from_string;
103
        $contractstart_dt ||= $today;
103
        $contractstart_dt ||= $today;
Lines 106-113 elsif ( $op eq 'add_validate' ) { Link Here
106
106
107
    if ( $is_a_modif ) {
107
    if ( $is_a_modif ) {
108
        ModContract({
108
        ModContract({
109
            contractstartdate   => eval { output_pref({ dt => dt_from_string( $contractstart_dt ), dateformat => 'iso', dateonly => 1 } ); },
109
            contractstartdate   => $contractstart_dt,
110
            contractenddate     => eval { output_pref({ dt => dt_from_string( $contractend_dt ), dateformat => 'iso', dateonly => 1 } ); },
110
            contractenddate     => $contractend_dt,
111
            contractname        => scalar $input->param('contractname'),
111
            contractname        => scalar $input->param('contractname'),
112
            contractdescription => scalar $input->param('contractdescription'),
112
            contractdescription => scalar $input->param('contractdescription'),
113
            booksellerid        => scalar $input->param('booksellerid'),
113
            booksellerid        => scalar $input->param('booksellerid'),
Lines 118-125 elsif ( $op eq 'add_validate' ) { Link Here
118
            contractname        => scalar $input->param('contractname'),
118
            contractname        => scalar $input->param('contractname'),
119
            contractdescription => scalar $input->param('contractdescription'),
119
            contractdescription => scalar $input->param('contractdescription'),
120
            booksellerid        => scalar $input->param('booksellerid'),
120
            booksellerid        => scalar $input->param('booksellerid'),
121
            contractstartdate   => eval { output_pref({ dt => dt_from_string( scalar $input->param('contractstartdate') ), dateformat => 'iso', dateonly => 1 } ); },
121
            contractstartdate   => scalar $input->param('contractstartdate'),
122
            contractenddate     => eval { output_pref({ dt => dt_from_string( scalar $input->param('contractenddate') ), dateformat => 'iso', dateonly => 1 } ); },
122
            contractenddate     => scalar $input->param('contractenddate'),
123
        });
123
        });
124
    }
124
    }
125
125
Lines 165-176 if ( $op eq 'list' ) { Link Here
165
    # get contracts
165
    # get contracts
166
    my @contracts = @{GetContracts( { booksellerid => $booksellerid } )};
166
    my @contracts = @{GetContracts( { booksellerid => $booksellerid } )};
167
167
168
    # format dates
169
    for my $contract ( @contracts ) {
170
        $contract->{contractstartdate} =  output_pref({ dt => dt_from_string( $contract->{contractstartdate} ), dateonly => 1 });
171
        $contract->{contractenddate}   =  output_pref({ dt => dt_from_string( $contract->{contractenddate} ), dateonly => 1 }),
172
    }
173
174
    $template->param(loop => \@contracts);
168
    $template->param(loop => \@contracts);
175
169
176
    #---- END $OP eq DEFAULT
170
    #---- END $OP eq DEFAULT
(-)a/admin/categories.pl (-11 lines)
Lines 27-33 use C4::Output qw( output_html_with_http_headers ); Link Here
27
use C4::Form::MessagingPreferences;
27
use C4::Form::MessagingPreferences;
28
use Koha::Patrons;
28
use Koha::Patrons;
29
use Koha::Database;
29
use Koha::Database;
30
use Koha::DateUtils qw( dt_from_string output_pref );
31
use Koha::Patron::Categories;
30
use Koha::Patron::Categories;
32
use Koha::Libraries;
31
use Koha::Libraries;
33
32
Lines 89-104 elsif ( $op eq 'add_validate' ) { Link Here
89
88
90
    my $is_a_modif = $input->param("is_a_modif");
89
    my $is_a_modif = $input->param("is_a_modif");
91
90
92
    if ($enrolmentperioddate) {
93
        $enrolmentperioddate = output_pref(
94
            {
95
                dt         => dt_from_string($enrolmentperioddate),
96
                dateformat => 'iso',
97
                dateonly   => 1,
98
            }
99
        );
100
    }
101
102
    if ($is_a_modif) {
91
    if ($is_a_modif) {
103
        my $category = Koha::Patron::Categories->find( $categorycode );
92
        my $category = Koha::Patron::Categories->find( $categorycode );
104
        $category->categorycode($categorycode);
93
        $category->categorycode($categorycode);
(-)a/admin/smart-rules.pl (-5 lines)
Lines 23-29 use C4::Context; Link Here
23
use C4::Output qw( output_html_with_http_headers );
23
use C4::Output qw( output_html_with_http_headers );
24
use C4::Auth qw( get_template_and_user );
24
use C4::Auth qw( get_template_and_user );
25
use Koha::Exception;
25
use Koha::Exception;
26
use Koha::DateUtils qw( dt_from_string output_pref );
27
use Koha::Database;
26
use Koha::Database;
28
use Koha::Logger;
27
use Koha::Logger;
29
use Koha::Libraries;
28
use Koha::Libraries;
Lines 272-279 elsif ($op eq 'add') { Link Here
272
    my $no_auto_renewal_after = $input->param('no_auto_renewal_after');
271
    my $no_auto_renewal_after = $input->param('no_auto_renewal_after');
273
    $no_auto_renewal_after = '' if $no_auto_renewal_after =~ /^\s*$/;
272
    $no_auto_renewal_after = '' if $no_auto_renewal_after =~ /^\s*$/;
274
    my $no_auto_renewal_after_hard_limit = $input->param('no_auto_renewal_after_hard_limit') || '';
273
    my $no_auto_renewal_after_hard_limit = $input->param('no_auto_renewal_after_hard_limit') || '';
275
    $no_auto_renewal_after_hard_limit = eval { dt_from_string( scalar $no_auto_renewal_after_hard_limit ) } if ( $no_auto_renewal_after_hard_limit );
276
    $no_auto_renewal_after_hard_limit = output_pref( { dt => $no_auto_renewal_after_hard_limit, dateonly => 1, dateformat => 'iso' } ) if ( $no_auto_renewal_after_hard_limit );
277
    my $reservesallowed  = strip_non_numeric( scalar $input->param('reservesallowed') );
274
    my $reservesallowed  = strip_non_numeric( scalar $input->param('reservesallowed') );
278
    my $holds_per_record = strip_non_numeric( scalar $input->param('holds_per_record') );
275
    my $holds_per_record = strip_non_numeric( scalar $input->param('holds_per_record') );
279
    my $holds_per_day    = strip_non_numeric( scalar $input->param('holds_per_day') );
276
    my $holds_per_day    = strip_non_numeric( scalar $input->param('holds_per_day') );
Lines 283-290 elsif ($op eq 'add') { Link Here
283
    my $daysmode = $input->param('daysmode');
280
    my $daysmode = $input->param('daysmode');
284
    my $lengthunit  = $input->param('lengthunit');
281
    my $lengthunit  = $input->param('lengthunit');
285
    my $hardduedate = $input->param('hardduedate') || undef;
282
    my $hardduedate = $input->param('hardduedate') || undef;
286
    $hardduedate = eval { dt_from_string( scalar $hardduedate ) } if ( $hardduedate );
287
    $hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate );
288
    my $hardduedatecompare = $input->param('hardduedatecompare');
283
    my $hardduedatecompare = $input->param('hardduedatecompare');
289
    my $rentaldiscount = $input->param('rentaldiscount');
284
    my $rentaldiscount = $input->param('rentaldiscount');
290
    my $opacitemholds = $input->param('opacitemholds') || 0;
285
    my $opacitemholds = $input->param('opacitemholds') || 0;
(-)a/cataloguing/additem.pl (-1 lines)
Lines 36-42 use C4::Context; Link Here
36
use C4::Circulation qw( barcodedecode LostItem );
36
use C4::Circulation qw( barcodedecode LostItem );
37
use C4::Barcodes;
37
use C4::Barcodes;
38
use C4::Barcodes::ValueBuilder;
38
use C4::Barcodes::ValueBuilder;
39
use Koha::DateUtils qw( dt_from_string );
40
use Koha::Items;
39
use Koha::Items;
41
use Koha::ItemTypes;
40
use Koha::ItemTypes;
42
use Koha::Libraries;
41
use Koha::Libraries;
(-)a/cataloguing/value_builder/barcode.pl (-2 / +2 lines)
Lines 25-31 use Modern::Perl; Link Here
25
use C4::Context;
25
use C4::Context;
26
use C4::Barcodes::ValueBuilder;
26
use C4::Barcodes::ValueBuilder;
27
use C4::Biblio qw( GetMarcFromKohaField );
27
use C4::Biblio qw( GetMarcFromKohaField );
28
use Koha::DateUtils qw( dt_from_string output_pref );
28
use Koha::DateUtils qw( dt_from_string );
29
29
30
use Algorithm::CheckDigits qw( CheckDigits );
30
use Algorithm::CheckDigits qw( CheckDigits );
31
31
Lines 35-41 my $builder = sub { Link Here
35
    my %args;
35
    my %args;
36
36
37
	# find today's date
37
	# find today's date
38
    ($args{year}, $args{mon}, $args{day}) = split('-', output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }));
38
    ($args{year}, $args{mon}, $args{day}) = split('-', dt_from_string()->ymd());
39
    ($args{tag},$args{subfield})       =  GetMarcFromKohaField( "items.barcode" );
39
    ($args{tag},$args{subfield})       =  GetMarcFromKohaField( "items.barcode" );
40
40
41
	my $nextnum;
41
	my $nextnum;
(-)a/cataloguing/value_builder/barcode_manual.pl (-2 / +2 lines)
Lines 25-31 use Modern::Perl; Link Here
25
use C4::Context;
25
use C4::Context;
26
use C4::Barcodes::ValueBuilder;
26
use C4::Barcodes::ValueBuilder;
27
use C4::Biblio qw( GetMarcFromKohaField );
27
use C4::Biblio qw( GetMarcFromKohaField );
28
use Koha::DateUtils qw( dt_from_string output_pref );
28
use Koha::DateUtils qw( dt_from_string );
29
29
30
my $builder = sub {
30
my $builder = sub {
31
    my ( $params ) = @_;
31
    my ( $params ) = @_;
Lines 36-42 my $builder = sub { Link Here
36
    $args{dbh} = $dbh;
36
    $args{dbh} = $dbh;
37
37
38
# find today's date
38
# find today's date
39
    ($args{year}, $args{mon}, $args{day}) = split('-', output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }));
39
    ($args{year}, $args{mon}, $args{day}) = split('-', dt_from_string()->ymd());
40
    ($args{tag},$args{subfield})       =  GetMarcFromKohaField( "items.barcode" );
40
    ($args{tag},$args{subfield})       =  GetMarcFromKohaField( "items.barcode" );
41
41
42
    my $nextnum;
42
    my $nextnum;
(-)a/cataloguing/value_builder/dateaccessioned.pl (-2 / +1 lines)
Lines 21-33 Link Here
21
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
# along with Koha; if not, see <http://www.gnu.org/licenses>.
22
22
23
use Modern::Perl;
23
use Modern::Perl;
24
use Koha::DateUtils qw( dt_from_string output_pref flatpickr_date_format );
24
use Koha::DateUtils qw( flatpickr_date_format );
25
25
26
my $builder = sub {
26
my $builder = sub {
27
    my ( $params ) = @_;
27
    my ( $params ) = @_;
28
    my $function_name = $params->{id};
28
    my $function_name = $params->{id};
29
29
30
    my $date = output_pref({ dt => dt_from_string, dateonly => 1 });
31
    my $dateformat = flatpickr_date_format();
30
    my $dateformat = flatpickr_date_format();
32
31
33
    my $res  = <<END_OF_JS;
32
    my $res  = <<END_OF_JS;
(-)a/circ/branchoverdues.pl (-3 / +1 lines)
Lines 24-30 use C4::Auth qw( get_template_and_user ); Link Here
24
use C4::Overdues qw( GetOverduesForBranch );
24
use C4::Overdues qw( GetOverduesForBranch );
25
use C4::Biblio qw( GetMarcFromKohaField GetMarcStructure );
25
use C4::Biblio qw( GetMarcFromKohaField GetMarcStructure );
26
use C4::Koha qw( GetAuthorisedValues );
26
use C4::Koha qw( GetAuthorisedValues );
27
use Koha::DateUtils qw( dt_from_string output_pref );
28
use Koha::BiblioFrameworks;
27
use Koha::BiblioFrameworks;
29
28
30
=head1 branchoverdues.pl
29
=head1 branchoverdues.pl
Lines 71-78 if ($tagslib->{$tag}->{$subfield}->{authorised_value}) { Link Here
71
# now display infos
70
# now display infos
72
foreach my $num (@getoverdues) {
71
foreach my $num (@getoverdues) {
73
    my %overdueforbranch;
72
    my %overdueforbranch;
74
    my $dt = dt_from_string($num->{date_due}, 'sql');
73
    $overdueforbranch{'date_due'}          = $num->{date_due};
75
    $overdueforbranch{'date_due'}          = output_pref($dt);
76
    $overdueforbranch{'title'}             = $num->{'title'};
74
    $overdueforbranch{'title'}             = $num->{'title'};
77
    $overdueforbranch{'subtitle'}          = $num->{'subtitle'};
75
    $overdueforbranch{'subtitle'}          = $num->{'subtitle'};
78
    $overdueforbranch{'medium'}            = $num->{'medium'};
76
    $overdueforbranch{'medium'}            = $num->{'medium'};
(-)a/circ/circulation.pl (-4 / +2 lines)
Lines 45-51 use Koha::AuthorisedValues; Link Here
45
use Koha::CsvProfiles;
45
use Koha::CsvProfiles;
46
use Koha::Patrons;
46
use Koha::Patrons;
47
use Koha::Patron::Debarments qw( GetDebarments );
47
use Koha::Patron::Debarments qw( GetDebarments );
48
use Koha::DateUtils qw( dt_from_string output_pref );
48
use Koha::DateUtils qw( dt_from_string );
49
use Koha::Plugins;
49
use Koha::Plugins;
50
use Koha::Database;
50
use Koha::Database;
51
use Koha::BiblioFrameworks;
51
use Koha::BiblioFrameworks;
Lines 159-166 for my $barcode ( @$barcodes ) { Link Here
159
159
160
my $stickyduedate  = $query->param('stickyduedate') || $session->param('stickyduedate');
160
my $stickyduedate  = $query->param('stickyduedate') || $session->param('stickyduedate');
161
my $duedatespec    = $query->param('duedatespec')   || $session->param('stickyduedate');
161
my $duedatespec    = $query->param('duedatespec')   || $session->param('stickyduedate');
162
$duedatespec = eval { output_pref( { dt => dt_from_string( $duedatespec ), dateformat => 'iso' }); }
163
    if ( $duedatespec );
164
my $restoreduedatespec  = $query->param('restoreduedatespec') || $duedatespec || $session->param('stickyduedate');
162
my $restoreduedatespec  = $query->param('restoreduedatespec') || $duedatespec || $session->param('stickyduedate');
165
if ( $restoreduedatespec && $restoreduedatespec eq "highholds_empty" ) {
163
if ( $restoreduedatespec && $restoreduedatespec eq "highholds_empty" ) {
166
    undef $restoreduedatespec;
164
    undef $restoreduedatespec;
Lines 625-631 $template->param( Link Here
625
    SpecifyDueDate            => $duedatespec_allow,
623
    SpecifyDueDate            => $duedatespec_allow,
626
    PatronAutoComplete      => C4::Context->preference("PatronAutoComplete"),
624
    PatronAutoComplete      => C4::Context->preference("PatronAutoComplete"),
627
    debarments                => scalar GetDebarments({ borrowernumber => $borrowernumber }),
625
    debarments                => scalar GetDebarments({ borrowernumber => $borrowernumber }),
628
    todaysdate                => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ),
626
    todaysdate                => dt_from_string()->set(hour => 23)->set(minute => 59),
629
    has_modifications         => $has_modifications,
627
    has_modifications         => $has_modifications,
630
    override_high_holds       => $override_high_holds,
628
    override_high_holds       => $override_high_holds,
631
    nopermission              => scalar $query->param('nopermission'),
629
    nopermission              => scalar $query->param('nopermission'),
(-)a/circ/overdue.pl (-3 / +3 lines)
Lines 25-31 use C4::Output qw( output_html_with_http_headers ); Link Here
25
use CGI qw(-oldstyle_urls -utf8);
25
use CGI qw(-oldstyle_urls -utf8);
26
use C4::Auth qw( get_template_and_user );
26
use C4::Auth qw( get_template_and_user );
27
use Text::CSV_XS;
27
use Text::CSV_XS;
28
use Koha::DateUtils qw( dt_from_string output_pref );
28
use Koha::DateUtils qw( dt_from_string );
29
use Koha::Patron::Attribute::Types;
29
use Koha::Patron::Attribute::Types;
30
use DateTime;
30
use DateTime;
31
use DateTime::Format::MySQL;
31
use DateTime::Format::MySQL;
Lines 334-340 if ($noreport) { Link Here
334
            branchcode             => $data->{branchcode},
334
            branchcode             => $data->{branchcode},
335
            barcode                => $data->{barcode},
335
            barcode                => $data->{barcode},
336
            itemnum                => $data->{itemnumber},
336
            itemnum                => $data->{itemnumber},
337
            issuedate              => output_pref({ dt => dt_from_string( $data->{issuedate} ), dateonly => 1 }),
337
            issuedate              => $data->{issuedate},
338
            biblionumber           => $data->{biblionumber},
338
            biblionumber           => $data->{biblionumber},
339
            title                  => $data->{title},
339
            title                  => $data->{title},
340
            subtitle               => $data->{subtitle},
340
            subtitle               => $data->{subtitle},
Lines 369-375 if ($noreport) { Link Here
369
    $new_cgi->delete('op');
369
    $new_cgi->delete('op');
370
370
371
    $template->param(
371
    $template->param(
372
        todaysdate              => output_pref($today_dt),
372
        todaysdate              => $today_dt,
373
        overdueloop             => \@overduedata,
373
        overdueloop             => \@overduedata,
374
        nnoverdue               => scalar(@overduedata),
374
        nnoverdue               => scalar(@overduedata),
375
        noverdue_is_plural      => scalar(@overduedata) != 1,
375
        noverdue_is_plural      => scalar(@overduedata) != 1,
(-)a/circ/renew.pl (-9 / +8 lines)
Lines 24-30 use C4::Context; Link Here
24
use C4::Auth qw( get_template_and_user );
24
use C4::Auth qw( get_template_and_user );
25
use C4::Output qw( output_html_with_http_headers );
25
use C4::Output qw( output_html_with_http_headers );
26
use C4::Circulation qw( barcodedecode CanBookBeRenewed GetLatestAutoRenewDate AddRenewal );
26
use C4::Circulation qw( barcodedecode CanBookBeRenewed GetLatestAutoRenewDate AddRenewal );
27
use Koha::DateUtils qw( dt_from_string output_pref );
27
use Koha::DateUtils qw( dt_from_string );
28
use Koha::Database;
28
use Koha::Database;
29
use Koha::BiblioFrameworks;
29
use Koha::BiblioFrameworks;
30
30
Lines 92-104 if ($barcode) { Link Here
92
                }
92
                }
93
                if ($can_renew) {
93
                if ($can_renew) {
94
                    my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
94
                    my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
95
                    my $date_due;
95
                    my $date_due =
96
                    if ( $cgi->param('renewonholdduedate') ) {
96
                      ( C4::Context->preference('SpecifyDueDate')
97
                        $date_due = dt_from_string( scalar $cgi->param('renewonholdduedate'));
97
                          && $hard_due_date )
98
                    }
98
                      ? $hard_due_date
99
                    if ( C4::Context->preference('SpecifyDueDate') && $hard_due_date ) {
99
                      : $cgi->param('renewonholdduedate');
100
                        $date_due = dt_from_string( $hard_due_date );
100
101
                    }
102
                    $date_due = AddRenewal(
101
                    $date_due = AddRenewal(
103
                        undef,
102
                        undef,
104
                        $item->itemnumber(),
103
                        $item->itemnumber(),
Lines 133-139 if ($barcode) { Link Here
133
    );
132
    );
134
}
133
}
135
134
136
$template->param( hard_due_date => ($hard_due_date ? output_pref({ str => $hard_due_date, dateformat => 'iso' }) : undef) );
135
$template->param( hard_due_date => $hard_due_date );
137
# Checking if there is a Fast Cataloging Framework
136
# Checking if there is a Fast Cataloging Framework
138
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
137
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
139
138
(-)a/circ/reserveratios.pl (-6 / +3 lines)
Lines 27-33 use C4::Context; Link Here
27
use C4::Output qw( output_html_with_http_headers );
27
use C4::Output qw( output_html_with_http_headers );
28
use C4::Auth qw( get_template_and_user );
28
use C4::Auth qw( get_template_and_user );
29
use C4::Acquisition qw/GetOrdersByBiblionumber/;
29
use C4::Acquisition qw/GetOrdersByBiblionumber/;
30
use Koha::DateUtils qw( dt_from_string output_pref );
30
use Koha::DateUtils qw( dt_from_string );
31
use Koha::Acquisition::Baskets;
31
use Koha::Acquisition::Baskets;
32
32
33
my $input = CGI->new;
33
my $input = CGI->new;
Lines 62-70 if ( $basketno ){ Link Here
62
    }
62
    }
63
}
63
}
64
64
65
$startdate = eval { dt_from_string( $startdate ) } if $startdate;
66
$enddate = eval { dt_from_string( $enddate ) } if $enddate;
67
68
my $todaysdate = dt_from_string;
65
my $todaysdate = dt_from_string;
69
66
70
#    A default of the prior years's holds is a reasonable way to pull holds
67
#    A default of the prior years's holds is a reasonable way to pull holds
Lines 85-93 my $sqldatewhere = ""; Link Here
85
my @query_params = ();
82
my @query_params = ();
86
83
87
$sqldatewhere .= " AND reservedate >= ?";
84
$sqldatewhere .= " AND reservedate >= ?";
88
push @query_params, output_pref({ dt => $startdate, dateformat => 'iso' }) ;
85
push @query_params, $startdate;
89
$sqldatewhere .= " AND reservedate <= ?";
86
$sqldatewhere .= " AND reservedate <= ?";
90
push @query_params, output_pref({ dt => $enddate, dateformat => 'iso' });
87
push @query_params, $enddate;
91
88
92
my $include_aqorders_qty =
89
my $include_aqorders_qty =
93
  $effective_create_items eq 'receiving'
90
  $effective_create_items eq 'receiving'
(-)a/circ/returns.pl (-22 / +18 lines)
Lines 47-53 use Koha::AuthorisedValues; Link Here
47
use Koha::BiblioFrameworks;
47
use Koha::BiblioFrameworks;
48
use Koha::Calendar;
48
use Koha::Calendar;
49
use Koha::Checkouts;
49
use Koha::Checkouts;
50
use Koha::DateUtils qw( dt_from_string output_pref );
50
use Koha::DateUtils qw( dt_from_string );
51
use Koha::Holds;
51
use Koha::Holds;
52
use Koha::Items;
52
use Koha::Items;
53
use Koha::Item::Transfers;
53
use Koha::Item::Transfers;
Lines 215-242 my $dest = $query->param('dest'); Link Here
215
#dropbox: get last open day (today - 1)
215
#dropbox: get last open day (today - 1)
216
my $dropboxdate = Koha::Checkouts::calculate_dropbox_date();
216
my $dropboxdate = Koha::Checkouts::calculate_dropbox_date();
217
217
218
my $return_date_override = $query->param('return_date_override');
218
my $return_date_override = $query->param('return_date_override') || q{};
219
my $return_date_override_dt;
220
my $return_date_override_remember =
221
  $query->param('return_date_override_remember');
222
if ($return_date_override) {
219
if ($return_date_override) {
223
    if ( C4::Context->preference('SpecifyReturnDate') ) {
220
    if ( C4::Context->preference('SpecifyReturnDate') ) {
224
        $return_date_override_dt = eval {dt_from_string( $return_date_override ) };
225
        if ( $return_date_override_dt ) {
226
            # note that we've overriden the return date
227
            $template->param( return_date_was_overriden => 1);
228
            # Save the original format if we are remembering for this series
229
            $template->param(
230
                return_date_override          => $return_date_override,
231
                return_date_override_remember => 1
232
            ) if ($return_date_override_remember);
233
221
234
            $return_date_override =
222
        # note that we've overriden the return date
235
              DateTime::Format::MySQL->format_datetime( $return_date_override_dt );
223
        $template->param( return_date_was_overriden => 1 );
236
        }
224
237
    }
225
        my $return_date_override_remember =
238
    else {
226
          $query->param('return_date_override_remember');
239
        $return_date_override = q{};
227
228
        # Save the original format if we are remembering for this series
229
        $template->param(
230
            return_date_override          => $return_date_override,
231
            return_date_override_remember => 1
232
        ) if ($return_date_override_remember);
240
    }
233
    }
241
}
234
}
242
235
Lines 327-333 if ($barcode) { Link Here
327
        barcode => $barcode,
320
        barcode => $barcode,
328
    );
321
    );
329
322
330
    my $return_date = $dropboxmode ? $dropboxdate : $return_date_override_dt;
323
    my $return_date =
324
        $dropboxmode
325
      ? $dropboxdate
326
      : dt_from_string( $return_date_override );
331
327
332
    # Block return if multi-part and confirm has not been received
328
    # Block return if multi-part and confirm has not been received
333
    my $needs_confirm =
329
    my $needs_confirm =
Lines 659-665 foreach ( sort { $a <=> $b } keys %returneditems ) { Link Here
659
            $ri{day}   = $duedate->day();
655
            $ri{day}   = $duedate->day();
660
            $ri{hour}   = $duedate->hour();
656
            $ri{hour}   = $duedate->hour();
661
            $ri{minute}   = $duedate->minute();
657
            $ri{minute}   = $duedate->minute();
662
            $ri{duedate} = output_pref($duedate);
658
            $ri{duedate} = $duedate;
663
            my $patron = Koha::Patrons->find( $riborrowernumber{$_} );
659
            my $patron = Koha::Patrons->find( $riborrowernumber{$_} );
664
            unless ( $dropboxmode ) {
660
            unless ( $dropboxmode ) {
665
                $ri{return_overdue} = 1 if (DateTime->compare($duedate, dt_from_string()) == -1);
661
                $ri{return_overdue} = 1 if (DateTime->compare($duedate, dt_from_string()) == -1);
(-)a/circ/transferstoreceive.pl (-2 / +2 lines)
Lines 31-37 use C4::Reserves; Link Here
31
use Koha::Items;
31
use Koha::Items;
32
use Koha::ItemTypes;
32
use Koha::ItemTypes;
33
use Koha::Libraries;
33
use Koha::Libraries;
34
use Koha::DateUtils qw( dt_from_string output_pref );
34
use Koha::DateUtils qw( dt_from_string );
35
use Koha::BiblioFrameworks;
35
use Koha::BiblioFrameworks;
36
use Koha::Patrons;
36
use Koha::Patrons;
37
37
Lines 129-135 while ( my $library = $libraries->next ) { Link Here
129
129
130
$template->param(
130
$template->param(
131
    branchesloop => \@branchesloop,
131
    branchesloop => \@branchesloop,
132
    show_date    => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
132
    show_date    => dt_from_string,
133
    TransfersMaxDaysWarning => C4::Context->preference('TransfersMaxDaysWarning'),
133
    TransfersMaxDaysWarning => C4::Context->preference('TransfersMaxDaysWarning'),
134
    latetransfers => $latetransfers ? 1 : 0,
134
    latetransfers => $latetransfers ? 1 : 0,
135
);
135
);
(-)a/circ/waitingreserves.pl (-2 / +2 lines)
Lines 26-32 use C4::Auth qw( get_template_and_user ); Link Here
26
use C4::Items qw( ModItemTransfer );
26
use C4::Items qw( ModItemTransfer );
27
use Date::Calc qw( Date_to_Days Today );
27
use Date::Calc qw( Date_to_Days Today );
28
use C4::Reserves qw( ModReserve ModReserveCancelAll );
28
use C4::Reserves qw( ModReserve ModReserveCancelAll );
29
use Koha::DateUtils qw( dt_from_string output_pref );
29
use Koha::DateUtils qw( dt_from_string );
30
use Koha::BiblioFrameworks;
30
use Koha::BiblioFrameworks;
31
use Koha::Items;
31
use Koha::Items;
32
use Koha::ItemTypes;
32
use Koha::ItemTypes;
Lines 123-129 $template->param( Link Here
123
    reservecount => scalar @reserve_loop,
123
    reservecount => scalar @reserve_loop,
124
    overloop    => \@over_loop,
124
    overloop    => \@over_loop,
125
    overcount   => scalar @over_loop,
125
    overcount   => scalar @over_loop,
126
    show_date   => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
126
    show_date   => dt_from_string,
127
    tab => $tab,
127
    tab => $tab,
128
);
128
);
129
129
(-)a/clubs/clubs-add-modify.pl (-4 / +2 lines)
Lines 55-64 my $club_template_id = $cgi->param('club_template_id'); Link Here
55
my $club_template = $club->club_template() || Koha::Club::Templates->find($club_template_id);
55
my $club_template = $club->club_template() || Koha::Club::Templates->find($club_template_id);
56
$club_template_id ||= $club_template->id();
56
$club_template_id ||= $club_template->id();
57
57
58
my $date_start = $cgi->param('date_start');
58
my $date_start = $cgi->param('date_start') || undef;
59
$date_start = $date_start ? dt_from_string($date_start) : undef;
59
my $date_end = $cgi->param('date_end') || undef;
60
my $date_end = $cgi->param('date_end');
61
$date_end = $date_end ? dt_from_string($date_end) : undef;
62
60
63
if ( $cgi->param('name') ) {    # Update or create club
61
if ( $cgi->param('name') ) {    # Update or create club
64
    $club->set(
62
    $club->set(
(-)a/installer/onboarding.pl (-12 lines)
Lines 26-32 use C4::Members qw( checkcardnumber ); Link Here
26
use Koha::Patrons;
26
use Koha::Patrons;
27
use Koha::Libraries;
27
use Koha::Libraries;
28
use Koha::Database;
28
use Koha::Database;
29
use Koha::DateUtils qw( dt_from_string output_pref );
30
use Koha::Patrons;
29
use Koha::Patrons;
31
use Koha::Patron::Categories;
30
use Koha::Patron::Categories;
32
use Koha::ItemTypes;
31
use Koha::ItemTypes;
Lines 100-116 if ( $step == 2 ) { Link Here
100
        my $enrolmentperiod       = $input->param('enrolmentperiod');
99
        my $enrolmentperiod       = $input->param('enrolmentperiod');
101
        my $enrolmentperioddate = $input->param('enrolmentperioddate') || undef;
100
        my $enrolmentperioddate = $input->param('enrolmentperioddate') || undef;
102
101
103
        #Converts the string into a date format
104
        if ($enrolmentperioddate) {
105
            $enrolmentperioddate = output_pref(
106
                {
107
                    dt         => dt_from_string($enrolmentperioddate),
108
                    dateformat => 'DateTime',
109
                    dateonly   => 1,
110
                }
111
            );
112
        }
113
114
        #Adds a new patron category to the database
102
        #Adds a new patron category to the database
115
        $category = Koha::Patron::Category->new(
103
        $category = Koha::Patron::Category->new(
116
            {
104
            {
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc (-2 / +5 lines)
Lines 35-41 Link Here
35
    flatpickr.l10ns.default.months   = flatpickr_months;
35
    flatpickr.l10ns.default.months   = flatpickr_months;
36
    flatpickr.setDefaults({
36
    flatpickr.setDefaults({
37
        allowInput: true,
37
        allowInput: true,
38
        dateFormat: flatpickr_dateformat_string,
38
        dateFormat: "Y-m-d",
39
        altInput: true,
40
        altFormat: flatpickr_dateformat_string,
41
        altInputClass: 'flatpickr-input',
39
        nextArrow: '<i class="fa fa-fw fa-arrow-right"></i>',
42
        nextArrow: '<i class="fa fa-fw fa-arrow-right"></i>',
40
        prevArrow: '<i class="fa fa-fw fa-arrow-left"></i>',
43
        prevArrow: '<i class="fa fa-fw fa-arrow-left"></i>',
41
        time_24hr: flatpickr_timeformat,
44
        time_24hr: flatpickr_timeformat,
Lines 46-52 Link Here
46
        },
49
        },
47
        onReady: function( selectedDates, dateStr, instance ){
50
        onReady: function( selectedDates, dateStr, instance ){
48
            /* When flatpickr instance is created, automatically append a "clear date" link */
51
            /* When flatpickr instance is created, automatically append a "clear date" link */
49
            $(instance.input)
52
            $(instance.input).siblings('input.flatpickr')
50
                /* Add a wrapper element so that we can prevent the clear button from wrapping */
53
                /* Add a wrapper element so that we can prevent the clear button from wrapping */
51
                .wrap("<span class='flatpickr_wrapper'></span>")
54
                .wrap("<span class='flatpickr_wrapper'></span>")
52
                .attr("autocomplete", "off")
55
                .attr("autocomplete", "off")
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc (-3 / +2 lines)
Lines 1-6 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Branches %]
2
[% USE Branches %]
3
[% USE KohaDates %]
4
[% PROCESS 'html_helpers.inc' %]
3
[% PROCESS 'html_helpers.inc' %]
5
<ol>
4
<ol>
6
    <li><label for="title">Title: </label> <input type="text" name="title" id="title" value="[% filters.title | html %]" /></li>
5
    <li><label for="title">Title: </label> <input type="text" name="title" id="title" value="[% filters.title | html %]" /></li>
Lines 105-115 Link Here
105
    </li>
104
    </li>
106
105
107
    <li><label for="from">From: </label>
106
    <li><label for="from">From: </label>
108
        <input type="text" size="10" id="from" name="from" value="[% filters.from_placed_on | $KohaDates %]" class="flatpickr" data-date_to="to" />
107
        <input type="text" size="10" id="from" name="from" value="[% filters.from_placed_on | html %]" class="flatpickr" data-date_to="to" />
109
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
108
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
110
    </li>
109
    </li>
111
    <li><label for="to">To: </label>
110
    <li><label for="to">To: </label>
112
        <input type="text" size="10" id="to" name="to" value="[% filters.to_placed_on | $KohaDates %]" class="flatpickr" />
111
        <input type="text" size="10" id="to" name="to" value="[% filters.to_placed_on | html %]" class="flatpickr" />
113
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
112
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
114
    </li>
113
    </li>
115
</ol>
114
</ol>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (-3 / +3 lines)
Lines 114-126 Link Here
114
            <td>[% hold.notes | html | html_line_break %]</td>
114
            <td>[% hold.notes | html | html_line_break %]</td>
115
            <td>
115
            <td>
116
                [% IF Koha.Preference('AllowHoldDateInFuture') %]
116
                [% IF Koha.Preference('AllowHoldDateInFuture') %]
117
                    <input type="text" class="flatpickr" value="[% hold.date | $KohaDates %]" required="required" size="10" name="reservedate" />
117
                    <input type="text" class="flatpickr" value="[% hold.date | html %]" required="required" size="10" name="reservedate" />
118
                [% ELSE %]
118
                [% ELSE %]
119
                    [% hold.date | $KohaDates %]
119
                    [% hold.date | $KohaDates %]
120
                [% END %]
120
                [% END %]
121
            </td>
121
            </td>
122
            <td>
122
            <td>
123
                <input type="text" class="flatpickr" data-flatpickr-futuredate="true" value="[% hold.expirationdate | $KohaDates %]" size="10" name="expirationdate" />
123
                <input type="text" class="flatpickr" data-flatpickr-futuredate="true" value="[% hold.expirationdate | html %]" size="10" name="expirationdate" />
124
            </td>
124
            </td>
125
            <td>
125
            <td>
126
                [%- IF ( hold.found ) -%]
126
                [%- IF ( hold.found ) -%]
Lines 221-227 Link Here
221
221
222
                        [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
222
                        [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
223
                            <label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label>
223
                            <label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label>
224
                            <input type="text" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" size="10" value="[% hold.suspend_until | $KohaDates %]" class="flatpickr" data-flatpickr-futuredate="true" />
224
                            <input type="text" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" size="10" value="[% hold.suspend_until | html %]" class="flatpickr" data-flatpickr-futuredate="true" />
225
                        [%- ELSE -%]
225
                        [%- ELSE -%]
226
                            <input type="hidden" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" value=""/>
226
                            <input type="hidden" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" value=""/>
227
                        [%- END -%]
227
                        [%- END -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt (-2 / +2 lines)
Lines 69-75 Link Here
69
                [% IF readonly %]
69
                [% IF readonly %]
70
                    [% shipmentdate | $KohaDates %]
70
                    [% shipmentdate | $KohaDates %]
71
                [% ELSE %]
71
                [% ELSE %]
72
                    <input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" class="flatpickr" />
72
                    <input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | html %]" class="flatpickr" />
73
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
73
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
74
                [% END %]
74
                [% END %]
75
            </li>
75
            </li>
Lines 79-85 Link Here
79
                [% IF readonly %]
79
                [% IF readonly %]
80
                    [% billingdate | $KohaDates %]
80
                    [% billingdate | $KohaDates %]
81
                [% ELSE %]
81
                [% ELSE %]
82
                    <input type="text" size="10" id="billingdate" name="billingdate" value="[% billingdate | $KohaDates %]" class="flatpickr" />
82
                    <input type="text" size="10" id="billingdate" name="billingdate" value="[% billingdate | html %]" class="flatpickr" />
83
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
83
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
84
                [% END %]
84
                [% END %]
85
            </li>
85
            </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt (-4 / +4 lines)
Lines 326-337 Link Here
326
                                    <ol>
326
                                    <ol>
327
                                        <li>
327
                                        <li>
328
                                            <label for="shipmentdatefrom">From:</label>
328
                                            <label for="shipmentdatefrom">From:</label>
329
                                            <input type="text" id="shipmentdatefrom" name="shipmentdatefrom" size="10" value="[% shipmentdatefrom | $KohaDates %]" class="flatpickr" data-date_to="shipmentdateto" />
329
                                            <input type="text" id="shipmentdatefrom" name="shipmentdatefrom" size="10" value="[% shipmentdatefrom | html %]" class="flatpickr" data-date_to="shipmentdateto" />
330
                                            <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
330
                                            <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
331
                                        </li>
331
                                        </li>
332
                                        <li>
332
                                        <li>
333
                                            <label for="shipmentdateto">To:</label>
333
                                            <label for="shipmentdateto">To:</label>
334
                                            <input type="text" id="shipmentdateto" name="shipmentdateto" size="10" value="[% shipmentdateto | $KohaDates %]" class="flatpickr" />
334
                                            <input type="text" id="shipmentdateto" name="shipmentdateto" size="10" value="[% shipmentdateto | html %]" class="flatpickr" />
335
                                            <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
335
                                            <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
336
                                        </li>
336
                                        </li>
337
                                    </ol>
337
                                    </ol>
Lines 343-354 Link Here
343
                                    <ol>
343
                                    <ol>
344
                                        <li>
344
                                        <li>
345
                                            <label for="billingdatefrom">From:</label>
345
                                            <label for="billingdatefrom">From:</label>
346
                                            <input type="text" id="billingdatefrom" name="billingdatefrom" size="10" value="[% billingdatefrom | $KohaDates %]" class="flatpickr" data-date_to="billingdateto" />
346
                                            <input type="text" id="billingdatefrom" name="billingdatefrom" size="10" value="[% billingdatefrom | html %]" class="flatpickr" data-date_to="billingdateto" />
347
                                            <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
347
                                            <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
348
                                        </li>
348
                                        </li>
349
                                        <li>
349
                                        <li>
350
                                            <label for="billingdateto">To:</label>
350
                                            <label for="billingdateto">To:</label>
351
                                            <input type="text" id="billingdateto" name="billingdateto" size="10" value="[% billingdateto | $KohaDates %]" class="flatpickr" />
351
                                            <input type="text" id="billingdateto" name="billingdateto" size="10" value="[% billingdateto | html %]" class="flatpickr" />
352
                                            <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
352
                                            <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
353
                                        </li>
353
                                        </li>
354
                                    </ol>
354
                                    </ol>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-1 / +1 lines)
Lines 277-283 Link Here
277
        <ol>
277
        <ol>
278
            <li>
278
            <li>
279
                <label for="datereceived">Date received: </label>
279
                <label for="datereceived">Date received: </label>
280
                <input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | $KohaDates %]" class="flatpickr" />
280
                <input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | html %]" class="flatpickr" />
281
                <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
281
                <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
282
            </li>
282
            </li>
283
       <li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
283
       <li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt (-1 / +1 lines)
Lines 163-169 Link Here
163
        </li> -->
163
        </li> -->
164
         <li>
164
         <li>
165
            <label for="shipmentdate">Shipment date: </label>
165
            <label for="shipmentdate">Shipment date: </label>
166
            <input type="text" id="shipmentdate" name="shipmentdate" maxlength="10" size="10" value="[% shipmentdate_today | $KohaDates %]" class="flatpickr" />
166
            <input type="text" id="shipmentdate" name="shipmentdate" maxlength="10" size="10" value="[% shipmentdate_today | html %]" class="flatpickr" />
167
            <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
167
            <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
168
        </li>
168
        </li>
169
        <li>
169
        <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt (-4 / +4 lines)
Lines 189-202 Link Here
189
189
190
    <li>
190
    <li>
191
    <label class="required" for="from">Start date: </label>
191
    <label class="required" for="from">Start date: </label>
192
    <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="flatpickr" data-date_to="to" />
192
    <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | html %]" class="flatpickr" data-date_to="to" />
193
        <span class="required">Required</span>
193
        <span class="required">Required</span>
194
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
194
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
195
    </li>
195
    </li>
196
    <li>
196
    <li>
197
197
198
    <label class="required" for="to">End date: </label>
198
    <label class="required" for="to">End date: </label>
199
    <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="flatpickr" />
199
    <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | html %]" class="flatpickr" />
200
        <span class="required">Required</span>
200
        <span class="required">Required</span>
201
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
201
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
202
    </li>
202
    </li>
Lines 259-272 Link Here
259
    <ol>
259
    <ol>
260
    <li>
260
    <li>
261
    <label class="required" for="from">Start date: </label>
261
    <label class="required" for="from">Start date: </label>
262
    <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="flatpickr" data-date_to="to" />
262
    <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | html %]" class="flatpickr" data-date_to="to" />
263
        <span class="required">Required</span>
263
        <span class="required">Required</span>
264
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
264
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
265
    </li>
265
    </li>
266
    <li>
266
    <li>
267
267
268
    <label class="required" for="to">End date: </label>
268
    <label class="required" for="to">End date: </label>
269
    <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="flatpickr" />
269
    <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | html %]" class="flatpickr" />
270
        <span class="required">Required</span>
270
        <span class="required">Required</span>
271
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
271
        <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
272
    </li>
272
    </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt (-2 / +2 lines)
Lines 132-143 Link Here
132
                                        <input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="[% contractdescription | html %]" />
132
                                        <input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="[% contractdescription | html %]" />
133
                                </li>
133
                                </li>
134
                                <li><label for="from" class="required">Start date:</label> &nbsp;
134
                                <li><label for="from" class="required">Start date:</label> &nbsp;
135
                                        <input type="text" name="contractstartdate" id="from" value="[% contractstartdate | $KohaDates %]" maxlength="10" size="10" class="flatpickr" data-date_to="to" />
135
                                        <input type="text" name="contractstartdate" id="from" value="[% contractstartdate | html %]" maxlength="10" size="10" class="flatpickr" data-date_to="to" />
136
                                        <span class="required">Required</span>
136
                                        <span class="required">Required</span>
137
                                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
137
                                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
138
                                </li>
138
                                </li>
139
                                <li><label for="to" class="required">End date:</label> &nbsp;
139
                                <li><label for="to" class="required">End date:</label> &nbsp;
140
                                        <input type="text" name="contractenddate" id="to" value="[% contractenddate | $KohaDates %]" maxlength="10"  size="10" class="flatpickr" />
140
                                        <input type="text" name="contractenddate" id="to" value="[% contractenddate | html %]" maxlength="10"  size="10" class="flatpickr" />
141
                                        <span class="required">Required</span>
141
                                        <span class="required">Required</span>
142
                                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
142
                                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
143
                                </li>
143
                                </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt (-1 / +1 lines)
Lines 157-163 Link Here
157
                            </li>
157
                            </li>
158
                            <li>
158
                            <li>
159
                                <label for="enrolmentperioddate">Until date: </label>
159
                                <label for="enrolmentperioddate">Until date: </label>
160
                                <input type="text" class="enrollmentperiod flatpickr" data-flatpickr-futuredate="true" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
160
                                <input type="text" class="enrollmentperiod flatpickr" data-flatpickr-futuredate="true" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | html %]" />
161
                            </li>
161
                            </li>
162
                        </ol>
162
                        </ol>
163
                    </fieldset>
163
                    </fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-2 / +2 lines)
Lines 420-426 Link Here
420
                                [% END %]
420
                                [% END %]
421
421
422
                                [% IF ( INVALID_DATE ) %]
422
                                [% IF ( INVALID_DATE ) %]
423
                                    <li>The due date &quot;[% INVALID_DATE | html %]&quot; is invalid</li>
423
                                    <li>The due date &quot;[% INVALID_DATE | $KohaDates %]&quot; is invalid</li>
424
                                [% END %]
424
                                [% END %]
425
425
426
                                [% IF ( UNKNOWN_BARCODE ) %]
426
                                [% IF ( UNKNOWN_BARCODE ) %]
Lines 680-686 Link Here
680
                                                        <div id="specify-due-date" class="circ-setting">
680
                                                        <div id="specify-due-date" class="circ-setting">
681
                                                            <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
681
                                                            <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
682
                                                            [% IF ( duedatespec ) %]
682
                                                            [% IF ( duedatespec ) %]
683
                                                                <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" />
683
                                                                <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" />
684
                                                            [% ELSE %]
684
                                                            [% ELSE %]
685
                                                                <input type="text" size="20" id="duedatespec" name="duedatespec" value="" />
685
                                                                <input type="text" size="20" id="duedatespec" name="duedatespec" value="" />
686
                                                            [% END %]
686
                                                            [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt (-1 / +1 lines)
Lines 113-119 Link Here
113
          <fieldset class="rows">
113
          <fieldset class="rows">
114
              <legend>Due date: </legend>
114
              <legend>Due date: </legend>
115
              <label for="duedatespec">Hard due date [% INCLUDE 'date-format.inc' %]:</label>
115
              <label for="duedatespec">Hard due date [% INCLUDE 'date-format.inc' %]:</label>
116
                <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" class="flatpickr" data-flatpickr-enable-time="true" />
116
                <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" />
117
          </fieldset>
117
          </fieldset>
118
      [% END %]
118
      [% END %]
119
      <input type="hidden" name="op" value="show" />
119
      <input type="hidden" name="op" value="show" />
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt (-2 / +2 lines)
Lines 157-167 Link Here
157
157
158
            <li class="date_due_filter">
158
            <li class="date_due_filter">
159
                <label for="from">From:</label>
159
                <label for="from">From:</label>
160
                <input type="text" id="from" name="dateduefrom" size="10" value="[% filters.dateduefrom | $KohaDates %]" class="flatpickr" data-date_to="to" />
160
                <input type="text" id="from" name="dateduefrom" size="10" value="[% filters.dateduefrom | html %]" class="flatpickr" data-date_to="to" />
161
            </li>
161
            </li>
162
            <li class="date_due_filter">
162
            <li class="date_due_filter">
163
                <label for="to">To:</label>
163
                <label for="to">To:</label>
164
                <input type="text" id="to" name="datedueto" size="10" value="[% filters.datedueto | $KohaDates %]" class="flatpickr" />
164
                <input type="text" id="to" name="datedueto" size="10" value="[% filters.datedueto | html %]" class="flatpickr" />
165
            </li>
165
            </li>
166
        </ol>
166
        </ol>
167
    </fieldset>
167
    </fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (-2 / +2 lines)
Lines 271-282 Link Here
271
<label for="from">
271
<label for="from">
272
    Start date:
272
    Start date:
273
</label>
273
</label>
274
<input type="text" size="10" id="from" name="from" value="[% from | $KohaDates %]" class="flatpickr" data-date_to="to" />
274
<input type="text" size="10" id="from" name="from" value="[% from | html %]" class="flatpickr" data-date_to="to" />
275
</li>
275
</li>
276
<li><label for="to">
276
<li><label for="to">
277
    End date:
277
    End date:
278
</label>
278
</label>
279
<input type="text" size="10" id="to" name="to" value="[% to | $KohaDates %]" class="flatpickr" />
279
<input type="text" size="10" id="to" name="to" value="[% to | html %]" class="flatpickr" />
280
</li>
280
</li>
281
</ol>
281
</ol>
282
282
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt (-1 / +1 lines)
Lines 223-229 Link Here
223
                        <div class="circ-settings show">
223
                        <div class="circ-settings show">
224
                            <div class="date-select" id="renew_date_override_fields">
224
                            <div class="date-select" id="renew_date_override_fields">
225
                                <div><label for="hard_due_date" class="hint">Renewal due date [% INCLUDE 'date-format.inc' %]:</label></div>
225
                                <div><label for="hard_due_date" class="hint">Renewal due date [% INCLUDE 'date-format.inc' %]:</label></div>
226
                                <input type="text" size="20" id="hard_due_date" name="hard_due_date" value="[% hard_due_date | $KohaDates with_hours => 1 %]" class="flatpickr" data-flatpickr-futuredate="true" data-flatpickr-enable-time="true" />
226
                                <input type="text" size="20" id="hard_due_date" name="hard_due_date" value="[% hard_due_date | html %]" class="flatpickr" data-flatpickr-futuredate="true" data-flatpickr-enable-time="true" />
227
                            </div> <!-- /.date-select -->
227
                            </div> <!-- /.date-select -->
228
                        </div>
228
                        </div>
229
                    </fieldset>
229
                    </fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt (-2 / +2 lines)
Lines 164-175 Link Here
164
164
165
    <li>
165
    <li>
166
        <label for="from">Start date:</label>
166
        <label for="from">Start date:</label>
167
        <input type="text" size="10" id="from" name="from" value="[% from | $KohaDates %]" class="flatpickr" data-date_to="to" />
167
        <input type="text" size="10" id="from" name="from" value="[% from | html %]" class="flatpickr" data-date_to="to" />
168
    </li>
168
    </li>
169
169
170
    <li>
170
    <li>
171
        <label for="to">End date:</label>
171
        <label for="to">End date:</label>
172
        <input size="10" id="to" name="to" value="[% to | $KohaDates %]" type="text" class="flatpickr" />
172
        <input size="10" id="to" name="to" value="[% to | html %]" type="text" class="flatpickr" />
173
    </li>
173
    </li>
174
</ol>
174
</ol>
175
(inclusive)
175
(inclusive)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-2 / +2 lines)
Lines 1076-1084 Link Here
1076
                                        <td class="ci-duedate">
1076
                                        <td class="ci-duedate">
1077
                                            [% IF ( riloo.duedate ) %]
1077
                                            [% IF ( riloo.duedate ) %]
1078
                                                [% IF ( riloo.return_overdue ) %]
1078
                                                [% IF ( riloo.return_overdue ) %]
1079
                                                    <span class="overdue">[% riloo.duedate | html %] (overdue)</span>
1079
                                                    <span class="overdue">[% riloo.duedate | $KohaDates as_due_date => 1 %] (overdue)</span>
1080
                                                [% ELSE %]
1080
                                                [% ELSE %]
1081
                                                    [% riloo.duedate | html %]
1081
                                                    [% riloo.duedate | $KohaDates as_due_date => 1 %]
1082
                                                [% END %]
1082
                                                [% END %]
1083
                                            [% ELSE %]
1083
                                            [% ELSE %]
1084
                                                <span>Not checked out</span>
1084
                                                <span>Not checked out</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt (-2 / +2 lines)
Lines 75-86 Link Here
75
75
76
                        <li>
76
                        <li>
77
                            <label for="from">Start date:</label>
77
                            <label for="from">Start date:</label>
78
                            <input name="date_start" id="from" size="10" class="flatpickr" data-date_to="to" value="[% club.date_start | $KohaDates %]">
78
                            <input name="date_start" id="from" size="10" class="flatpickr" data-date_to="to" value="[% club.date_start | html %]">
79
                        </li>
79
                        </li>
80
80
81
                        <li>
81
                        <li>
82
                            <label for="to">End date:</label>
82
                            <label for="to">End date:</label>
83
                            <input name="date_end" id="to" size="10" class="flatpickr" value="[% club.date_end | $KohaDates %]" >
83
                            <input name="date_end" id="to" size="10" class="flatpickr" value="[% club.date_end | html %]" >
84
                        </li>
84
                        </li>
85
85
86
                        <li>
86
                        <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt (-2 / +2 lines)
Lines 58-69 Link Here
58
                <br>
58
                <br>
59
                <li>
59
                <li>
60
                    <label for="from">From: </label>
60
                    <label for="from">From: </label>
61
                    <input type="text" size="10" id="from" name="from" value="[% beginDate | $KohaDates %]" class="flatpickr" data-date_to="to" />
61
                    <input type="text" size="10" id="from" name="from" value="[% beginDate | html %]" class="flatpickr" data-date_to="to" />
62
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
62
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
63
                </li>
63
                </li>
64
                <li>
64
                <li>
65
                    <label for="to">To: </label>
65
                    <label for="to">To: </label>
66
                    <input type="text" size="10" id="to" name="to" value="[% endDate | $KohaDates %]" class="flatpickr" />
66
                    <input type="text" size="10" id="to" name="to" value="[% endDate | html %]" class="flatpickr" />
67
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
67
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
68
                </li>
68
                </li>
69
69
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-2 / +2 lines)
Lines 793-799 Link Here
793
                                                    <td>
793
                                                    <td>
794
                                                        [% IF ( itemloo.transfertwhen ) %]
794
                                                        [% IF ( itemloo.transfertwhen ) %]
795
                                                            <span>In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
795
                                                            <span>In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
796
                                                            to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]</span>
796
                                                            to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | $KohaDates %]</span>
797
                                                        [% END %]
797
                                                        [% END %]
798
                                                [% END %]
798
                                                [% END %]
799
799
Lines 811-817 Link Here
811
                                                                [% itemloo.waitingdate | $KohaDates %]
811
                                                                [% itemloo.waitingdate | $KohaDates %]
812
                                                            [% ELSE %]
812
                                                            [% ELSE %]
813
                                                                [% IF ( itemloo.reservedate ) %]
813
                                                                [% IF ( itemloo.reservedate ) %]
814
                                                                    [% itemloo.reservedate | html %]
814
                                                                    [% itemloo.reservedate | $KohaDates %]
815
                                                                [% END %]
815
                                                                [% END %]
816
                                                            [% END %].
816
                                                            [% END %].
817
                                                            <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&amp;CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&amp;CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
817
                                                            <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&amp;CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&amp;CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt (-1 / +1 lines)
Lines 54-60 Link Here
54
        [% END %]
54
        [% END %]
55
55
56
        <li><label for="date" class="required">Expiring before:</label>
56
        <li><label for="date" class="required">Expiring before:</label>
57
            <input id="date" type="text" name="date" size="10" value="[% date | $KohaDates %]" class="required focus flatpickr" required="required" />
57
            <input id="date" type="text" name="date" size="10" value="[% date | html %]" class="required focus flatpickr" required="required" />
58
        <span class="required">Required</span>
58
        <span class="required">Required</span>
59
			<div class="hint">[% INCLUDE 'date-format.inc' %]</div></li>
59
			<div class="hint">[% INCLUDE 'date-format.inc' %]</div></li>
60
			</ol>
60
			</ol>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-4 / +4 lines)
Lines 164-175 Link Here
164
                                                [% IF ( missingissue.status44 ) %]<span class="status-missing_lost">Missing (lost)</span>[% END %]
164
                                                [% IF ( missingissue.status44 ) %]<span class="status-missing_lost">Missing (lost)</span>[% END %]
165
                                                [% IF ( missingissue.status7 ) %]<span class="status-claimed">Claimed</span>[% END %]
165
                                                [% IF ( missingissue.status7 ) %]<span class="status-claimed">Claimed</span>[% END %]
166
                                            </td>
166
                                            </td>
167
                                            <td class="planneddate" data-order="[% missingissue.planneddateISO | html %]">
167
                                            <td class="planneddate" data-order="[% missingissue.planneddate | html %]">
168
                                                [% missingissue.planneddate | html %]
168
                                                [% missingissue.planneddate | $KohaDates %]
169
                                            </td>
169
                                            </td>
170
                                            <td>[% missingissue.claims_count | html %]</td>
170
                                            <td>[% missingissue.claims_count | html %]</td>
171
                                            <td data-order="[% missingissue.claimdateISO | html %]">
171
                                            <td data-order="[% missingissue.claimdate | html %]">
172
                                                [% missingissue.claimdate | html %]
172
                                                [% missingissue.claimdate | $KohaDates %]
173
                                            </td>
173
                                            </td>
174
                                            [% FOR field IN additional_fields_for_subscription %]
174
                                            [% FOR field IN additional_fields_for_subscription %]
175
                                                [% IF field.authorised_value_category %]
175
                                                [% IF field.authorised_value_category %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (-2 / +2 lines)
Lines 289-295 Link Here
289
                                        </li>
289
                                        </li>
290
                                        <li class="local">
290
                                        <li class="local">
291
                                            <label for="to">Expires before:</label>
291
                                            <label for="to">Expires before:</label>
292
                                            <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="flatpickr" />
292
                                            <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | html %]" size="10" maxlength="10" class="flatpickr" />
293
                                        </li>
293
                                        </li>
294
                                        [% INCLUDE 'additional-fields-entry.inc' available=additional_fields_for_subscription values=additional_field_filters wrap_fieldset=0 %]
294
                                        [% INCLUDE 'additional-fields-entry.inc' available=additional_fields_for_subscription values=additional_field_filters wrap_fieldset=0 %]
295
                                    </ol>
295
                                    </ol>
Lines 404-410 Link Here
404
                                            </li>
404
                                            </li>
405
                                            <li>
405
                                            <li>
406
                                                <label for="to">Expires before:</label>
406
                                                <label for="to">Expires before:</label>
407
                                                <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="flatpickr" />
407
                                                <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | html %]" size="10" maxlength="10" class="flatpickr" />
408
                                            </li>
408
                                            </li>
409
409
410
                                            [% FOR field IN additional_fields_for_subscription %]
410
                                            [% FOR field IN additional_fields_for_subscription %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (-4 / +4 lines)
Lines 276-282 fieldset.rows table { clear: none; margin: 0; } Link Here
276
                                    <li>
276
                                    <li>
277
                                        <label for="acqui_date" class="required">First issue publication date:</label>
277
                                        <label for="acqui_date" class="required">First issue publication date:</label>
278
                                        [% UNLESS (more_than_one_serial) %]
278
                                        [% UNLESS (more_than_one_serial) %]
279
                                          <input type="text" size="10" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]" class="flatpickr required" required="required" />
279
                                          <input type="text" size="10" id="acqui_date" name="firstacquidate" value="[% firstacquidate | html %]" class="flatpickr required" required="required" />
280
                                        [% ELSE %]
280
                                        [% ELSE %]
281
                                          [% firstacquidate | $KohaDates %]
281
                                          [% firstacquidate | $KohaDates %]
282
                                          <input type="hidden" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]"/>
282
                                          <input type="hidden" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]"/>
Lines 286-292 fieldset.rows table { clear: none; margin: 0; } Link Here
286
                                    [% IF (more_than_one_serial) %]
286
                                    [% IF (more_than_one_serial) %]
287
                                      <li>
287
                                      <li>
288
                                        <label for="nextacquidate">Next issue publication date:</label>
288
                                        <label for="nextacquidate">Next issue publication date:</label>
289
                                        <input type="text" size="10" id="nextacquidate" name="nextacquidate" value="[% nextacquidate | $KohaDates %]" class="flatpickr" />
289
                                        <input type="text" size="10" id="nextacquidate" name="nextacquidate" value="[% nextacquidate | html %]" class="flatpickr" />
290
                                      </li>
290
                                      </li>
291
                                    [% END %]
291
                                    [% END %]
292
                                    <li>
292
                                    <li>
Lines 340-350 fieldset.rows table { clear: none; margin: 0; } Link Here
340
                                    </li>
340
                                    </li>
341
                                    <li>
341
                                    <li>
342
                                        <label for="from" class="required"> Subscription start date:</label>
342
                                        <label for="from" class="required"> Subscription start date:</label>
343
                                        <input type="text" size="10" id="from" name="startdate" value="[% startdate | $KohaDates %]" class="flatpickr required" data-date_to="to" required="required" />
343
                                        <input type="text" size="10" id="from" name="startdate" value="[% startdate | html %]" class="flatpickr required" data-date_to="to" required="required" />
344
                                    </li>
344
                                    </li>
345
                                    <li>
345
                                    <li>
346
                                        <label for="to">Subscription end date:</label>
346
                                        <label for="to">Subscription end date:</label>
347
                                        <input type="text" size="10" id="to" name="enddate" value="[% enddate | $KohaDates %]" class="flatpickr" />
347
                                        <input type="text" size="10" id="to" name="enddate" value="[% enddate | html %]" class="flatpickr" />
348
                                    </li>
348
                                    </li>
349
                                    <li>
349
                                    <li>
350
                                        <label for="numberpattern" class="required">Numbering pattern:</label>
350
                                        <label for="numberpattern" class="required">Numbering pattern:</label>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-history.tt (-2 / +2 lines)
Lines 41-54 Link Here
41
              <tr>
41
              <tr>
42
                <td>Subscription start date</td>
42
                <td>Subscription start date</td>
43
                <td>
43
                <td>
44
                    <input type="text" size="10" name="histstartdate" value="[% histstartdate | $KohaDates %]" class="flatpickr" data-date_to="histenddate" /> (start date of the 1st subscription)
44
                    <input type="text" size="10" name="histstartdate" value="[% histstartdate | html %]" class="flatpickr" data-date_to="histenddate" /> (start date of the 1st subscription)
45
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
45
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
46
                </td>
46
                </td>
47
              </tr>
47
              </tr>
48
              <tr>
48
              <tr>
49
                <td>Subscription end date</td>
49
                <td>Subscription end date</td>
50
                <td>
50
                <td>
51
                    <input type="text" size="10" id="histenddate" name="histenddate" value="[% histenddate | $KohaDates %]" class="flatpickr" />(if empty, subscription is still active)
51
                    <input type="text" size="10" id="histenddate" name="histenddate" value="[% histenddate | html %]" class="flatpickr" />(if empty, subscription is still active)
52
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
52
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
53
                </td>
53
                </td>
54
              </tr>
54
              </tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-3 / +3 lines)
Lines 500-506 Link Here
500
                                            <label for="suggesteddate">[% tp('purchase suggestion created by', 'Created by:') | html %]</label>
500
                                            <label for="suggesteddate">[% tp('purchase suggestion created by', 'Created by:') | html %]</label>
501
                                        </th>
501
                                        </th>
502
                                        <td>
502
                                        <td>
503
                                            <input type="text" id="suggesteddate" name="suggesteddate" class="flatpickr" size="10" maxlength="10" value="[% suggesteddate | $KohaDates %]"/> [% INCLUDE 'date-format.inc' %]
503
                                            <input type="text" id="suggesteddate" name="suggesteddate" class="flatpickr" size="10" maxlength="10" value="[% suggesteddate | html %]"/> [% INCLUDE 'date-format.inc' %]
504
                                        </td>
504
                                        </td>
505
                                        <td id="tdsuggestedby">
505
                                        <td id="tdsuggestedby">
506
                                            <input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby | html %]"/>
506
                                            <input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby | html %]"/>
Lines 517-523 Link Here
517
                                            <label for="accepteddate">Accepted on:</label>
517
                                            <label for="accepteddate">Accepted on:</label>
518
                                        </th>
518
                                        </th>
519
                                        <td>
519
                                        <td>
520
                                            <input type="text" id="accepteddate" name="accepteddate" class="flatpickr" size="10" maxlength="10" value="[% accepteddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]
520
                                            <input type="text" id="accepteddate" name="accepteddate" class="flatpickr" size="10" maxlength="10" value="[% accepteddate | html %]" />[% INCLUDE 'date-format.inc' %]
521
                                        </td>
521
                                        </td>
522
                                        <td>
522
                                        <td>
523
                                            <input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby | html %]"/>
523
                                            <input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby | html %]"/>
Lines 547-553 Link Here
547
                        </li>
547
                        </li>
548
                        <li>
548
                        <li>
549
                            <label for="managedon">Managed on:</label>
549
                            <label for="managedon">Managed on:</label>
550
                            <input type="text" id="managedon" name="manageddate" class="flatpickr" size="10" maxlength="10" value="[% manageddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]
550
                            <input type="text" id="managedon" name="manageddate" class="flatpickr" size="10" maxlength="10" value="[% manageddate | html %]" />[% INCLUDE 'date-format.inc' %]
551
                        </li>
551
                        </li>
552
                        <li>
552
                        <li>
553
                            <label for="managedby_name">by:</label>
553
                            <label for="managedby_name">by:</label>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt (-3 / +1 lines)
Lines 64-72 tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } Link Here
64
  [% IF ( message_loop ) %]
64
  [% IF ( message_loop ) %]
65
  <div class="dialog alert" id="main_error">
65
  <div class="dialog alert" id="main_error">
66
    [% FOREACH message_loo IN message_loop %]
66
    [% FOREACH message_loo IN message_loop %]
67
        [% IF ( message_loo.date_from ) %]<strong>Error: </strong><span>"Date from" is not a legal value ("[% message_loo.date_from | html %]").</span>
67
        [% IF ( message_loo.failed_ok ) %]<strong>Error: </strong><span>Failed to approve term ([% message_loo.failed_ok | html %]).</span>
68
        [% ELSIF ( message_loo.date_to ) %]<strong>Error: </strong><span>"Date to" is not a legal value ("[% message_loo.date_to | html %]").</span>
69
        [% ELSIF ( message_loo.failed_ok ) %]<strong>Error: </strong><span>Failed to approve term ([% message_loo.failed_ok | html %]).</span>
70
        [% ELSIF ( message_loo.failed_rej ) %]<strong>Error: </strong><span>Failed to reject term ([% message_loo.failed_rej | html %]).</span>
68
        [% ELSIF ( message_loo.failed_rej ) %]<strong>Error: </strong><span>Failed to reject term ([% message_loo.failed_rej | html %]).</span>
71
        [% ELSIF ( message_loo.approver ) %]<span>No match for user ([% message_loo.approver | html %]). FILTER REQUIRES BORROWERNUMBER (not name).</span>
69
        [% ELSIF ( message_loo.approver ) %]<span>No match for user ([% message_loo.approver | html %]). FILTER REQUIRES BORROWERNUMBER (not name).</span>
72
        [% ELSIF ( message_loo.approved_by ) %]<strong>Error: </strong><span>No match for borrowernumber ([% message_loo.approved_by | html %]).</span>
70
        [% ELSIF ( message_loo.approved_by ) %]<strong>Error: </strong><span>No match for borrowernumber ([% message_loo.approved_by | html %]).</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-2 / +2 lines)
Lines 224-235 Link Here
224
                [% END %]
224
                [% END %]
225
                <li>
225
                <li>
226
                    <label for="from">Publication date: </label>
226
                    <label for="from">Publication date: </label>
227
                    <input id="from" type="text" name="published_on" size="15" value="[% additional_content.published_on | $KohaDates %]" class="flatpickr" data-date_to="to" />
227
                    <input id="from" type="text" name="published_on" size="15" value="[% additional_content.published_on | html %]" class="flatpickr" data-date_to="to" />
228
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
228
                    <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
229
                </li>
229
                </li>
230
                <li>
230
                <li>
231
                    <label for="to">Expiration date: </label>
231
                    <label for="to">Expiration date: </label>
232
                    <input id="to" type="text" name="expirationdate" size="15" value="[% additional_content.expirationdate | $KohaDates %]" class="flatpickr" />
232
                    <input id="to" type="text" name="expirationdate" size="15" value="[% additional_content.expirationdate | html %]" class="flatpickr" />
233
                    <div class="hint">
233
                    <div class="hint">
234
                        [% INCLUDE 'date-format.inc' %]
234
                        [% INCLUDE 'date-format.inc' %]
235
                        [% IF category == 'news' %]
235
                        [% IF category == 'news' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt (-1 / +1 lines)
Lines 484-490 Link Here
484
484
485
        function changeBranch () {
485
        function changeBranch () {
486
            var branch = $("#branch option:selected").val();
486
            var branch = $("#branch option:selected").val();
487
            location.href='/cgi-bin/koha/tools/holidays.pl?branch=' + branch + '&calendardate=' + "[% calendardate | html %]";
487
            location.href='/cgi-bin/koha/tools/holidays.pl?branch=' + branch + '&calendardate=' + "[% calendardate | $KohaDates %]";
488
        }
488
        }
489
489
490
        /**
490
        /**
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (-2 / +2 lines)
Lines 85-91 Link Here
85
        <fieldset class="rows">
85
        <fieldset class="rows">
86
            <legend>Parameters</legend>
86
            <legend>Parameters</legend>
87
            <ol>
87
            <ol>
88
                <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="flatpickr" /></li>
88
                <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | html %]" class="flatpickr" /></li>
89
                <li><label for="compareinv2barcd">Compare barcodes list to results: </label><input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" disabled /></li>
89
                <li><label for="compareinv2barcd">Compare barcodes list to results: </label><input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" disabled /></li>
90
                <li><label for="dont_checkin">Do not check in items scanned during inventory: </label><input type="checkbox" name="dont_checkin" id="dont_checkin" disabled /></li>
90
                <li><label for="dont_checkin">Do not check in items scanned during inventory: </label><input type="checkbox" name="dont_checkin" id="dont_checkin" disabled /></li>
91
                <li><label for="out_of_order">Check barcodes list for items shelved out of order: </label><input type="checkbox" name="out_of_order" id="out_of_order" disabled /></li>
91
                <li><label for="out_of_order">Check barcodes list for items shelved out of order: </label><input type="checkbox" name="out_of_order" id="out_of_order" disabled /></li>
Lines 185-191 Link Here
185
        <li>
185
        <li>
186
            <br/>
186
            <br/>
187
            <label for="datelastseen">Last inventory date:</label>
187
            <label for="datelastseen">Last inventory date:</label>
188
            <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | $KohaDates %]" class="flatpickr" />
188
            <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | html %]" class="flatpickr" />
189
            (Skip records marked as seen on or after this date.)
189
            (Skip records marked as seen on or after this date.)
190
        </li>
190
        </li>
191
        <li>
191
        <li>
(-)a/koha-tmpl/intranet-tmpl/prog/js/members.js (-1 / +1 lines)
Lines 128-134 function select_user(borrowernumber, borrower, relationship) { Link Here
128
128
129
function CalculateAge(dateofbirth) {
129
function CalculateAge(dateofbirth) {
130
    var today = new Date();
130
    var today = new Date();
131
    var dob = Date_from_syspref(dateofbirth);
131
    var dob = new Date(dateofbirth);
132
    var age = {};
132
    var age = {};
133
133
134
    age.year = today.getFullYear() - dob.getFullYear();
134
    age.year = today.getFullYear() - dob.getFullYear();
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-3 / +3 lines)
Lines 422-430 Link Here
422
                                                            </td>
422
                                                            </td>
423
                                                            <td class="information">
423
                                                            <td class="information">
424
                                                                [% IF ( itemLoo.dateDue ) %]
424
                                                                [% IF ( itemLoo.dateDue ) %]
425
                                                                    <span class="checkedout">Due [% itemLoo.dateDue | html %]</span>
425
                                                                    <span class="checkedout">Due [% itemLoo.dateDue | $KohaDates as_due_date => 1 %]</span>
426
                                                                [% ELSIF ( itemLoo.transfertwhen ) %]
426
                                                                [% ELSIF ( itemLoo.transfertwhen ) %]
427
                                                                    <span class="intransit">In transit from [% Branches.GetName( itemLoo.transfertfrom ) | html %] to [% Branches.GetName( itemLoo.transfertto ) | html %] since [% itemLoo.transfertwhen | html %]</span>
427
                                                                    <span class="intransit">In transit from [% Branches.GetName( itemLoo.transfertfrom ) | html %] to [% Branches.GetName( itemLoo.transfertto ) | html %] since [% itemLoo.transfertwhen | $KohaDates %]</span>
428
                                                                [% END %]
428
                                                                [% END %]
429
429
430
                                                                [% IF ( itemLoo.message ) %]
430
                                                                [% IF ( itemLoo.message ) %]
Lines 453-459 Link Here
453
                                                                            [% itemLoo.waitingdate | $KohaDates %]
453
                                                                            [% itemLoo.waitingdate | $KohaDates %]
454
                                                                        [% ELSE %]
454
                                                                        [% ELSE %]
455
                                                                            [% IF ( itemLoo.reservedate ) %]
455
                                                                            [% IF ( itemLoo.reservedate ) %]
456
                                                                                [% itemLoo.reservedate | html %]
456
                                                                                [% itemLoo.reservedate | $KohaDates %]
457
                                                                            [% END %]
457
                                                                            [% END %]
458
                                                                        [% END %].
458
                                                                        [% END %].
459
                                                                    </span>
459
                                                                    </span>
(-)a/labels/label-item-search.pl (-13 / +4 lines)
Lines 30-36 use C4::Biblio qw( TransformMarcToKoha ); Link Here
30
use C4::Creators::Lib qw( html_table );
30
use C4::Creators::Lib qw( html_table );
31
31
32
use Koha::Logger;
32
use Koha::Logger;
33
use Koha::DateUtils qw( dt_from_string output_pref );
34
use Koha::Items;
33
use Koha::Items;
35
use Koha::ItemTypes;
34
use Koha::ItemTypes;
36
use Koha::SearchEngine::Search;
35
use Koha::SearchEngine::Search;
Lines 67-87 if ( $op eq "do_search" ) { Link Here
67
    $dateto   = $query->param('dateto');
66
    $dateto   = $query->param('dateto');
68
67
69
    if ($datefrom) {
68
    if ($datefrom) {
70
        $datefrom = eval { dt_from_string ( $datefrom ) };
69
        $ccl_query .= ' AND ' if $ccl_textbox;
71
        if ($datefrom) {
70
        $ccl_query .= "acqdate,ge,st-date-normalized=" . $datefrom;
72
            $datefrom = output_pref( { dt => $datefrom, dateonly => 1, dateformat => 'iso' } );
73
            $ccl_query .= ' AND ' if $ccl_textbox;
74
            $ccl_query .= "acqdate,ge,st-date-normalized=" . $datefrom;
75
        }
76
    }
71
    }
77
72
78
    if ($dateto) {
73
    if ($dateto) {
79
        $dateto = eval { dt_from_string ( $dateto ) };
74
        $ccl_query .= ' AND ' if ( $ccl_textbox || $datefrom );
80
        if ($dateto) {
75
        $ccl_query .= "acqdate,le,st-date-normalized=" . $dateto;
81
           $dateto = output_pref( { dt => $dateto, dateonly => 1, dateformat => 'iso' } );
82
            $ccl_query .= ' AND ' if ( $ccl_textbox || $datefrom );
83
            $ccl_query .= "acqdate,le,st-date-normalized=" . $dateto;
84
        }
85
    }
76
    }
86
77
87
    my $offset = $startfrom > 1 ? $startfrom - 1 : 0;
78
    my $offset = $startfrom > 1 ? $startfrom - 1 : 0;
(-)a/members/housebound.pl (-3 / +2 lines)
Lines 30-36 use C4::Auth qw( get_template_and_user ); Link Here
30
use C4::Context;
30
use C4::Context;
31
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers );
31
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers );
32
use DateTime;
32
use DateTime;
33
use Koha::DateUtils qw( dt_from_string );
34
use Koha::Libraries;
33
use Koha::Libraries;
35
use Koha::Patrons;
34
use Koha::Patrons;
36
use Koha::Patron::Categories;
35
use Koha::Patron::Categories;
Lines 124-130 if ( $method eq 'updateconfirm' and $houseboundprofile ) { Link Here
124
    # simple display.
123
    # simple display.
125
    $visit->set({
124
    $visit->set({
126
        borrowernumber      => scalar $input->param('borrowernumber')      // q{},
125
        borrowernumber      => scalar $input->param('borrowernumber')      // q{},
127
        appointment_date    => dt_from_string($input->param('date') // q{}),
126
        appointment_date    => scalar $input->param('date')                // q{},
128
        day_segment         => scalar $input->param('segment')             // q{},
127
        day_segment         => scalar $input->param('segment')             // q{},
129
        chooser_brwnumber   => scalar $input->param('chooser')             // q{},
128
        chooser_brwnumber   => scalar $input->param('chooser')             // q{},
130
        deliverer_brwnumber => scalar $input->param('deliverer')           // q{},
129
        deliverer_brwnumber => scalar $input->param('deliverer')           // q{},
Lines 138-144 if ( $method eq 'updateconfirm' and $houseboundprofile ) { Link Here
138
    # to simple display.
137
    # to simple display.
139
    my $visit = Koha::Patron::HouseboundVisit->new({
138
    my $visit = Koha::Patron::HouseboundVisit->new({
140
        borrowernumber      => scalar $input->param('borrowernumber')      // q{},
139
        borrowernumber      => scalar $input->param('borrowernumber')      // q{},
141
        appointment_date    => dt_from_string($input->param('date') // q{}),
140
        appointment_date    => scalar $input->param('date')                // q{},
142
        day_segment         => scalar $input->param('segment')             // q{},
141
        day_segment         => scalar $input->param('segment')             // q{},
143
        chooser_brwnumber   => scalar $input->param('chooser')             // q{},
142
        chooser_brwnumber   => scalar $input->param('chooser')             // q{},
144
        deliverer_brwnumber => scalar $input->param('deliverer')           // q{},
143
        deliverer_brwnumber => scalar $input->param('deliverer')           // q{},
(-)a/members/memberentry.pl (-23 / +3 lines)
Lines 37-43 use Koha::AuthorisedValues; Link Here
37
use Koha::Email;
37
use Koha::Email;
38
use Koha::Patron::Debarments qw( AddDebarment DelDebarment GetDebarments );
38
use Koha::Patron::Debarments qw( AddDebarment DelDebarment GetDebarments );
39
use Koha::Cities;
39
use Koha::Cities;
40
use Koha::DateUtils qw( dt_from_string output_pref );
40
use Koha::DateUtils qw( dt_from_string );
41
use Koha::Libraries;
41
use Koha::Libraries;
42
use Koha::Patrons;
42
use Koha::Patrons;
43
use Koha::Patron::Attribute::Types;
43
use Koha::Patron::Attribute::Types;
Lines 198-216 if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' ) Link Here
198
        }
198
        }
199
    }
199
    }
200
200
201
    foreach (qw(dateenrolled dateexpiry dateofbirth password_expiration_date)) {
202
        next unless exists $newdata{$_};
203
        my $userdate = $newdata{$_} or next;
204
205
        my $formatteddate = eval { output_pref({ dt => dt_from_string( $userdate ), dateformat => 'iso', dateonly => 1 } ); };
206
        if ( $formatteddate ) {
207
            $newdata{$_} = $formatteddate;
208
        } else {
209
            $template->param( "ERROR_$_" => 1 );
210
            push(@errors,"ERROR_$_");
211
        }
212
    }
213
214
    # check permission to modify login info.
201
    # check permission to modify login info.
215
    if (ref($borrower_data) && ($borrower_data->{'category_type'} eq 'S') && ! (C4::Auth::haspermission($userenv->{'id'},{'staffaccess'=>1})) )  {
202
    if (ref($borrower_data) && ($borrower_data->{'category_type'} eq 'S') && ! (C4::Auth::haspermission($userenv->{'id'},{'staffaccess'=>1})) )  {
216
        $NoUpdateLogin = 1;
203
        $NoUpdateLogin = 1;
Lines 787-796 if ($nok) { Link Here
787
  #Formatting data for display    
774
  #Formatting data for display    
788
  
775
  
789
if (!defined($data{'dateenrolled'}) or $data{'dateenrolled'} eq ''){
776
if (!defined($data{'dateenrolled'}) or $data{'dateenrolled'} eq ''){
790
  $data{'dateenrolled'} = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
777
  $data{'dateenrolled'} = dt_from_string;
791
}
778
}
792
if ( $op eq 'duplicate' ) {
779
if ( $op eq 'duplicate' ) {
793
    $data{'dateenrolled'} = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
780
    $data{'dateenrolled'} = dt_from_string;
794
    my $patron_category = Koha::Patron::Categories->find( $data{categorycode} );
781
    my $patron_category = Koha::Patron::Categories->find( $data{categorycode} );
795
    $data{dateexpiry} = $patron_category->get_expiry_date( $data{dateenrolled} );
782
    $data{dateexpiry} = $patron_category->get_expiry_date( $data{dateenrolled} );
796
}
783
}
Lines 799-811 if (C4::Context->preference('uppercasesurnames')) { Link Here
799
    $data{'contactname'} &&= uc( $data{'contactname'} );
786
    $data{'contactname'} &&= uc( $data{'contactname'} );
800
}
787
}
801
788
802
foreach (qw(dateenrolled dateexpiry dateofbirth password_expiration_date)) {
803
    if ( $data{$_} ) {
804
       $data{$_} = eval { output_pref({ dt => dt_from_string( $data{$_} ), dateonly => 1 } ); };  # back to syspref for display
805
    }
806
    $template->param( $_ => $data{$_});
807
}
808
809
if ( C4::Context->preference('ExtendedPatronAttributes') ) {
789
if ( C4::Context->preference('ExtendedPatronAttributes') ) {
810
    patron_attributes_form( $template, $extended_patron_attributes, $op );
790
    patron_attributes_form( $template, $extended_patron_attributes, $op );
811
}
791
}
(-)a/misc/cronjobs/fines.pl (-1 / +1 lines)
Lines 163-169 for my $overdue ( @{$overdues} ) { Link Here
163
                itemnumber     => $overdue->{itemnumber},
163
                itemnumber     => $overdue->{itemnumber},
164
                borrowernumber => $overdue->{borrowernumber},
164
                borrowernumber => $overdue->{borrowernumber},
165
                amount         => $amount,
165
                amount         => $amount,
166
                due            => output_pref($datedue),
166
                due            => $datedue,
167
            }
167
            }
168
        );
168
        );
169
        $updated++;
169
        $updated++;
(-)a/misc/cronjobs/serialsUpdate.pl (-2 / +2 lines)
Lines 25-31 use C4::Context; Link Here
25
use C4::Serials qw( GetSubscription GetNextDate ModSerialStatus );
25
use C4::Serials qw( GetSubscription GetNextDate ModSerialStatus );
26
use C4::Serials::Frequency;
26
use C4::Serials::Frequency;
27
use C4::Log qw( cronlogaction );
27
use C4::Log qw( cronlogaction );
28
use Koha::DateUtils qw( dt_from_string output_pref );
28
use Koha::DateUtils qw( dt_from_string );
29
29
30
use Date::Calc qw( check_date Date_to_Days );
30
use Date::Calc qw( check_date Date_to_Days );
31
use Getopt::Long qw( GetOptions );
31
use Getopt::Long qw( GetOptions );
Lines 113-119 while ( my $issue = $sth->fetchrow_hashref ) { Link Here
113
    if ( $subscription && $publisheddate ) {
113
    if ( $subscription && $publisheddate ) {
114
        my $freqdata = GetSubscriptionFrequency($subscription->{'periodicity'});
114
        my $freqdata = GetSubscriptionFrequency($subscription->{'periodicity'});
115
        my $nextpublisheddate = GetNextDate( $subscription, $publisheddate, $freqdata );
115
        my $nextpublisheddate = GetNextDate( $subscription, $publisheddate, $freqdata );
116
        my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
116
        my $today = dt_from_string->ymd;
117
117
118
        if ( $nextpublisheddate && $today ) {
118
        if ( $nextpublisheddate && $today ) {
119
            my ( $year,  $month,  $day )  = split( /-/, $nextpublisheddate );
119
            my ( $year,  $month,  $day )  = split( /-/, $nextpublisheddate );
(-)a/misc/cronjobs/staticfines.pl (-2 / +2 lines)
Lines 36-42 use C4::Calendar qw(); # don't need any exports from Calendar Link Here
36
use C4::Log qw( cronlogaction );
36
use C4::Log qw( cronlogaction );
37
use Getopt::Long qw( GetOptions );
37
use Getopt::Long qw( GetOptions );
38
use List::MoreUtils qw( none );
38
use List::MoreUtils qw( none );
39
use Koha::DateUtils qw( dt_from_string output_pref );
39
use Koha::DateUtils qw( dt_from_string );
40
use Koha::Patrons;
40
use Koha::Patrons;
41
41
42
my $help    = 0;
42
my $help    = 0;
Lines 126-132 if (defined $borrowernumberlimit) { Link Here
126
my $overdueItemsCounted = 0;
126
my $overdueItemsCounted = 0;
127
my %calendars           = ();
127
my %calendars           = ();
128
$today      = dt_from_string;
128
$today      = dt_from_string;
129
$today_iso  = output_pref( { dt => $today, dateonly => 1, dateformat => 'iso' } );
129
$today_iso  = $today->ymd;
130
my ($tyear, $tmonth, $tday) = split( /-/, $today_iso );
130
my ($tyear, $tmonth, $tday) = split( /-/, $today_iso );
131
$today_days = Date_to_Days( $tyear, $tmonth, $tday );
131
$today_days = Date_to_Days( $tyear, $tmonth, $tday );
132
132
(-)a/opac/opac-memberentry.pl (-15 / +1 lines)
Lines 35-41 use Koha::Patron::Consent; Link Here
35
use Koha::Patron::Modification;
35
use Koha::Patron::Modification;
36
use Koha::Patron::Modifications;
36
use Koha::Patron::Modifications;
37
use C4::Scrubber;
37
use C4::Scrubber;
38
use Koha::DateUtils qw( dt_from_string output_pref );
38
use Koha::DateUtils qw( dt_from_string );
39
use Koha::Email;
39
use Koha::Email;
40
use Koha::Libraries;
40
use Koha::Libraries;
41
use Koha::Patron::Attribute::Types;
41
use Koha::Patron::Attribute::Types;
Lines 545-564 sub ParseCgiForBorrower { Link Here
545
        }
545
        }
546
    }
546
    }
547
547
548
    if ( defined $borrower{'dateofbirth'} ) {
549
        my $dob_dt;
550
        $dob_dt = eval { dt_from_string( $borrower{'dateofbirth'} ); }
551
            if ( $borrower{'dateofbirth'} );
552
553
        if ( $dob_dt ) {
554
            $borrower{'dateofbirth'} = output_pref( { dt => $dob_dt, dateonly => 1, dateformat => 'iso' } );
555
        }
556
        else {
557
            # Trigger validation
558
            $borrower{'dateofbirth'} = undef;
559
        }
560
    }
561
562
    # Replace checkbox 'agreed' by datetime in gdpr_proc_consent
548
    # Replace checkbox 'agreed' by datetime in gdpr_proc_consent
563
    $borrower{gdpr_proc_consent} = dt_from_string if  $borrower{gdpr_proc_consent} && $borrower{gdpr_proc_consent} eq 'agreed';
549
    $borrower{gdpr_proc_consent} = dt_from_string if  $borrower{gdpr_proc_consent} && $borrower{gdpr_proc_consent} eq 'agreed';
564
550
(-)a/opac/opac-reserve.pl (-4 / +3 lines)
Lines 34-40 use C4::Overdues; Link Here
34
34
35
use Koha::AuthorisedValues;
35
use Koha::AuthorisedValues;
36
use Koha::Biblios;
36
use Koha::Biblios;
37
use Koha::DateUtils qw( dt_from_string output_pref );
38
use Koha::CirculationRules;
37
use Koha::CirculationRules;
39
use Koha::Items;
38
use Koha::Items;
40
use Koha::ItemTypes;
39
use Koha::ItemTypes;
Lines 506-512 foreach my $biblioNum (@biblionumbers) { Link Here
506
        # change the background color.
505
        # change the background color.
507
        my $issue = Koha::Checkouts->find( { itemnumber => $itemNum } );
506
        my $issue = Koha::Checkouts->find( { itemnumber => $itemNum } );
508
        if ( $issue ) {
507
        if ( $issue ) {
509
            $itemLoopIter->{dateDue} = output_pref({ dt => dt_from_string($issue->date_due, 'sql'), as_due_date => 1 });
508
            $itemLoopIter->{dateDue} = $issue->date_due;
510
            $itemLoopIter->{onloan} = 'onloan';
509
            $itemLoopIter->{onloan} = 'onloan';
511
        }
510
        }
512
511
Lines 515-521 foreach my $biblioNum (@biblionumbers) { Link Here
515
514
516
        if ( my $first_hold = $holds->next ) {
515
        if ( my $first_hold = $holds->next ) {
517
            $itemLoopIter->{backgroundcolor} = 'reserved';
516
            $itemLoopIter->{backgroundcolor} = 'reserved';
518
            $itemLoopIter->{reservedate}     = output_pref({ dt => dt_from_string($first_hold->reservedate), dateonly => 1 }); # FIXME Should be formatted in the template
517
            $itemLoopIter->{reservedate}     = $first_hold->reservedate;
519
            $itemLoopIter->{ExpectedAtLibrary}         = $first_hold->branchcode;
518
            $itemLoopIter->{ExpectedAtLibrary}         = $first_hold->branchcode;
520
            $itemLoopIter->{waitingdate} = $first_hold->waitingdate;
519
            $itemLoopIter->{waitingdate} = $first_hold->waitingdate;
521
        }
520
        }
Lines 545-551 foreach my $biblioNum (@biblionumbers) { Link Here
545
        my ( $transfertwhen, $transfertfrom, $transfertto ) =
544
        my ( $transfertwhen, $transfertfrom, $transfertto ) =
546
          GetTransfers($itemNum);
545
          GetTransfers($itemNum);
547
        if ( $transfertwhen && ($transfertwhen ne '') ) {
546
        if ( $transfertwhen && ($transfertwhen ne '') ) {
548
            $itemLoopIter->{transfertwhen} = output_pref({ dt => dt_from_string($transfertwhen), dateonly => 1 });
547
            $itemLoopIter->{transfertwhen} = $transfertwhen;
549
            $itemLoopIter->{transfertfrom} = $transfertfrom;
548
            $itemLoopIter->{transfertfrom} = $transfertfrom;
550
            $itemLoopIter->{transfertto} = $transfertto;
549
            $itemLoopIter->{transfertto} = $transfertto;
551
            $itemLoopIter->{nocancel} = 1;
550
            $itemLoopIter->{nocancel} = 1;
(-)a/opac/opac-suggestions.pl (-2 / +1 lines)
Lines 37-43 use Koha::AuthorisedValues; Link Here
37
use Koha::Libraries;
37
use Koha::Libraries;
38
use Koha::Patrons;
38
use Koha::Patrons;
39
39
40
use Koha::DateUtils qw( dt_from_string output_pref );
40
use Koha::DateUtils qw( dt_from_string );
41
41
42
my $input           = CGI->new;
42
my $input           = CGI->new;
43
my $op              = $input->param('op') || 'else';
43
my $op              = $input->param('op') || 'else';
Lines 151-157 my $patrons_total_suggestions_count = 0; Link Here
151
if ( $borrowernumber ){
151
if ( $borrowernumber ){
152
    if ( C4::Context->preference("MaxTotalSuggestions") ne '' && C4::Context->preference("NumberOfSuggestionDays") ne '' ) {
152
    if ( C4::Context->preference("MaxTotalSuggestions") ne '' && C4::Context->preference("NumberOfSuggestionDays") ne '' ) {
153
        my $suggesteddate_from = dt_from_string()->subtract(days=>C4::Context->preference("NumberOfSuggestionDays"));
153
        my $suggesteddate_from = dt_from_string()->subtract(days=>C4::Context->preference("NumberOfSuggestionDays"));
154
        $suggesteddate_from = output_pref({ dt => $suggesteddate_from, dateformat => 'iso', dateonly => 1 });
155
        $patrons_total_suggestions_count = Koha::Suggestions->search({ suggestedby => $borrowernumber, suggesteddate => { '>=' => $suggesteddate_from } })->count;
154
        $patrons_total_suggestions_count = Koha::Suggestions->search({ suggestedby => $borrowernumber, suggesteddate => { '>=' => $suggesteddate_from } })->count;
156
155
157
    }
156
    }
(-)a/pos/register.pl (-4 / +6 lines)
Lines 26-32 use C4::Context; Link Here
26
use Koha::Account::Lines;
26
use Koha::Account::Lines;
27
use Koha::Cash::Registers;
27
use Koha::Cash::Registers;
28
use Koha::Database;
28
use Koha::Database;
29
use Koha::DateUtils qw( dt_from_string output_pref );
29
use Koha::DateUtils qw( dt_from_string );
30
30
31
my $input = CGI->new();
31
my $input = CGI->new();
32
32
Lines 96-105 else { Link Here
96
                }
96
                }
97
            }
97
            }
98
        );
98
        );
99
        $template->param( past_accountlines => $past_accountlines );
99
        $template->param(
100
        $template->param( trange_f => output_pref({dt => $start, dateonly => 1}));
100
            past_accountlines => $past_accountlines,
101
            trange_f          => $start,
102
        );
101
    }
103
    }
102
    $template->param( trange_t => output_pref({dt => $end, dateonly => 1}));
104
    $template->param( trange_t => $end, );
103
105
104
    my $op = $input->param('op') // '';
106
    my $op = $input->param('op') // '';
105
    if ( $op eq 'cashup' ) {
107
    if ( $op eq 'cashup' ) {
(-)a/reports/acquisitions_stats.pl (-16 / +1 lines)
Lines 27-33 use C4::Output qw( output_html_with_http_headers ); Link Here
27
use C4::Koha qw( GetAuthorisedValues );
27
use C4::Koha qw( GetAuthorisedValues );
28
use C4::Biblio qw( GetMarcSubfieldStructureFromKohaField );
28
use C4::Biblio qw( GetMarcSubfieldStructureFromKohaField );
29
use Koha::ItemTypes;
29
use Koha::ItemTypes;
30
use Koha::DateUtils qw( dt_from_string output_pref );
31
use Koha::Libraries;
30
use Koha::Libraries;
32
31
33
=head1 NAME
32
=head1 NAME
Lines 46-59 my $fullreportname = "reports/acquisitions_stats.tt"; Link Here
46
my $line           = $input->param("Line");
45
my $line           = $input->param("Line");
47
my $column         = $input->param("Column");
46
my $column         = $input->param("Column");
48
my @filters        = $input->multi_param("Filter");
47
my @filters        = $input->multi_param("Filter");
49
$filters[0] = eval { output_pref( { dt => dt_from_string( $filters[0]), dateonly => 1, dateformat => 'iso' } ); }
50
    if ( $filters[0] );
51
$filters[1] = eval { output_pref( { dt => dt_from_string( $filters[1]), dateonly => 1, dateformat => 'iso' } ); }
52
    if ( $filters[1] );
53
$filters[2] = eval { output_pref( { dt => dt_from_string( $filters[2]), dateonly => 1, dateformat => 'iso' } ); }
54
    if ( $filters[2] );
55
$filters[3] = eval { output_pref( { dt => dt_from_string( $filters[3]), dateonly => 1, dateformat => 'iso' } ); }
56
    if ( $filters[3] );
57
my $podsp          = $input->param("PlacedOnDisplay");
48
my $podsp          = $input->param("PlacedOnDisplay");
58
my $rodsp          = $input->param("ReceivedOnDisplay");
49
my $rodsp          = $input->param("ReceivedOnDisplay");
59
my $calc           = $input->param("Cellvalue");
50
my $calc           = $input->param("Cellvalue");
Lines 235-247 sub calculate { Link Here
235
            if ( ( ( $i == 1 ) or ( $i == 3 ) ) and ( @$filters[ $i - 1 ] ) ) {
226
            if ( ( ( $i == 1 ) or ( $i == 3 ) ) and ( @$filters[ $i - 1 ] ) ) {
236
                $cell{err} = 1 if ( @$filters[$i] lt @$filters[ $i - 1 ] );
227
                $cell{err} = 1 if ( @$filters[$i] lt @$filters[ $i - 1 ] );
237
            }
228
            }
238
            # format the dates filters, otherwise just fill as is
229
            $cell{filter} = @$filters[$i];
239
            if ($i >= 4) {
240
                $cell{filter} = @$filters[$i];
241
            } else {
242
                $cell{filter} = eval { output_pref( { dt => dt_from_string( @$filters[$i] ), dateonly => 1 }); }
243
                   if ( @$filters[$i] );
244
            }
245
            $cell{crit} = $i;
230
            $cell{crit} = $i;
246
            push @loopfilter, \%cell;
231
            push @loopfilter, \%cell;
247
        }
232
        }
(-)a/reports/bor_issues_top.pl (-5 lines)
Lines 25-31 use C4::Output qw( output_html_with_http_headers ); Link Here
25
use C4::Context;
25
use C4::Context;
26
use C4::Reports qw( GetDelimiterChoices );
26
use C4::Reports qw( GetDelimiterChoices );
27
27
28
use Koha::DateUtils qw( dt_from_string output_pref );
29
use Koha::ItemTypes;
28
use Koha::ItemTypes;
30
use Koha::Patron::Categories;
29
use Koha::Patron::Categories;
31
30
Lines 43-51 my $do_it = $input->param('do_it'); Link Here
43
my $limit   = $input->param("Limit");
42
my $limit   = $input->param("Limit");
44
my $column  = $input->param("Criteria");
43
my $column  = $input->param("Criteria");
45
my @filters = $input->multi_param("Filter");
44
my @filters = $input->multi_param("Filter");
46
foreach ( @filters[0..3] ) {
47
    $_ and $_ = eval { output_pref( { dt => dt_from_string ( $_ ), dateonly => 1, dateformat => 'iso' }); };
48
}
49
my $output   = $input->param("output");
45
my $output   = $input->param("output");
50
my $basename = $input->param("basename");
46
my $basename = $input->param("basename");
51
my ($template, $borrowernumber, $cookie)
47
my ($template, $borrowernumber, $cookie)
Lines 143-149 sub calculate { Link Here
143
            if (($i==1) and (@$filters[$i-1])) {
139
            if (($i==1) and (@$filters[$i-1])) {
144
                $cell{err} = 1 if (@$filters[$i]<@$filters[$i-1]) ;
140
                $cell{err} = 1 if (@$filters[$i]<@$filters[$i-1]) ;
145
            }
141
            }
146
            # format the dates filters, otherwise just fill as is
147
            $cell{filter} .= @$filters[$i];
142
            $cell{filter} .= @$filters[$i];
148
			defined ($cellmap[$i]) and
143
			defined ($cellmap[$i]) and
149
				$cell{crit} .= $cellmap[$i];
144
				$cell{crit} .= $cellmap[$i];
(-)a/reports/borrowers_out.pl (-3 lines)
Lines 25-31 use C4::Context; Link Here
25
use C4::Output qw( output_html_with_http_headers );
25
use C4::Output qw( output_html_with_http_headers );
26
use C4::Reports qw( GetDelimiterChoices );
26
use C4::Reports qw( GetDelimiterChoices );
27
27
28
use Koha::DateUtils qw( dt_from_string output_pref );
29
use Koha::Patron::Categories;
28
use Koha::Patron::Categories;
30
29
31
=head1 NAME
30
=head1 NAME
Lines 44-51 my $fullreportname = "reports/borrowers_out.tt"; Link Here
44
my $limit = $input->param("Limit");
43
my $limit = $input->param("Limit");
45
my $column = $input->param("Criteria");
44
my $column = $input->param("Criteria");
46
my @filters = $input->multi_param("Filter");
45
my @filters = $input->multi_param("Filter");
47
$filters[1] = eval { output_pref( { dt => dt_from_string( $filters[1]), dateonly => 1, dateformat => 'iso' } ); }
48
    if ( $filters[1] );
49
46
50
my $output = $input->param("output");
47
my $output = $input->param("output");
51
my $basename = $input->param("basename");
48
my $basename = $input->param("basename");
(-)a/reports/borrowers_stats.pl (-12 lines)
Lines 27-33 use C4::Output qw( output_html_with_http_headers ); Link Here
27
use C4::Reports qw( GetDelimiterChoices );
27
use C4::Reports qw( GetDelimiterChoices );
28
28
29
use Koha::AuthorisedValues;
29
use Koha::AuthorisedValues;
30
use Koha::DateUtils qw( dt_from_string output_pref );
31
use Koha::Libraries;
30
use Koha::Libraries;
32
use Koha::Patron::Attribute::Types;
31
use Koha::Patron::Attribute::Types;
33
use Koha::Patron::Categories;
32
use Koha::Patron::Categories;
Lines 48-57 my $fullreportname = "reports/borrowers_stats.tt"; Link Here
48
my $line = $input->param("Line");
47
my $line = $input->param("Line");
49
my $column = $input->param("Column");
48
my $column = $input->param("Column");
50
my @filters = $input->multi_param("Filter");
49
my @filters = $input->multi_param("Filter");
51
$filters[3] = eval { output_pref( { dt => dt_from_string( $filters[3]), dateonly => 1, dateformat => 'iso' } ); }
52
    if ( $filters[3] );
53
$filters[4] = eval { output_pref ({ dt => dt_from_string( $filters[4]), dateonly => 1, dateformat => 'iso' } ); }
54
    if ( $filters[4] );
55
my $digits = $input->param("digits");
50
my $digits = $input->param("digits");
56
our $period = $input->param("period");
51
our $period = $input->param("period");
57
my $borstat = $input->param("status");
52
my $borstat = $input->param("status");
Lines 190-202 sub calculate { Link Here
190
    foreach my $i (0 .. scalar @$filters) {
185
    foreach my $i (0 .. scalar @$filters) {
191
        my %cell;
186
        my %cell;
192
        if ( @$filters[$i] ) {
187
        if ( @$filters[$i] ) {
193
            if ($i == 3 or $i == 4) {
194
                $cell{filter} = eval { output_pref( { dt => dt_from_string( @$filters[$i] ), dateonly => 1 }); }
195
                    if ( @$filters[$i] );
196
            } else {
197
                $cell{filter} = @$filters[$i];
198
            }
199
200
            if    ( $i == 0)  { $cell{crit} = "Cat code"; }
188
            if    ( $i == 0)  { $cell{crit} = "Cat code"; }
201
            elsif ( $i == 1 ) { $cell{crit} = "ZIP/Postal code"; }
189
            elsif ( $i == 1 ) { $cell{crit} = "ZIP/Postal code"; }
202
            elsif ( $i == 2 ) { $cell{crit} = "Branch code"; }
190
            elsif ( $i == 2 ) { $cell{crit} = "Branch code"; }
(-)a/reports/cash_register_stats.pl (-7 / +3 lines)
Lines 22-28 use C4::Context; Link Here
22
use C4::Reports qw( GetDelimiterChoices );
22
use C4::Reports qw( GetDelimiterChoices );
23
use C4::Output qw( output_html_with_http_headers );
23
use C4::Output qw( output_html_with_http_headers );
24
use DateTime;
24
use DateTime;
25
use Koha::DateUtils qw( dt_from_string output_pref );
25
use Koha::DateUtils qw( dt_from_string );
26
use Text::CSV::Encoded;
26
use Text::CSV::Encoded;
27
use List::Util qw( any );
27
use List::Util qw( any );
28
28
Lines 51-58 $template->param( Link Here
51
);
51
);
52
52
53
#Initialize date pickers to today
53
#Initialize date pickers to today
54
my $fromDate = dt_from_string;
54
my $fromDate = $input->param("from") || dt_from_string;
55
my $toDate   = dt_from_string;
55
my $toDate   = $input->param("to")   || dt_from_string;
56
56
57
my @debit_types =
57
my @debit_types =
58
  Koha::Account::DebitTypes->search()->as_list;
58
  Koha::Account::DebitTypes->search()->as_list;
Lines 62-71 my $registerid; Link Here
62
62
63
if ($do_it) {
63
if ($do_it) {
64
64
65
    $fromDate = output_pref({ dt => eval { dt_from_string(scalar $input->param("from")) } || dt_from_string,
66
            dateformat => 'sql', dateonly => 1 }); #for sql query
67
    $toDate   = output_pref({ dt => eval { dt_from_string(scalar $input->param("to")) } || dt_from_string,
68
            dateformat => 'sql', dateonly => 1 }); #for sql query
69
65
70
    my $whereTType = q{};
66
    my $whereTType = q{};
71
    my @extra_params; # if we add conditions to the select we need extra params
67
    my @extra_params; # if we add conditions to the select we need extra params
(-)a/reports/cat_issues_top.pl (-11 / +1 lines)
Lines 25-31 use C4::Context; Link Here
25
use C4::Output qw( output_html_with_http_headers );
25
use C4::Output qw( output_html_with_http_headers );
26
use C4::Koha qw( GetAuthorisedValues );
26
use C4::Koha qw( GetAuthorisedValues );
27
use C4::Reports qw( GetDelimiterChoices );
27
use C4::Reports qw( GetDelimiterChoices );
28
use Koha::DateUtils qw( dt_from_string output_pref );
29
use Koha::ItemTypes;
28
use Koha::ItemTypes;
30
29
31
=head1 NAME
30
=head1 NAME
Lines 42-50 my $fullreportname = "reports/cat_issues_top.tt"; Link Here
42
my $limit = $input->param("Limit");
41
my $limit = $input->param("Limit");
43
my $column = $input->param("Criteria");
42
my $column = $input->param("Criteria");
44
my @filters = $input->multi_param("Filter");
43
my @filters = $input->multi_param("Filter");
45
foreach ( @filters[0..3] ) {
46
    $_ and $_ = eval { output_pref( { dt => dt_from_string ( $_ ), dateonly => 1, dateformat => 'iso' } ); };
47
}
48
44
49
my $output = $input->param("output");
45
my $output = $input->param("output");
50
my $basename = $input->param("basename");
46
my $basename = $input->param("basename");
Lines 165-177 sub calculate { Link Here
165
            if (($i==1) and (@$filters[$i-1])) {
161
            if (($i==1) and (@$filters[$i-1])) {
166
                $cell{err} = 1 if (@$filters[$i]<@$filters[$i-1]) ;
162
                $cell{err} = 1 if (@$filters[$i]<@$filters[$i-1]) ;
167
            }
163
            }
168
            # format the dates filters, otherwise just fill as is
164
            $cell{filter} .= @$filters[$i];
169
            if ($i>=2) {
170
                $cell{filter} .= @$filters[$i];
171
            } else {
172
                $cell{filter} .= eval { output_pref( { dt => dt_from_string( @$filters[$i] ), dateonly => 1 }); }
173
                   if ( @$filters[$i] );
174
            }
175
            $cell{crit} .="Issue From" if ($i==0);
165
            $cell{crit} .="Issue From" if ($i==0);
176
            $cell{crit} .="Issue To" if ($i==1);
166
            $cell{crit} .="Issue To" if ($i==1);
177
            $cell{crit} .="Return From" if ($i==2);
167
            $cell{crit} .="Return From" if ($i==2);
(-)a/reports/dictionary.pl (-9 lines)
Lines 137-145 elsif ( $phase eq 'New Term step 5' ) { Link Here
137
            $tmp_hash{'name'}  = $crit;
137
            $tmp_hash{'name'}  = $crit;
138
            $tmp_hash{'value'} = $value;
138
            $tmp_hash{'value'} = $value;
139
            push @criteria_loop, \%tmp_hash;
139
            push @criteria_loop, \%tmp_hash;
140
            my $value_dt = eval { dt_from_string( $value ) };
141
            $value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } )
142
                if ( $value_dt );
143
140
144
            $query_criteria .= " AND $crit='$value'";
141
            $query_criteria .= " AND $crit='$value'";
145
        }
142
        }
Lines 151-159 elsif ( $phase eq 'New Term step 5' ) { Link Here
151
                    $tmp_hash{'name'}  = "$crit Start";
148
                    $tmp_hash{'name'}  = "$crit Start";
152
                    $tmp_hash{'value'} = $value;
149
                    $tmp_hash{'value'} = $value;
153
                    push @criteria_loop, \%tmp_hash;
150
                    push @criteria_loop, \%tmp_hash;
154
                    my $value_dt = eval { dt_from_string( $value ) };
155
                    $value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } )
156
                        if ( $value_dt );
157
151
158
                    $query_criteria .= " AND $crit >= '$value'";
152
                    $query_criteria .= " AND $crit >= '$value'";
159
                }
153
                }
Lines 163-171 elsif ( $phase eq 'New Term step 5' ) { Link Here
163
                    $tmp_hash{'name'}  = "$crit End";
157
                    $tmp_hash{'name'}  = "$crit End";
164
                    $tmp_hash{'value'} = $value;
158
                    $tmp_hash{'value'} = $value;
165
                    push @criteria_loop, \%tmp_hash;
159
                    push @criteria_loop, \%tmp_hash;
166
                    my $value_dt = eval { dt_from_string( $value ) };
167
                    $value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } )
168
                        if ( $value_dt );
169
160
170
                    $query_criteria .= " AND $crit <= '$value'";
161
                    $query_criteria .= " AND $crit <= '$value'";
171
                }
162
                }
(-)a/reports/guided_reports.pl (-20 lines)
Lines 30-36 use C4::Output qw( pagination_bar output_html_with_http_headers ); Link Here
30
use C4::Context;
30
use C4::Context;
31
use Koha::Caches;
31
use Koha::Caches;
32
use C4::Log qw( logaction );
32
use C4::Log qw( logaction );
33
use Koha::DateUtils qw( dt_from_string output_pref );
34
use Koha::AuthorisedValue;
33
use Koha::AuthorisedValue;
35
use Koha::AuthorisedValues;
34
use Koha::AuthorisedValues;
36
use Koha::BiblioFrameworks;
35
use Koha::BiblioFrameworks;
Lines 401-432 elsif ( $phase eq 'Choose these criteria' ) { Link Here
401
400
402
        # If value is not defined, then it may be range values
401
        # If value is not defined, then it may be range values
403
        if (!defined $value) {
402
        if (!defined $value) {
404
405
            my $fromvalue = $input->param( "from_" . $crit . "_value" );
403
            my $fromvalue = $input->param( "from_" . $crit . "_value" );
406
            my $tovalue   = $input->param( "to_"   . $crit . "_value" );
404
            my $tovalue   = $input->param( "to_"   . $crit . "_value" );
407
405
408
            # If the range values are dates
409
            my $fromvalue_dt;
410
            $fromvalue_dt = eval { dt_from_string( $fromvalue ); } if ( $fromvalue );
411
            my $tovalue_dt;
412
            $tovalue_dt = eval { dt_from_string( $tovalue ); } if ($tovalue);
413
            if ( $fromvalue_dt && $tovalue_dt ) {
414
                $fromvalue = output_pref( { dt => dt_from_string( $fromvalue_dt ), dateonly => 1, dateformat => 'iso' } );
415
                $tovalue   = output_pref( { dt => dt_from_string( $tovalue_dt ), dateonly => 1, dateformat => 'iso' } );
416
            }
417
418
            if ($fromvalue && $tovalue) {
406
            if ($fromvalue && $tovalue) {
419
                $query_criteria .= " AND $crit >= '$fromvalue' AND $crit <= '$tovalue'";
407
                $query_criteria .= " AND $crit >= '$fromvalue' AND $crit <= '$tovalue'";
420
            }
408
            }
421
422
        } else {
409
        } else {
423
424
            # If value is a date
425
            my $value_dt;
426
            $value_dt  =  eval { dt_from_string( $value ); } if ( $value );
427
            if ( $value_dt ) {
428
                $value = output_pref( { dt => dt_from_string( $value_dt ), dateonly => 1, dateformat => 'iso' } );
429
            }
430
            # don't escape runtime parameters, they'll be at runtime
410
            # don't escape runtime parameters, they'll be at runtime
431
            if ($value =~ /<<.*>>/) {
411
            if ($value =~ /<<.*>>/) {
432
                $query_criteria .= " AND $crit=$value";
412
                $query_criteria .= " AND $crit=$value";
(-)a/reports/issues_avg_stats.pl (-17 / +1 lines)
Lines 24-30 use CGI qw ( -utf8 ); Link Here
24
use C4::Context;
24
use C4::Context;
25
use C4::Output qw( output_html_with_http_headers );
25
use C4::Output qw( output_html_with_http_headers );
26
use C4::Reports qw( GetDelimiterChoices );
26
use C4::Reports qw( GetDelimiterChoices );
27
use Koha::DateUtils qw( dt_from_string output_pref );
28
use Koha::ItemTypes;
27
use Koha::ItemTypes;
29
use Koha::Patron::Categories;
28
use Koha::Patron::Categories;
30
use Date::Calc qw( Delta_Days );
29
use Date::Calc qw( Delta_Days );
Lines 43-57 my $fullreportname = "reports/issues_avg_stats.tt"; Link Here
43
my $line = $input->param("Line");
42
my $line = $input->param("Line");
44
my $column = $input->param("Column");
43
my $column = $input->param("Column");
45
my @filters = $input->multi_param("Filter");
44
my @filters = $input->multi_param("Filter");
46
$filters[0] = eval { output_pref( { dt => dt_from_string( $filters[0]), dateonly => 1, dateformat => 'iso' } ); }
47
    if ( $filters[0] );
48
$filters[1] = eval { output_pref( { dt => dt_from_string( $filters[1]), dateonly => 1, dateformat => 'iso' } ); }
49
    if ( $filters[1] );
50
$filters[2] = eval { output_pref( { dt => dt_from_string( $filters[2]), dateonly => 1, dateformat => 'iso' } ); }
51
    if ( $filters[2] );
52
$filters[3] = eval { output_pref( { dt => dt_from_string( $filters[3]), dateonly => 1, dateformat => 'iso' } ); }
53
    if ( $filters[3] );
54
55
45
56
my $podsp = $input->param("IssueDisplay");
46
my $podsp = $input->param("IssueDisplay");
57
my $rodsp = $input->param("ReturnDisplay");
47
my $rodsp = $input->param("ReturnDisplay");
Lines 186-198 sub calculate { Link Here
186
            if (($i==1) and (@$filters[$i-1])) {
176
            if (($i==1) and (@$filters[$i-1])) {
187
                $cell{err} = 1 if (@$filters[$i]<@$filters[$i-1]) ;
177
                $cell{err} = 1 if (@$filters[$i]<@$filters[$i-1]) ;
188
            }
178
            }
189
            # format the dates filters, otherwise just fill as is
179
            $cell{filter} .= @$filters[$i];
190
            if ($i>=4) {
191
                $cell{filter} .= @$filters[$i];
192
            } else {
193
                $cell{filter} .= eval { output_pref( { dt => dt_from_string( @$filters[$i] ), dateonly => 1 }); }
194
                   if ( @$filters[$i] );
195
            }
196
            $cell{crit} .="Issue From" if ($i==0);
180
            $cell{crit} .="Issue From" if ($i==0);
197
            $cell{crit} .="Issue To" if ($i==1);
181
            $cell{crit} .="Issue To" if ($i==1);
198
            $cell{crit} .="Issue Month" if ($i==2);
182
            $cell{crit} .="Issue Month" if ($i==2);
(-)a/reports/issues_stats.pl (-11 / +1 lines)
Lines 28-34 use C4::Output qw( output_html_with_http_headers ); Link Here
28
use C4::Reports qw( GetDelimiterChoices );
28
use C4::Reports qw( GetDelimiterChoices );
29
29
30
use Koha::AuthorisedValues;
30
use Koha::AuthorisedValues;
31
use Koha::DateUtils qw( dt_from_string output_pref );
32
use Koha::ItemTypes;
31
use Koha::ItemTypes;
33
use Koha::Patron::Attribute::Types;
32
use Koha::Patron::Attribute::Types;
34
33
Lines 48-57 my $do_it = $input->param('do_it'); Link Here
48
my $line     = $input->param("Line");
47
my $line     = $input->param("Line");
49
my $column   = $input->param("Column");
48
my $column   = $input->param("Column");
50
my @filters  = $input->multi_param("Filter");
49
my @filters  = $input->multi_param("Filter");
51
$filters[0] = eval { output_pref( { dt => dt_from_string( $filters[0]), dateonly => 1, dateformat => 'iso' } ); }
52
    if ( $filters[0] );
53
$filters[1] = eval { output_pref( { dt => dt_from_string( $filters[1]), dateonly => 1, dateformat => 'iso' } ); }
54
    if ( $filters[1] );
55
my $podsp    = $input->param("DisplayBy");
50
my $podsp    = $input->param("DisplayBy");
56
my $type     = $input->param("PeriodTypeSel");
51
my $type     = $input->param("PeriodTypeSel");
57
my $daysel   = $input->param("PeriodDaySel");
52
my $daysel   = $input->param("PeriodDaySel");
Lines 220-231 sub calculate { Link Here
220
            $cell{err} = 1 if ( @$filters[$i] < @$filters[ $i - 1 ] );
215
            $cell{err} = 1 if ( @$filters[$i] < @$filters[ $i - 1 ] );
221
        }
216
        }
222
            # format the dates filters, otherwise just fill as is
217
            # format the dates filters, otherwise just fill as is
223
        if ($i>=2) {
218
        $cell{filter} = @$filters[$i];
224
            $cell{filter} = @$filters[$i];
225
        } else {
226
            $cell{filter} = eval { output_pref( { dt => dt_from_string( @$filters[$i] ), dateonly => 1 }); }
227
              if ( @$filters[$i] );
228
        }
229
        $cell{crit} = $i;
219
        $cell{crit} = $i;
230
220
231
        push @loopfilter, \%cell;
221
        push @loopfilter, \%cell;
(-)a/reports/orders_by_fund.pl (-4 / +1 lines)
Lines 33-39 use C4::Output qw( output_html_with_http_headers ); Link Here
33
use C4::Budgets qw( GetBudgetsReport GetBudgetHierarchy );
33
use C4::Budgets qw( GetBudgetsReport GetBudgetHierarchy );
34
use C4::Acquisition qw( GetBasket get_rounded_price );
34
use C4::Acquisition qw( GetBasket get_rounded_price );
35
use Koha::Biblios;
35
use Koha::Biblios;
36
use Koha::DateUtils qw( dt_from_string output_pref );
37
36
38
my $query = CGI->new;
37
my $query = CGI->new;
39
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 106-114 if ( $get_orders ) { Link Here
106
        $order->{'total_rrp'} = get_rounded_price($order->{'quantity'}) * $order->{'rrp'};
105
        $order->{'total_rrp'} = get_rounded_price($order->{'quantity'}) * $order->{'rrp'};
107
        $order->{'total_ecost'} = get_rounded_price($order->{'quantity'}) * $order->{'ecost'};
106
        $order->{'total_ecost'} = get_rounded_price($order->{'quantity'}) * $order->{'ecost'};
108
107
109
        # Format the dates and currencies correctly
108
        # Format the currencies correctly
110
        $order->{'datereceived'} = output_pref(dt_from_string($order->{'datereceived'}));
111
        $order->{'entrydate'} = output_pref(dt_from_string($order->{'entrydate'}));
112
        $total_quantity += $order->{'quantity'};
109
        $total_quantity += $order->{'quantity'};
113
        $total_rrp += $order->{'total_rrp'};
110
        $total_rrp += $order->{'total_rrp'};
114
        $total_ecost += $order->{'total_ecost'};
111
        $total_ecost += $order->{'total_ecost'};
(-)a/reports/reserves_stats.pl (-10 / +1 lines)
Lines 28-34 use C4::Output qw( output_html_with_http_headers ); Link Here
28
use C4::Reports qw( GetDelimiterChoices );
28
use C4::Reports qw( GetDelimiterChoices );
29
use C4::Members;
29
use C4::Members;
30
use Koha::AuthorisedValues;
30
use Koha::AuthorisedValues;
31
use Koha::DateUtils qw( dt_from_string output_pref );
32
use Koha::ItemTypes;
31
use Koha::ItemTypes;
33
use Koha::Libraries;
32
use Koha::Libraries;
34
use Koha::Patron::Categories;
33
use Koha::Patron::Categories;
Lines 170-190 sub calculate { Link Here
170
    my @loopfilter;
169
    my @loopfilter;
171
    foreach my $filter ( keys %$filters_hashref ) {
170
    foreach my $filter ( keys %$filters_hashref ) {
172
        $filters_hashref->{$filter} =~ s/\*/%/;
171
        $filters_hashref->{$filter} =~ s/\*/%/;
173
        if ( $filter =~ /date/ ) {
174
            $filters_hashref->{$filter} =
175
                eval { output_pref( { dt => dt_from_string( $filters_hashref->{$filter} ), dateonly => 1, dateformat => 'iso' }); };
176
        }
177
    }
172
    }
178
173
179
    #display
174
    #display
180
    @loopfilter = map {
175
    @loopfilter = map {
181
        {
176
        {
182
            crit   => $_,
177
            crit   => $_,
183
            filter => (
178
            filter => $filters_hashref->{$_},
184
                $_ =~ /date/
185
                ? eval { output_pref( { dt => dt_from_string( $filters_hashref->{$_} ), dateonly => 1 }); }
186
                : $filters_hashref->{$_}
187
            )
188
        }
179
        }
189
    } sort keys %$filters_hashref;
180
    } sort keys %$filters_hashref;
190
181
(-)a/reserve/modrequest.pl (-3 / +2 lines)
Lines 31-37 use Try::Tiny; Link Here
31
use C4::Output;
31
use C4::Output;
32
use C4::Reserves qw( ModReserve ModReserveCancelAll );
32
use C4::Reserves qw( ModReserve ModReserveCancelAll );
33
use C4::Auth qw( get_template_and_user );
33
use C4::Auth qw( get_template_and_user );
34
use Koha::DateUtils qw( dt_from_string );
35
use Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue;
34
use Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue;
36
35
37
my $query = CGI->new;
36
my $query = CGI->new;
Lines 77-90 else { Link Here
77
        my $params = {
76
        my $params = {
78
            rank => $rank[$i],
77
            rank => $rank[$i],
79
            reserve_id => $reserve_id[$i],
78
            reserve_id => $reserve_id[$i],
80
            expirationdate => $expirationdates[$i] ? dt_from_string($expirationdates[$i]) : undef,
79
            expirationdate => $expirationdates[$i] || undef,
81
            branchcode => $branch[$i],
80
            branchcode => $branch[$i],
82
            itemnumber => $itemnumber[$i],
81
            itemnumber => $itemnumber[$i],
83
            defined $suspend_until ? ( suspend_until => $suspend_until ) : (),
82
            defined $suspend_until ? ( suspend_until => $suspend_until ) : (),
84
            cancellation_reason => $cancellation_reason,
83
            cancellation_reason => $cancellation_reason,
85
        };
84
        };
86
        if (C4::Context->preference('AllowHoldDateInFuture')) {
85
        if (C4::Context->preference('AllowHoldDateInFuture')) {
87
            $params->{reservedate} = $reservedates[$i] ? dt_from_string($reservedates[$i]) : undef;
86
            $params->{reservedate} = $reservedates[$i] || undef;
88
        }
87
        }
89
88
90
        try {
89
        try {
(-)a/reserve/request.pl (-6 / +4 lines)
Lines 38-48 use C4::Items qw( get_hostitemnumbers_of ); Link Here
38
use C4::Koha qw( getitemtypeimagelocation );
38
use C4::Koha qw( getitemtypeimagelocation );
39
use C4::Serials qw( CountSubscriptionFromBiblionumber );
39
use C4::Serials qw( CountSubscriptionFromBiblionumber );
40
use C4::Circulation qw( GetTransfers _GetCircControlBranch GetBranchItemRule );
40
use C4::Circulation qw( GetTransfers _GetCircControlBranch GetBranchItemRule );
41
use Koha::DateUtils qw( dt_from_string output_pref );
41
use Koha::DateUtils qw( dt_from_string );
42
use C4::Search qw( enabled_staff_search_views );
42
use C4::Search qw( enabled_staff_search_views );
43
43
44
use Koha::Biblios;
44
use Koha::Biblios;
45
use Koha::DateUtils qw( dt_from_string output_pref );
46
use Koha::Checkouts;
45
use Koha::Checkouts;
47
use Koha::Holds;
46
use Koha::Holds;
48
use Koha::CirculationRules;
47
use Koha::CirculationRules;
Lines 90-96 my $messages; Link Here
90
my $exceeded_maxreserves;
89
my $exceeded_maxreserves;
91
my $exceeded_holds_per_record;
90
my $exceeded_holds_per_record;
92
91
93
my $date = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
94
my $action = $input->param('action');
92
my $action = $input->param('action');
95
$action ||= q{};
93
$action ||= q{};
96
94
Lines 431-437 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
431
                    my $p = Koha::Patrons->find( $first_hold->borrowernumber );
429
                    my $p = Koha::Patrons->find( $first_hold->borrowernumber );
432
430
433
                    $item->{backgroundcolor} = 'reserved';
431
                    $item->{backgroundcolor} = 'reserved';
434
                    $item->{reservedate}     = output_pref({ dt => dt_from_string( $first_hold->reservedate ), dateonly => 1 }); # FIXME Should be formatted in the template
432
                    $item->{reservedate}     = $first_hold->reservedate;
435
                    $item->{ReservedFor}     = $p;
433
                    $item->{ReservedFor}     = $p;
436
                    $item->{ExpectedAtLibrary}     = $first_hold->branchcode;
434
                    $item->{ExpectedAtLibrary}     = $first_hold->branchcode;
437
                    $item->{waitingdate} = $first_hold->waitingdate;
435
                    $item->{waitingdate} = $first_hold->waitingdate;
Lines 456-462 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
456
                  GetTransfers($item_object->itemnumber); # FIXME replace with get_transfer
454
                  GetTransfers($item_object->itemnumber); # FIXME replace with get_transfer
457
455
458
                if ( defined $transfertwhen && $transfertwhen ne '' ) {
456
                if ( defined $transfertwhen && $transfertwhen ne '' ) {
459
                    $item->{transfertwhen} = output_pref({ dt => dt_from_string( $transfertwhen ), dateonly => 1 });
457
                    $item->{transfertwhen} = $transfertwhen;
460
                    $item->{transfertfrom} = $transfertfrom;
458
                    $item->{transfertfrom} = $transfertfrom;
461
                    $item->{transfertto} = $transfertto;
459
                    $item->{transfertto} = $transfertto;
462
                    $item->{nocancel} = 1;
460
                    $item->{nocancel} = 1;
Lines 663-669 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
663
        $template->param(
661
        $template->param(
664
                         itemdata_enumchron => $itemdata_enumchron,
662
                         itemdata_enumchron => $itemdata_enumchron,
665
                         itemdata_ccode    => $itemdata_ccode,
663
                         itemdata_ccode    => $itemdata_ccode,
666
                         date              => $date,
664
                         date              => dt_from_string,
667
                         biblionumber      => $biblionumber,
665
                         biblionumber      => $biblionumber,
668
                         findborrower      => $findborrower,
666
                         findborrower      => $findborrower,
669
                         biblio            => $biblio,
667
                         biblio            => $biblio,
(-)a/serials/serials-edit.pl (-12 / +4 lines)
Lines 72-78 use C4::Context; Link Here
72
use C4::Serials qw( GetSerials GetSerials2 GetSerialInformation HasSubscriptionExpired GetSubscription abouttoexpire NewIssue ModSerialStatus GetPreviousSerialid AddItem2Serial );
72
use C4::Serials qw( GetSerials GetSerials2 GetSerialInformation HasSubscriptionExpired GetSubscription abouttoexpire NewIssue ModSerialStatus GetPreviousSerialid AddItem2Serial );
73
use C4::Search qw( enabled_staff_search_views );
73
use C4::Search qw( enabled_staff_search_views );
74
74
75
use Koha::DateUtils qw( dt_from_string output_pref );
75
use Koha::DateUtils qw( dt_from_string );
76
use Koha::Items;
76
use Koha::Items;
77
use Koha::Serial::Items;
77
use Koha::Serial::Items;
78
78
Lines 128-134 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
128
my @serialdatalist;
128
my @serialdatalist;
129
my %processedserialid;
129
my %processedserialid;
130
130
131
my $today = output_pref( { dt => dt_from_string, dateonly => 1 } );
131
my $today = dt_from_string;
132
132
133
foreach my $serialid (@serialids) {
133
foreach my $serialid (@serialids) {
134
134
Lines 140-153 foreach my $serialid (@serialids) { Link Here
140
    {
140
    {
141
        my $serinfo = GetSerialInformation($serialid); #TODO duplicates work done by GetSerials2 above
141
        my $serinfo = GetSerialInformation($serialid); #TODO duplicates work done by GetSerials2 above
142
142
143
        for my $d ( qw( publisheddate planneddate )){
144
            if ( $serinfo->{$d} =~m/^00/ ) {
145
                $serinfo->{$d} = q{};
146
            }
147
            else {
148
                $serinfo->{$d} = output_pref( { dt => dt_from_string( $serinfo->{$d} ), dateonly => 1 } );
149
            }
150
        }
151
        $serinfo->{arriveddate} = $today;
143
        $serinfo->{arriveddate} = $today;
152
144
153
        $serinfo->{'editdisable'} = (
145
        $serinfo->{'editdisable'} = (
Lines 216-225 if ( $op and $op eq 'serialchangestatus' ) { Link Here
216
        my ($plan_date, $pub_date);
208
        my ($plan_date, $pub_date);
217
209
218
        if (defined $planneddates[$i] && $planneddates[$i] ne 'XXX') {
210
        if (defined $planneddates[$i] && $planneddates[$i] ne 'XXX') {
219
            $plan_date = eval { output_pref( { dt => dt_from_string( $planneddates[$i] ), dateonly => 1, dateformat => 'iso' } ); };
211
            $plan_date = $planneddates[$i];
220
        }
212
        }
221
        if (defined $publisheddates[$i] && $publisheddates[$i] ne 'XXX') {
213
        if (defined $publisheddates[$i] && $publisheddates[$i] ne 'XXX') {
222
            $pub_date = eval { output_pref( { dt => dt_from_string( $publisheddates[$i] ), dateonly => 1, dateformat => 'iso' } ); };
214
            $pub_date = $publisheddates[$i];
223
        }
215
        }
224
216
225
        if ( $serialids[$i] && $serialids[$i] eq 'NEW' ) {
217
        if ( $serialids[$i] && $serialids[$i] eq 'NEW' ) {
(-)a/serials/serials-search.pl (-4 / +3 lines)
Lines 88-94 for my $field ( @additional_fields ) { Link Here
88
    }
88
    }
89
}
89
}
90
90
91
my $expiration_date_dt = $expiration_date ? dt_from_string( $expiration_date ) : undef;
92
my @subscriptions;
91
my @subscriptions;
93
my $mana_statuscode;
92
my $mana_statuscode;
94
if ($searched){
93
if ($searched){
Lines 115-121 if ($searched){ Link Here
115
            branch       => $branch,
114
            branch       => $branch,
116
            additional_fields => \@additional_field_filters,
115
            additional_fields => \@additional_field_filters,
117
            location     => $location,
116
            location     => $location,
118
            expiration_date => $expiration_date_dt,
117
            expiration_date => $expiration_date,
119
        });
118
        });
120
    }
119
    }
121
}
120
}
Lines 133-139 if ($mana) { Link Here
133
        bookseller_filter  => $bookseller,
132
        bookseller_filter  => $bookseller,
134
        branch_filter => $branch,
133
        branch_filter => $branch,
135
        location_filter => $location,
134
        location_filter => $location,
136
        expiration_date_filter => $expiration_date_dt,
135
        expiration_date_filter => $expiration_date,
137
        done_searched => $searched,
136
        done_searched => $searched,
138
        routing       => $routing,
137
        routing       => $routing,
139
        additional_field_filters => \@additional_field_filters,
138
        additional_field_filters => \@additional_field_filters,
Lines 187-193 else Link Here
187
        bookseller_filter  => $bookseller,
186
        bookseller_filter  => $bookseller,
188
        branch_filter => $branch,
187
        branch_filter => $branch,
189
        location_filter => $location,
188
        location_filter => $location,
190
        expiration_date_filter => $expiration_date_dt,
189
        expiration_date_filter => $expiration_date,
191
        branches_loop => \@branches_loop,
190
        branches_loop => \@branches_loop,
192
        done_searched => $searched,
191
        done_searched => $searched,
193
        routing       => $routing,
192
        routing       => $routing,
(-)a/serials/showpredictionpattern.pl (-10 / +5 lines)
Lines 36-42 use C4::Auth qw( get_template_and_user ); Link Here
36
use C4::Output qw( output_html_with_http_headers );
36
use C4::Output qw( output_html_with_http_headers );
37
use C4::Serials qw( GetSubscription GetFictiveIssueNumber GetSeq GetSubscriptionIrregularities GetNextDate GetNextSeq );
37
use C4::Serials qw( GetSubscription GetFictiveIssueNumber GetSeq GetSubscriptionIrregularities GetNextDate GetNextSeq );
38
use C4::Serials::Frequency;
38
use C4::Serials::Frequency;
39
use Koha::DateUtils qw( dt_from_string output_pref );
39
use Koha::DateUtils qw( dt_from_string );
40
40
41
my $input = CGI->new;
41
my $input = CGI->new;
42
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
42
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( {
Lines 90-105 my %pattern = ( Link Here
90
    every3          => scalar $input->param('every3') // '',
90
    every3          => scalar $input->param('every3') // '',
91
);
91
);
92
92
93
$firstacquidate = eval { output_pref( { str => $firstacquidate, dateonly => 1, dateformat => 'iso' } ); }
93
$firstacquidate = $firstacquidate ? dt_from_string($firstacquidate)->ymd : dt_from_string->ymd;
94
    or output_pref( { dt => dt_from_string, dateonly => 1, dateformat => 'iso' } );
95
94
96
$enddate = eval { output_pref( { str => $enddate, dateonly => 1, dateformat => 'iso' } ); };
95
$enddate = dt_from_string($enddate)->ymd;
97
96
98
if($nextacquidate) {
97
$nextacquidate = $nextacquidate ? dt_from_string($nextacquidate)->ymd : $firstacquidate;
99
    $nextacquidate =  eval { output_pref( { str => $nextacquidate, dateonly => 1, dateformat => 'iso' } ); };
100
} else {
101
    $nextacquidate = $firstacquidate;
102
}
103
my $date = $nextacquidate;
98
my $date = $nextacquidate;
104
99
105
my %subscription = (
100
my %subscription = (
Lines 112-118 my %subscription = ( Link Here
112
    innerloop3      => scalar $input->param('innerloop3') // '',
107
    innerloop3      => scalar $input->param('innerloop3') // '',
113
    irregularity    => '',
108
    irregularity    => '',
114
    countissuesperunit  => 1,
109
    countissuesperunit  => 1,
115
    firstacquidate  => $firstacquidate,
110
    firstacquidate  => $firstacquidate->ymd,
116
);
111
);
117
112
118
my $issuenumber;
113
my $issuenumber;
(-)a/suggestion/suggestion.pl (+1 lines)
Lines 165-170 if ( $op =~ /save/i ) { Link Here
165
    else {
165
    else {
166
166
167
        for my $date_key ( qw( suggesteddate manageddate accepteddate rejecteddate ) ) {
167
        for my $date_key ( qw( suggesteddate manageddate accepteddate rejecteddate ) ) {
168
            # FIXME Do we need this?
168
            $suggestion_only->{$date_key} = dt_from_string( $suggestion_only->{$date_key} )
169
            $suggestion_only->{$date_key} = dt_from_string( $suggestion_only->{$date_key} )
169
                if $suggestion_only->{$date_key};
170
                if $suggestion_only->{$date_key};
170
        }
171
        }
(-)a/t/db_dependent/Reserves.t (-8 / +4 lines)
Lines 355-361 $dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); Link Here
355
t::lib::Mocks::mock_preference('AllowHoldDateInFuture', 1);
355
t::lib::Mocks::mock_preference('AllowHoldDateInFuture', 1);
356
my $resdate= dt_from_string();
356
my $resdate= dt_from_string();
357
$resdate->add_duration(DateTime::Duration->new(days => 4));
357
$resdate->add_duration(DateTime::Duration->new(days => 4));
358
$resdate=output_pref($resdate);
359
my $reserve_id = AddReserve(
358
my $reserve_id = AddReserve(
360
    {
359
    {
361
        branchcode       => $branch_1,
360
        branchcode       => $branch_1,
Lines 396-402 my $now_reserve_id = AddReserve( Link Here
396
        borrowernumber   => $requesters{$branch_1},
395
        borrowernumber   => $requesters{$branch_1},
397
        biblionumber     => $bibnum,
396
        biblionumber     => $bibnum,
398
        priority         => 2,
397
        priority         => 2,
399
        reservation_date => output_pref(dt_from_string()),
398
        reservation_date => dt_from_string(),
400
    }
399
    }
401
);
400
);
402
my $which_highest;
401
my $which_highest;
Lines 440-446 t::lib::Mocks::mock_preference('ConfirmFutureHolds', 2); Link Here
440
t::lib::Mocks::mock_preference('AllowHoldDateInFuture', 1);
439
t::lib::Mocks::mock_preference('AllowHoldDateInFuture', 1);
441
$resdate= dt_from_string();
440
$resdate= dt_from_string();
442
$resdate->add_duration(DateTime::Duration->new(days => 2));
441
$resdate->add_duration(DateTime::Duration->new(days => 2));
443
$resdate=output_pref($resdate);
444
AddReserve(
442
AddReserve(
445
    {
443
    {
446
        branchcode       => $branch_1,
444
        branchcode       => $branch_1,
Lines 529-535 AddReserve( Link Here
529
        borrowernumber => $requesters{'CPL2'},
527
        borrowernumber => $requesters{'CPL2'},
530
        biblionumber   => $bibnum,
528
        biblionumber   => $bibnum,
531
        priority       => $p,
529
        priority       => $p,
532
        reservation_date => output_pref($resdate),
530
        reservation_date => $resdate,
533
    }
531
    }
534
);
532
);
535
$p = C4::Reserves::CalculatePriority($bibnum);
533
$p = C4::Reserves::CalculatePriority($bibnum);
Lines 563-576 AddReserve({ Link Here
563
    borrowernumber => $borrowernumber_tmp_1,
561
    borrowernumber => $borrowernumber_tmp_1,
564
    biblionumber => $bibnum,
562
    biblionumber => $bibnum,
565
    priority => 3,
563
    priority => 3,
566
    reservation_date => output_pref($date_in_future)
564
    reservation_date => $date_in_future
567
});
565
});
568
AddReserve({
566
AddReserve({
569
    branch => 'CPL',
567
    branch => 'CPL',
570
    borrowernumber => $borrowernumber_tmp_2,
568
    borrowernumber => $borrowernumber_tmp_2,
571
    biblionumber => $bibnum,
569
    biblionumber => $bibnum,
572
    priority => 4,
570
    priority => 4,
573
    reservation_date => output_pref($date_in_future)
571
    reservation_date => $date_in_future
574
});
572
});
575
my @r1 = Koha::Holds->search({ borrowernumber => $borrowernumber_tmp_1 })->as_list;
573
my @r1 = Koha::Holds->search({ borrowernumber => $borrowernumber_tmp_1 })->as_list;
576
my @r2 = Koha::Holds->search({ borrowernumber => $borrowernumber_tmp_2 })->as_list;
574
my @r2 = Koha::Holds->search({ borrowernumber => $borrowernumber_tmp_2 })->as_list;
Lines 727-733 is( $status, '', 'MoveReserve filled waiting hold'); Link Here
727
#   hold from A pos 1, tomorrow, no fut holds: not filled
725
#   hold from A pos 1, tomorrow, no fut holds: not filled
728
$resdate= dt_from_string();
726
$resdate= dt_from_string();
729
$resdate->add_duration(DateTime::Duration->new(days => 1));
727
$resdate->add_duration(DateTime::Duration->new(days => 1));
730
$resdate=output_pref($resdate);
731
AddReserve(
728
AddReserve(
732
    {
729
    {
733
        branchcode     => $branch_1,
730
        branchcode     => $branch_1,
Lines 771-777 is( $status, '', 'MoveReserve filled future waiting hold now'); Link Here
771
#   hold from A pos 1, today+3, fut holds=2: MoveReserve should not fill it
768
#   hold from A pos 1, today+3, fut holds=2: MoveReserve should not fill it
772
$resdate= dt_from_string();
769
$resdate= dt_from_string();
773
$resdate->add_duration(DateTime::Duration->new(days => 3));
770
$resdate->add_duration(DateTime::Duration->new(days => 3));
774
$resdate=output_pref($resdate);
775
AddReserve(
771
AddReserve(
776
    {
772
    {
777
        branchcode     => $branch_1,
773
        branchcode     => $branch_1,
(-)a/t/db_dependent/Serials.t (-3 / +3 lines)
Lines 306-322 subtest 'test_updateClaim' => sub { Link Here
306
    is($result_1, 2, 'Got the expected 2 from update claim with 2 serial ids');
306
    is($result_1, 2, 'Got the expected 2 from update claim with 2 serial ids');
307
307
308
    my @late_or_missing_issues_1_0 = C4::Serials::GetLateOrMissingIssues(undef, $serial1->serialid);
308
    my @late_or_missing_issues_1_0 = C4::Serials::GetLateOrMissingIssues(undef, $serial1->serialid);
309
    is($late_or_missing_issues_1_0[0]->{claimdate}, $today, 'Got the expected first different claim date from update claim');
309
    is(output_pref({str => $late_or_missing_issues_1_0[0]->{claimdate}, dateonly => 1}), $today, 'Got the expected first different claim date from update claim');
310
    is($late_or_missing_issues_1_0[0]->{claims_count}, $claim_count_1+1, 'Got the expected first claim count from update claim');
310
    is($late_or_missing_issues_1_0[0]->{claims_count}, $claim_count_1+1, 'Got the expected first claim count from update claim');
311
    is($late_or_missing_issues_1_0[0]->{status}, 7, 'Got the expected first claim status from update claim');
311
    is($late_or_missing_issues_1_0[0]->{status}, 7, 'Got the expected first claim status from update claim');
312
312
313
    my @late_or_missing_issues_1_1 = C4::Serials::GetLateOrMissingIssues(undef, $serial2->serialid);
313
    my @late_or_missing_issues_1_1 = C4::Serials::GetLateOrMissingIssues(undef, $serial2->serialid);
314
    is($late_or_missing_issues_1_1[0]->{claimdate}, $today, 'Got the expected second different claim date from update claim');
314
    is(output_pref({str => $late_or_missing_issues_1_1[0]->{claimdate}, dateonly => 1}), $today, 'Got the expected second different claim date from update claim');
315
    is($late_or_missing_issues_1_1[0]->{claims_count}, $claim_count_1+1, 'Got the expected second claim count from update claim');
315
    is($late_or_missing_issues_1_1[0]->{claims_count}, $claim_count_1+1, 'Got the expected second claim count from update claim');
316
    is($late_or_missing_issues_1_1[0]->{status}, 7, 'Got the expected second claim status from update claim');
316
    is($late_or_missing_issues_1_1[0]->{status}, 7, 'Got the expected second claim status from update claim');
317
317
318
    my @late_or_missing_issues_1_2 = C4::Serials::GetLateOrMissingIssues(undef, $serial3->serialid);
318
    my @late_or_missing_issues_1_2 = C4::Serials::GetLateOrMissingIssues(undef, $serial3->serialid);
319
    is($late_or_missing_issues_1_2[0]->{claimdate}, output_pref({ dt => $claimdate_1, dateonly => 1}), 'Got the expected unchanged claim date from update claim');
319
    is(output_pref({str => $late_or_missing_issues_1_2[0]->{claimdate}, dateonly => 1}), output_pref({ dt => $claimdate_1, dateonly => 1}), 'Got the expected unchanged claim date from update claim');
320
    is($late_or_missing_issues_1_2[0]->{claims_count}, $claim_count_1, 'Got the expected unchanged claim count from update claim');
320
    is($late_or_missing_issues_1_2[0]->{claims_count}, $claim_count_1, 'Got the expected unchanged claim count from update claim');
321
    is($late_or_missing_issues_1_2[0]->{status}, 3, 'Got the expected unchanged claim status from update claim');
321
    is($late_or_missing_issues_1_2[0]->{status}, 3, 'Got the expected unchanged claim status from update claim');
322
};
322
};
(-)a/tags/review.pl (-17 / +8 lines)
Lines 26-32 use CGI::Cookie; # need to check cookies before having CGI parse the POST re Link Here
26
use URI::Escape qw( uri_escape_utf8 );
26
use URI::Escape qw( uri_escape_utf8 );
27
use C4::Auth qw( check_cookie_auth get_template_and_user );
27
use C4::Auth qw( check_cookie_auth get_template_and_user );
28
use C4::Context;
28
use C4::Context;
29
use Koha::DateUtils qw( dt_from_string output_pref );
30
use C4::Output qw( output_with_http_headers is_ajax pagination_bar output_html_with_http_headers );
29
use C4::Output qw( output_with_http_headers is_ajax pagination_bar output_html_with_http_headers );
31
use C4::Tags qw(
30
use C4::Tags qw(
32
    approval_counts
31
    approval_counts
Lines 162-184 if ($filter = $input->param('tag')) { Link Here
162
    $template->param(filter_tag=>$filter);
161
    $template->param(filter_tag=>$filter);
163
    $filters{term} = $filter;
162
    $filters{term} = $filter;
164
}
163
}
165
if ($filter = $input->param('from')) {
164
if ( $filter = $input->param('from') ) {
166
        $date_from = eval { output_pref( { dt => dt_from_string( $filter ), dateonly => 1, dateformat => 'iso' } ); };
165
    $date_from = $filter;
167
        if ( $date_from ) {
166
    $template->param( filter_date_approved_from => $filter );
168
        $template->param(filter_date_approved_from=>$filter);
167
    $filters{date_approved} = ">=$date_from";
169
        $filters{date_approved} = ">=$date_from";
170
    } else {
171
        push @errors, {date_from=>$filter};
172
    }
173
}
168
}
174
if ($filter = $input->param('to')) {
169
if ( $filter = $input->param('to') ) {
175
        $date_to = eval { output_pref( { dt => dt_from_string( $filter ), dateonly => 1, dateformat => 'iso' } ); };
170
    $date_to = $filter;
176
        if ( $date_to ) {
171
    $template->param( filter_date_approved_to => $filter );
177
        $template->param(filter_date_approved_to=>$filter);
172
    $filters{date_approved} = "<=$date_to";
178
        $filters{date_approved} = "<=$date_to";
179
    } else {
180
        push @errors, {date_to=>$filter};
181
    }
182
}
173
}
183
if ($filter = $input->param('approver')) {      # name (or borrowernumber) from input box
174
if ($filter = $input->param('approver')) {      # name (or borrowernumber) from input box
184
    if ($filter =~ /^\d+$/ and $filter > 0) {
175
    if ($filter =~ /^\d+$/ and $filter > 0) {
(-)a/tools/additional-contents.pl (-5 / +2 lines)
Lines 91-101 elsif ( $op eq 'add_validate' ) { Link Here
91
91
92
    my @lang       = $cgi->multi_param('lang');
92
    my @lang       = $cgi->multi_param('lang');
93
93
94
    my $expirationdate;
94
    my $expirationdate = $cgi->param('expirationdate');
95
    if ( $cgi->param('expirationdate') ) {
95
    my $published_on = $cgi->param('published_on');
96
        $expirationdate = dt_from_string( scalar $cgi->param('expirationdate') );
97
    }
98
    my $published_on = dt_from_string( scalar $cgi->param('published_on') );
99
    my $number = $cgi->param('number');
96
    my $number = $cgi->param('number');
100
97
101
    my $original_default = $idnew ? Koha::AdditionalContents->find($idnew) : undef;
98
    my $original_default = $idnew ? Koha::AdditionalContents->find($idnew) : undef;
(-)a/tools/batchMod.pl (-1 lines)
Lines 31-37 use List::MoreUtils qw( uniq ); Link Here
31
use Encode qw( encode_utf8 );
31
use Encode qw( encode_utf8 );
32
32
33
use Koha::Database;
33
use Koha::Database;
34
use Koha::DateUtils qw( dt_from_string );
35
use Koha::Exception;
34
use Koha::Exception;
36
use Koha::Biblios;
35
use Koha::Biblios;
37
use Koha::Items;
36
use Koha::Items;
(-)a/tools/batch_extend_due_dates.pl (-15 / +7 lines)
Lines 25-31 use CGI; Link Here
25
use C4::Auth qw( get_template_and_user );
25
use C4::Auth qw( get_template_and_user );
26
use C4::Output qw( output_html_with_http_headers );
26
use C4::Output qw( output_html_with_http_headers );
27
use Koha::Checkouts;
27
use Koha::Checkouts;
28
use Koha::DateUtils qw( dt_from_string output_pref );
28
use Koha::DateUtils qw( dt_from_string );
29
29
30
my $input = CGI->new;
30
my $input = CGI->new;
31
my $op = $input->param('op') // q|form|;
31
my $op = $input->param('op') // q|form|;
Lines 107-125 elsif ( $op eq 'list' ) { Link Here
107
        if ($preview_results) {
107
        if ($preview_results) {
108
            push(
108
            push(
109
                @new_due_dates,
109
                @new_due_dates,
110
                output_pref(
110
                calc_new_due_date(
111
                    {
111
                    {
112
                        dt => calc_new_due_date(
112
                        due_date => dt_from_string( $checkout->date_due ),
113
                            {
113
                        new_hard_due_date => $new_hard_due_date,
114
                                due_date =>
114
                        add_days          => $due_date_days
115
                                  dt_from_string( $checkout->date_due ),
116
                                new_hard_due_date => $new_hard_due_date,
117
                                add_days          => $due_date_days
118
                            }
119
                        ),
120
                        dateformat => 'iso'
121
                    }
115
                    }
122
                )
116
                ),
123
            );
117
            );
124
        } else {
118
        } else {
125
            push( @issue_ids, $checkout->id );
119
            push( @issue_ids, $checkout->id );
Lines 129-137 elsif ( $op eq 'list' ) { Link Here
129
    if ( $preview_results ) {
123
    if ( $preview_results ) {
130
        $template->param(
124
        $template->param(
131
            checkouts         => $checkouts,
125
            checkouts         => $checkouts,
132
            new_hard_due_date => $new_hard_due_date
126
            new_hard_due_date => $new_hard_due_date,
133
            ? dt_from_string($new_hard_due_date)
134
            : undef,
135
            due_date_days => $due_date_days,
127
            due_date_days => $due_date_days,
136
            new_due_dates => \@new_due_dates,
128
            new_due_dates => \@new_due_dates,
137
            view          => 'list',
129
            view          => 'list',
(-)a/tools/cleanborrowers.pl (-30 / +7 lines)
Lines 37-43 use CGI qw ( -utf8 ); Link Here
37
use C4::Auth qw( get_template_and_user );
37
use C4::Auth qw( get_template_and_user );
38
use C4::Output qw( output_html_with_http_headers );
38
use C4::Output qw( output_html_with_http_headers );
39
use C4::Members qw( GetBorrowersToExpunge );
39
use C4::Members qw( GetBorrowersToExpunge );
40
use Koha::DateUtils qw( dt_from_string output_pref );
41
use Koha::Old::Checkouts;
40
use Koha::Old::Checkouts;
42
use Koha::Patron::Categories;
41
use Koha::Patron::Categories;
43
use Koha::Patrons;
42
use Koha::Patrons;
Lines 53-74 my $params = $cgi->Vars; Link Here
53
52
54
my $step = $params->{step} || 1;
53
my $step = $params->{step} || 1;
55
my $not_borrowed_since =    # the date which filter on issue history.
54
my $not_borrowed_since =    # the date which filter on issue history.
56
  $params->{not_borrowed_since}
55
  $params->{not_borrowed_since};
57
  ? dt_from_string $params->{not_borrowed_since}
58
  : undef;
59
my $last_issue_date =         # the date which filter on borrowers last issue.
56
my $last_issue_date =         # the date which filter on borrowers last issue.
60
  $params->{last_issue_date}
57
  $params->{last_issue_date};
61
  ? dt_from_string $params->{last_issue_date}
62
  : undef;
63
my $borrower_dateexpiry =
64
  $params->{borrower_dateexpiry}
65
  ? dt_from_string $params->{borrower_dateexpiry}
66
  : undef;
67
my $borrower_lastseen =
68
  $params->{borrower_lastseen}
69
  ? dt_from_string $params->{borrower_lastseen}
70
  : undef;
71
my $patron_list_id = $params->{patron_list_id};
58
my $patron_list_id = $params->{patron_list_id};
59
my $borrower_dateexpiry = $params->{borrower_dateexpiry};
60
my $borrower_lastseen = $params->{borrower_lastseen};
72
61
73
my $borrower_categorycode = $params->{'borrower_categorycode'} || q{};
62
my $borrower_categorycode = $params->{'borrower_categorycode'} || q{};
74
63
Lines 211-231 sub _get_selection_params { Link Here
211
        $borrower_categorycode, $patron_list_id, $branch) = @_;
200
        $borrower_categorycode, $patron_list_id, $branch) = @_;
212
201
213
    my $params = {};
202
    my $params = {};
214
    $params->{not_borrowed_since} = output_pref({
203
    $params->{not_borrowed_since} = $not_borrowed_since;
215
        dt         => $not_borrowed_since,
204
    $params->{expired_before} = $borrower_dateexpiry;
216
        dateformat => 'iso',
205
    $params->{last_seen} = $borrower_lastseen;
217
        dateonly   => 1
218
    }) if $not_borrowed_since;
219
    $params->{expired_before} = output_pref({
220
        dt         => $borrower_dateexpiry,
221
        dateformat => 'iso',
222
        dateonly   => 1
223
    }) if $borrower_dateexpiry;
224
    $params->{last_seen} = output_pref({
225
        dt         => $borrower_lastseen,
226
        dateformat => 'iso',
227
        dateonly   => 1
228
    }) if $borrower_lastseen;
229
    $params->{category_code} = $borrower_categorycode if $borrower_categorycode;
206
    $params->{category_code} = $borrower_categorycode if $borrower_categorycode;
230
    $params->{patron_list_id} = $patron_list_id if $patron_list_id;
207
    $params->{patron_list_id} = $patron_list_id if $patron_list_id;
231
208
(-)a/tools/holidays.pl (+1 lines)
Lines 39-44 my ($template, $loggedinuser, $cookie) Link Here
39
39
40
# calendardate - date passed in url for human readability (syspref)
40
# calendardate - date passed in url for human readability (syspref)
41
# if the url has an invalid date default to 'now.'
41
# if the url has an invalid date default to 'now.'
42
# FIXME There is something to improve in the date handling here
42
my $calendarinput_dt = eval { dt_from_string( scalar $input->param('calendardate') ); } || dt_from_string;
43
my $calendarinput_dt = eval { dt_from_string( scalar $input->param('calendardate') ); } || dt_from_string;
43
my $calendardate = output_pref( { dt => $calendarinput_dt, dateonly => 1 } );
44
my $calendardate = output_pref( { dt => $calendarinput_dt, dateonly => 1 } );
44
45
(-)a/tools/inventory.pl (-2 / +2 lines)
Lines 36-42 use C4::Reports::Guided qw( ); Link Here
36
use C4::Charset qw( NormalizeString );
36
use C4::Charset qw( NormalizeString );
37
37
38
use Koha::Biblios;
38
use Koha::Biblios;
39
use Koha::DateUtils qw( dt_from_string output_pref );
39
use Koha::DateUtils qw( dt_from_string );
40
use Koha::Database::Columns;
40
use Koha::Database::Columns;
41
use Koha::AuthorisedValues;
41
use Koha::AuthorisedValues;
42
use Koha::BiblioFrameworks;
42
use Koha::BiblioFrameworks;
Lines 247-253 if ( ($uploadbarcodes && length($uploadbarcodes) > 0) || ($barcodelist && length Link Here
247
            }
247
            }
248
        }
248
        }
249
    }
249
    }
250
    $template->param( date => output_pref ( { str => $date, dateformat => 'iso' } ) );
250
    $template->param( date => $date );
251
    $template->param( errorloop => \@errorloop ) if (@errorloop);
251
    $template->param( errorloop => \@errorloop ) if (@errorloop);
252
}
252
}
253
253
(-)a/tools/scheduler.pl (-7 / +2 lines)
Lines 24-30 use C4::Reports::Guided qw( get_saved_reports ); Link Here
24
use C4::Auth qw( get_template_and_user );
24
use C4::Auth qw( get_template_and_user );
25
use CGI qw ( -utf8 );
25
use CGI qw ( -utf8 );
26
use C4::Output qw( output_html_with_http_headers );
26
use C4::Output qw( output_html_with_http_headers );
27
use Koha::DateUtils qw( dt_from_string output_pref );;
27
use Koha::DateUtils qw( dt_from_string );;
28
28
29
my $input = CGI->new;
29
my $input = CGI->new;
30
my $base;
30
my $base;
Lines 52-62 my $id = $input->param('id'); Link Here
52
52
53
if ( $mode eq 'job_add' ) {
53
if ( $mode eq 'job_add' ) {
54
54
55
    # Retrieving the date according to the dateformat syspref
55
    my $startdate = dt_from_string( scalar $input->param('startdate') )->ymd;
56
    my $c4date = output_pref({ dt => dt_from_string( scalar $input->param('startdate') ), dateformat => 'iso', dateonly => 1 });
57
58
    # Formatting it for Schedule::At
59
    my $startdate = join('', (split /-/, $c4date));
60
56
61
    my $starttime = $input->param('starttime');
57
    my $starttime = $input->param('starttime');
62
    $starttime =~ s/\://g;
58
    $starttime =~ s/\://g;
63
- 

Return to bug 30718