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

(-)a/C4/Acquisition.pm (-3 / +2 lines)
Lines 22-28 use Modern::Perl; Link Here
22
use Carp;
22
use Carp;
23
use C4::Context;
23
use C4::Context;
24
use C4::Debug;
24
use C4::Debug;
25
use C4::Dates qw(format_date format_date_in_iso);
26
use C4::Suggestions;
25
use C4::Suggestions;
27
use C4::Biblio;
26
use C4::Biblio;
28
use C4::Contract;
27
use C4::Contract;
Lines 1393-1399 sub ModReceiveOrder { Link Here
1393
    my $order_vendornote = $params->{order_vendornote};
1392
    my $order_vendornote = $params->{order_vendornote};
1394
1393
1395
    my $dbh = C4::Context->dbh;
1394
    my $dbh = C4::Context->dbh;
1396
    $datereceived = C4::Dates->output('iso') unless $datereceived;
1395
    $datereceived = output_pref({ dt=>dt_from_string, dateonly=>1, dateformat=>'iso' }) unless $datereceived;
1397
    my $suggestionid = GetSuggestionFromBiblionumber( $biblionumber );
1396
    my $suggestionid = GetSuggestionFromBiblionumber( $biblionumber );
1398
    if ($suggestionid) {
1397
    if ($suggestionid) {
1399
        ModSuggestion( {suggestionid=>$suggestionid,
1398
        ModSuggestion( {suggestionid=>$suggestionid,
Lines 2719-2725 sub CloseInvoice { Link Here
2719
2718
2720
Reopen an invoice
2719
Reopen an invoice
2721
2720
2722
Equivalent to ModInvoice(invoiceid => $invoiceid, closedate => C4::Dates->new()->output('iso'))
2721
Equivalent to ModInvoice(invoiceid => $invoiceid, closedate => output_pref({ dt=>dt_from_string, dateonly=>1, otputpref=>'iso' }))
2723
2722
2724
=cut
2723
=cut
2725
2724
(-)a/C4/Barcodes.pm (-1 lines)
Lines 24-30 use Carp; Link Here
24
24
25
use C4::Context;
25
use C4::Context;
26
use C4::Debug;
26
use C4::Debug;
27
use C4::Dates;
28
use C4::Barcodes::hbyymmincr;
27
use C4::Barcodes::hbyymmincr;
29
use C4::Barcodes::annual;
28
use C4::Barcodes::annual;
30
use C4::Barcodes::incremental;
29
use C4::Barcodes::incremental;
(-)a/C4/Barcodes/annual.pm (-6 / +7 lines)
Lines 24-30 use Carp; Link Here
24
24
25
use C4::Context;
25
use C4::Context;
26
use C4::Debug;
26
use C4::Debug;
27
use C4::Dates;
27
28
use Koha::DateUtils qw( output_pref dt_from_string );
28
29
29
use vars qw($VERSION @ISA);
30
use vars qw($VERSION @ISA);
30
use vars qw($debug $cgi_debug);	# from C4::Debug, of course
31
use vars qw($debug $cgi_debug);	# from C4::Debug, of course
Lines 44-56 sub db_max ($;$) { Link Here
44
	my ($iso);
45
	my ($iso);
45
	if (@_) {
46
	if (@_) {
46
		my $input = shift;
47
		my $input = shift;
47
		$iso = C4::Dates->new($input,'iso')->output('iso'); # try to set the date w/ 2nd arg
48
        $iso = output_pref({ dt => dt_from_string( $input, 'iso' ), dateformat => 'iso', dateonly => 1 }); # try to set the date w/ 2nd arg
48
		unless ($iso) {
49
		unless ($iso) {
49
			warn "Failed to create 'iso' Dates object with input '$input'.  Reverting to today's date.";
50
			warn "Failed to create 'iso' Dates object with input '$input'.  Reverting to today's date.";
50
			$iso = C4::Dates->new->output('iso');	# failover back to today
51
            $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });	# failover back to today
51
		}
52
		}
52
	} else {
53
	} else {
53
		$iso = C4::Dates->new->output('iso');
54
        $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
54
	}
55
	}
55
	my $year = substr($iso,0,4);	# YYYY
56
	my $year = substr($iso,0,4);	# YYYY
56
	$sth->execute("$year-%");
57
	$sth->execute("$year-%");
Lines 61-67 sub db_max ($;$) { Link Here
61
62
62
sub initial () {
63
sub initial () {
63
	my $self = shift;
64
	my $self = shift;
64
	return substr(C4::Dates->new->output('iso'),0,4) .'-'. sprintf('%'."$width.$width".'d', 1);
65
    return substr(output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), 0, 4 ) .'-'. sprintf('%'."$width.$width".'d', 1);
65
}
66
}
66
67
67
sub parse ($;$) {
68
sub parse ($;$) {
Lines 82-88 sub width ($;$) { Link Here
82
sub process_head($$;$$) {	# (self,head,whole,specific)
83
sub process_head($$;$$) {	# (self,head,whole,specific)
83
	my ($self,$head,$whole,$specific) = @_;
84
	my ($self,$head,$whole,$specific) = @_;
84
	$specific and return $head;	# if this is built off an existing barcode, just return the head unchanged.
85
	$specific and return $head;	# if this is built off an existing barcode, just return the head unchanged.
85
	return substr(C4::Dates->new->output('iso'),0,4) . '-';	# else get new YYYY-
86
    return substr(output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), 0, 4 ) . '-';	# else get new YYYY-
86
}
87
}
87
88
88
sub new_object {
89
sub new_object {
(-)a/C4/Barcodes/hbyymmincr.pm (-13 / +14 lines)
Lines 24-30 use Carp; Link Here
24
24
25
use C4::Context;
25
use C4::Context;
26
use C4::Debug;
26
use C4::Debug;
27
use C4::Dates;
27
28
use Koha::DateUtils qw( dt_from_string output_pref );
28
29
29
use vars qw($VERSION @ISA);
30
use vars qw($VERSION @ISA);
30
use vars qw($debug $cgi_debug);	# from C4::Debug, of course
31
use vars qw($debug $cgi_debug);	# from C4::Debug, of course
Lines 48-63 sub db_max { Link Here
48
	$debug and print STDERR "(hbyymmincr) db_max query: $query\n";
49
	$debug and print STDERR "(hbyymmincr) db_max query: $query\n";
49
	my $sth = C4::Context->dbh->prepare($query);
50
	my $sth = C4::Context->dbh->prepare($query);
50
	my ($iso);
51
	my ($iso);
51
	if (@_) {
52
        if (@_) {
52
		my $input = shift;
53
                my $input = shift;
53
		$iso = C4::Dates->new($input,'iso')->output('iso'); # try to set the date w/ 2nd arg
54
                $iso = output_pref({ dt => dt_from_string( $input, 'iso' ), dateformat => 'iso', dateonly => 1 }); # try to set the date w/ 2nd arg
54
		unless ($iso) {
55
                unless ($iso) {
55
			warn "Failed to create 'iso' Dates object with input '$input'.  Reverting to today's date.";
56
                        warn "Failed to create 'iso' Dates object with input '$input'.  Reverting to today's date.";
56
			$iso = C4::Dates->new->output('iso');	# failover back to today
57
                        $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });      # failover back to today
57
		}
58
                }
58
	} else {
59
        } else {
59
		$iso = C4::Dates->new->output('iso');
60
                $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
60
	}
61
        }
61
	my $year = substr($iso,2,2);    # i.e. "08" for 2008
62
	my $year = substr($iso,2,2);    # i.e. "08" for 2008
62
	my $andtwo = $width+2;
63
	my $andtwo = $width+2;
63
	$sth->execute("^[a-zA-Z]{1,}" . $year . "[0-9]{$andtwo}");	# the extra two digits are the month.  we don't care what they are, just that they are there.
64
	$sth->execute("^[a-zA-Z]{1,}" . $year . "[0-9]{$andtwo}");	# the extra two digits are the month.  we don't care what they are, just that they are there.
Lines 74-80 sub db_max { Link Here
74
sub initial {
75
sub initial {
75
	my $self = shift;
76
	my $self = shift;
76
	# FIXME: populated branch?
77
	# FIXME: populated branch?
77
	my $iso = C4::Dates->new->output('iso'); 	# like "2008-07-02"
78
    my $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); 	# like "2008-07-02"
78
	return $self->branch . substr($iso,2,2) . substr($iso,5,2) . sprintf('%' . "$width.$width" . 'd',1);
79
	return $self->branch . substr($iso,2,2) . substr($iso,5,2) . sprintf('%' . "$width.$width" . 'd',1);
79
}
80
}
80
81
Lines 104-110 sub process_head { # (self,head,whole,specific) Link Here
104
	my ($self,$head,$whole,$specific) = @_;
105
	my ($self,$head,$whole,$specific) = @_;
105
	$specific and return $head;	# if this is built off an existing barcode, just return the head unchanged.
106
	$specific and return $head;	# if this is built off an existing barcode, just return the head unchanged.
106
	$head =~ s/\d{4}$//;		# else strip the old yymm
107
	$head =~ s/\d{4}$//;		# else strip the old yymm
107
	my $iso = C4::Dates->new->output('iso'); 	# like "2008-07-02"
108
    my $iso = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); 	# like "2008-07-02"
108
	return $head . substr($iso,2,2) . substr($iso,5,2);
109
	return $head . substr($iso,2,2) . substr($iso,5,2);
109
}
110
}
110
111
(-)a/C4/Biblio.pm (-1 lines)
Lines 31-37 use POSIX qw(strftime); Link Here
31
use Module::Load::Conditional qw(can_load);
31
use Module::Load::Conditional qw(can_load);
32
32
33
use C4::Koha;
33
use C4::Koha;
34
use C4::Dates qw/format_date/;
35
use C4::Log;    # logaction
34
use C4::Log;    # logaction
36
use C4::Budgets;
35
use C4::Budgets;
37
use C4::ClassSource;
36
use C4::ClassSource;
(-)a/C4/HoldsQueue.pm (-1 lines)
Lines 29-35 use C4::Branch; Link Here
29
use C4::Circulation;
29
use C4::Circulation;
30
use C4::Members;
30
use C4::Members;
31
use C4::Biblio;
31
use C4::Biblio;
32
use C4::Dates qw/format_date/;
33
32
34
use List::Util qw(shuffle);
33
use List::Util qw(shuffle);
35
use List::MoreUtils qw(any);
34
use List::MoreUtils qw(any);
(-)a/C4/Items.pm (-8 / +8 lines)
Lines 25-31 use Carp; Link Here
25
use C4::Context;
25
use C4::Context;
26
use C4::Koha;
26
use C4::Koha;
27
use C4::Biblio;
27
use C4::Biblio;
28
use C4::Dates qw/format_date format_date_in_iso/;
28
use Koha::DateUtils;
29
use MARC::Record;
29
use MARC::Record;
30
use C4::ClassSource;
30
use C4::ClassSource;
31
use C4::Log;
31
use C4::Log;
Lines 648-655 C<$itemnum> is the item number Link Here
648
sub ModDateLastSeen {
648
sub ModDateLastSeen {
649
    my ($itemnumber) = @_;
649
    my ($itemnumber) = @_;
650
    
650
    
651
    my $today = C4::Dates->new();    
651
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
652
    ModItem({ itemlost => 0, datelastseen => $today->output("iso") }, undef, $itemnumber);
652
    ModItem({ itemlost => 0, datelastseen => $today }, undef, $itemnumber);
653
}
653
}
654
654
655
=head2 DelItem
655
=head2 DelItem
Lines 2128-2134 C<items.withdrawn> Link Here
2128
2128
2129
sub _set_defaults_for_add {
2129
sub _set_defaults_for_add {
2130
    my $item = shift;
2130
    my $item = shift;
2131
    $item->{dateaccessioned} ||= C4::Dates->new->output('iso');
2131
    $item->{dateaccessioned} ||= output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
2132
    $item->{$_} ||= 0 for (qw( notforloan damaged itemlost withdrawn));
2132
    $item->{$_} ||= 0 for (qw( notforloan damaged itemlost withdrawn));
2133
}
2133
}
2134
2134
Lines 2161-2167 sub _koha_new_item { Link Here
2161
            notforloan          = ?,
2161
            notforloan          = ?,
2162
            damaged             = ?,
2162
            damaged             = ?,
2163
            itemlost            = ?,
2163
            itemlost            = ?,
2164
            withdrawn            = ?,
2164
            withdrawn           = ?,
2165
            itemcallnumber      = ?,
2165
            itemcallnumber      = ?,
2166
            coded_location_qualifier = ?,
2166
            coded_location_qualifier = ?,
2167
            restricted          = ?,
2167
            restricted          = ?,
Lines 2170-2176 sub _koha_new_item { Link Here
2170
            holdingbranch       = ?,
2170
            holdingbranch       = ?,
2171
            paidfor             = ?,
2171
            paidfor             = ?,
2172
            location            = ?,
2172
            location            = ?,
2173
            permanent_location            = ?,
2173
            permanent_location  = ?,
2174
            onloan              = ?,
2174
            onloan              = ?,
2175
            issues              = ?,
2175
            issues              = ?,
2176
            renewals            = ?,
2176
            renewals            = ?,
Lines 2180-2193 sub _koha_new_item { Link Here
2180
            ccode               = ?,
2180
            ccode               = ?,
2181
            itype               = ?,
2181
            itype               = ?,
2182
            materials           = ?,
2182
            materials           = ?,
2183
            uri = ?,
2183
            uri                 = ?,
2184
            enumchron           = ?,
2184
            enumchron           = ?,
2185
            more_subfields_xml  = ?,
2185
            more_subfields_xml  = ?,
2186
            copynumber          = ?,
2186
            copynumber          = ?,
2187
            stocknumber         = ?
2187
            stocknumber         = ?
2188
          ";
2188
          ";
2189
    my $sth = $dbh->prepare($query);
2189
    my $sth = $dbh->prepare($query);
2190
    my $today = C4::Dates->today('iso');
2190
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
2191
   $sth->execute(
2191
   $sth->execute(
2192
            $item->{'biblionumber'},
2192
            $item->{'biblionumber'},
2193
            $item->{'biblioitemnumber'},
2193
            $item->{'biblioitemnumber'},
(-)a/C4/Log.pm (-3 / +3 lines)
Lines 25-31 use strict; Link Here
25
use warnings;
25
use warnings;
26
26
27
use C4::Context;
27
use C4::Context;
28
use C4::Dates qw(format_date);
28
use Koha::DateUtils;
29
29
30
use vars qw($VERSION @ISA @EXPORT);
30
use vars qw($VERSION @ISA @EXPORT);
31
31
Lines 220-227 sub GetLogs { Link Here
220
    my $object   = shift;
220
    my $object   = shift;
221
    my $info     = shift;
221
    my $info     = shift;
222
   
222
   
223
    my $iso_datefrom = C4::Dates->new($datefrom,C4::Context->preference("dateformat"))->output('iso');
223
    my $iso_datefrom = output_pref({ dt => dt_from_string( $datefrom ), dateformat => 'iso', dateonly => 1 });
224
    my $iso_dateto = C4::Dates->new($dateto,C4::Context->preference("dateformat"))->output('iso');
224
    my $iso_dateto = output_pref({ dt => dt_from_string( $dateto ), dateformat => 'iso', dateonly => 1 });
225
225
226
    my $dbh = C4::Context->dbh;
226
    my $dbh = C4::Context->dbh;
227
    my $query = "
227
    my $query = "
(-)a/C4/NewsChannels.pm (-4 / +4 lines)
Lines 20-26 package C4::NewsChannels; Link Here
20
20
21
use Modern::Perl;
21
use Modern::Perl;
22
use C4::Context;
22
use C4::Context;
23
use C4::Dates qw(format_date);
23
use Koha::DateUtils;
24
24
25
use vars qw($VERSION @ISA @EXPORT);
25
use vars qw($VERSION @ISA @EXPORT);
26
26
Lines 135-142 sub get_opac_new { Link Here
135
    $sth->execute($idnew);
135
    $sth->execute($idnew);
136
    my $data = $sth->fetchrow_hashref;
136
    my $data = $sth->fetchrow_hashref;
137
    $data->{$data->{'lang'}} = 1 if defined $data->{lang};
137
    $data->{$data->{'lang'}} = 1 if defined $data->{lang};
138
    $data->{expirationdate} = format_date($data->{expirationdate});
138
    $data->{expirationdate} = output_pref({ dt => dt_from_string( $data->{expirationdate} ), dateonly => 1 });
139
    $data->{timestamp}      = format_date($data->{timestamp});
139
    $data->{timestamp}      = output_pref({ dt => dt_from_string( $data->{timestamp} ), dateonly => 1 }) ;
140
    return $data;
140
    return $data;
141
}
141
}
142
142
Lines 209-215 sub GetNewsToDisplay { Link Here
209
    $sth->execute($lang,$branch);
209
    $sth->execute($lang,$branch);
210
    my @results;
210
    my @results;
211
    while ( my $row = $sth->fetchrow_hashref ){
211
    while ( my $row = $sth->fetchrow_hashref ){
212
        $row->{newdate} = format_date($row->{newdate});
212
        $row->{newdate} = output_pref({ dt => dt_from_string( $row->{newdate} ), dateonly => 1 });
213
        push @results, $row;
213
        push @results, $row;
214
    }
214
    }
215
    return \@results;
215
    return \@results;
(-)a/C4/Output.pm (-1 lines)
Lines 31-37 use strict; Link Here
31
use URI::Escape;
31
use URI::Escape;
32
32
33
use C4::Context;
33
use C4::Context;
34
use C4::Dates qw(format_date);
35
use C4::Templates;
34
use C4::Templates;
36
35
37
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
36
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
(-)a/C4/Suggestions.pm (-6 / +3 lines)
Lines 25-37 use CGI qw ( -utf8 ); Link Here
25
25
26
use C4::Context;
26
use C4::Context;
27
use C4::Output;
27
use C4::Output;
28
use C4::Dates qw(format_date format_date_in_iso);
29
use C4::Debug;
28
use C4::Debug;
30
use C4::Letters;
29
use C4::Letters;
31
use Koha::DateUtils qw( dt_from_string );
30
use Koha::DateUtils;
32
31
33
use List::MoreUtils qw(any);
32
use List::MoreUtils qw(any);
34
use C4::Dates qw(format_date_in_iso);
35
use base qw(Exporter);
33
use base qw(Exporter);
36
34
37
our $VERSION = 3.07.00.049;
35
our $VERSION = 3.07.00.049;
Lines 176-191 sub SearchSuggestion { Link Here
176
    }
174
    }
177
175
178
    # filter on date fields
176
    # filter on date fields
179
    my $today = C4::Dates->today('iso');
180
    foreach my $field (qw( suggesteddate manageddate accepteddate )) {
177
    foreach my $field (qw( suggesteddate manageddate accepteddate )) {
181
        my $from = $field . "_from";
178
        my $from = $field . "_from";
182
        my $to   = $field . "_to";
179
        my $to   = $field . "_to";
183
        if ( $suggestion->{$from} || $suggestion->{$to} ) {
180
        if ( $suggestion->{$from} || $suggestion->{$to} ) {
184
            push @query, qq{ AND suggestions.$field BETWEEN ? AND ? };
181
            push @query, qq{ AND suggestions.$field BETWEEN ? AND ? };
185
            push @sql_params,
182
            push @sql_params,
186
              format_date_in_iso( $suggestion->{$from} ) || '0000-00-00';
183
              output_pref({ dt => dt_from_string( $suggestion->{$from} ), dateformat => 'iso', dateonly => 1 }) || '0000-00-00';
187
            push @sql_params,
184
            push @sql_params,
188
              format_date_in_iso( $suggestion->{$to} ) || $today;
185
              output_pref({ dt => dt_from_string( $suggestion->{$to} ), dateformat => 'iso', dateonly => 1 }) || output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
189
        }
186
        }
190
    }
187
    }
191
188
(-)a/Koha/Borrower/Files.pm (-1 lines)
Lines 23-29 use vars qw($VERSION); Link Here
23
23
24
use C4::Context;
24
use C4::Context;
25
use C4::Output;
25
use C4::Output;
26
use C4::Dates;
27
use C4::Debug;
26
use C4::Debug;
28
27
29
BEGIN {
28
BEGIN {
(-)a/Koha/Misc/Files.pm (-1 lines)
Lines 25-31 $VERSION = '0.25'; Link Here
25
25
26
use C4::Context;
26
use C4::Context;
27
use C4::Output;
27
use C4::Output;
28
use C4::Dates;
29
28
30
=head1 NAME
29
=head1 NAME
31
30
(-)a/cataloguing/value_builder/barcode.pl (-2 / +2 lines)
Lines 23-29 no warnings 'redefine'; # otherwise loading up multiple plugins fills the log wi Link Here
23
23
24
use C4::Context;
24
use C4::Context;
25
require C4::Barcodes::ValueBuilder;
25
require C4::Barcodes::ValueBuilder;
26
require C4::Dates;
26
use Koha::DateUtils;
27
27
28
use Algorithm::CheckDigits;
28
use Algorithm::CheckDigits;
29
29
Lines 35-41 sub plugin_javascript { 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('-', C4::Dates->today('iso'));
38
    ($args{year}, $args{mon}, $args{day}) = split('-', output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }));
39
    ($args{tag},$args{subfield})       =  GetMarcFromKohaField("items.barcode", '');
39
    ($args{tag},$args{subfield})       =  GetMarcFromKohaField("items.barcode", '');
40
    ($args{loctag},$args{locsubfield}) =  GetMarcFromKohaField("items.homebranch", '');
40
    ($args{loctag},$args{locsubfield}) =  GetMarcFromKohaField("items.homebranch", '');
41
41
(-)a/cataloguing/value_builder/barcode_manual.pl (-2 / +2 lines)
Lines 23-29 no warnings 'redefine'; # otherwise loading up multiple plugins fills the log wi Link Here
23
23
24
use C4::Context;
24
use C4::Context;
25
require C4::Barcodes::ValueBuilder;
25
require C4::Barcodes::ValueBuilder;
26
require C4::Dates;
26
use Koha::DateUtils;
27
27
28
my $DEBUG = 0;
28
my $DEBUG = 0;
29
29
Lines 35-41 sub plugin_javascript { Link Here
35
    $args{dbh} = $dbh;
35
    $args{dbh} = $dbh;
36
36
37
# find today's date
37
# find today's date
38
    ($args{year}, $args{mon}, $args{day}) = split('-', C4::Dates->today('iso'));
38
    ($args{year}, $args{mon}, $args{day}) = split('-', output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }));
39
    ($args{tag},$args{subfield})       =  GetMarcFromKohaField("items.barcode", '');
39
    ($args{tag},$args{subfield})       =  GetMarcFromKohaField("items.barcode", '');
40
    ($args{loctag},$args{locsubfield}) =  GetMarcFromKohaField("items.homebranch", '');
40
    ($args{loctag},$args{locsubfield}) =  GetMarcFromKohaField("items.homebranch", '');
41
41
(-)a/cataloguing/value_builder/dateaccessioned.pl (-3 / +2 lines)
Lines 18-32 Link Here
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
use Koha::DateUtils;
22
no warnings 'redefine';
22
no warnings 'redefine';
23
23
24
sub plugin_javascript {
24
sub plugin_javascript {
25
	# my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
25
	# my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
26
	my $function_name = "dateaccessioned".(int(rand(100000))+1);
26
	my $function_name = "dateaccessioned".(int(rand(100000))+1);
27
27
28
    require C4::Dates;
28
    my $date = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
29
	my $date = C4::Dates->today('iso');
30
29
31
	# find the tag/subfield mapped to items.dateaccessioned
30
	# find the tag/subfield mapped to items.dateaccessioned
32
	my ($tag,$subfield) =  GetMarcFromKohaField("items.dateaccessioned","");
31
	my ($tag,$subfield) =  GetMarcFromKohaField("items.dateaccessioned","");
(-)a/circ/transferstoreceive.pl (-2 / +2 lines)
Lines 25-31 use C4::Context; Link Here
25
use C4::Output;
25
use C4::Output;
26
use C4::Branch;     # GetBranches
26
use C4::Branch;     # GetBranches
27
use C4::Auth;
27
use C4::Auth;
28
use C4::Dates qw/format_date/;
28
use Koha::DateUtils;
29
use C4::Biblio;
29
use C4::Biblio;
30
use C4::Circulation;
30
use C4::Circulation;
31
use C4::Members;
31
use C4::Members;
Lines 119-125 foreach my $br ( keys %$branches ) { Link Here
119
119
120
$template->param(
120
$template->param(
121
    branchesloop => \@branchesloop,
121
    branchesloop => \@branchesloop,
122
    show_date    => format_date(C4::Dates->today('iso')),
122
    show_date    => output_pref({ dt => dt_from_string, dateonly => 1 }),
123
	TransfersMaxDaysWarning => C4::Context->preference('TransfersMaxDaysWarning'),
123
	TransfersMaxDaysWarning => C4::Context->preference('TransfersMaxDaysWarning'),
124
	latetransfers => $latetransfers ? 1 : 0,
124
	latetransfers => $latetransfers ? 1 : 0,
125
);
125
);
(-)a/circ/waitingreserves.pl (-3 / +2 lines)
Lines 25-36 use C4::Context; Link Here
25
use C4::Output;
25
use C4::Output;
26
use C4::Branch; # GetBranchName
26
use C4::Branch; # GetBranchName
27
use C4::Auth;
27
use C4::Auth;
28
use C4::Dates qw/format_date/;
29
use C4::Circulation;
28
use C4::Circulation;
30
use C4::Members;
29
use C4::Members;
31
use C4::Biblio;
30
use C4::Biblio;
32
use C4::Items;
31
use C4::Items;
33
32
use Koha::DateUtils;
34
use Date::Calc qw(
33
use Date::Calc qw(
35
  Today
34
  Today
36
  Add_Delta_Days
35
  Add_Delta_Days
Lines 158-164 $template->param( Link Here
158
    reservecount => $reservcount,
157
    reservecount => $reservcount,
159
    overloop    => \@overloop,
158
    overloop    => \@overloop,
160
    overcount   => $overcount,
159
    overcount   => $overcount,
161
    show_date   => format_date(C4::Dates->today('iso')),
160
    show_date   => output_pref({ dt => dt_from_string, dateonly => 1 }),
162
    ReservesMaxPickUpDelay => C4::Context->preference('ReservesMaxPickUpDelay')
161
    ReservesMaxPickUpDelay => C4::Context->preference('ReservesMaxPickUpDelay')
163
);
162
);
164
163
(-)a/members/notices.pl (-1 lines)
Lines 29-35 use C4::Branch; Link Here
29
use C4::Letters;
29
use C4::Letters;
30
use C4::Members::Attributes qw(GetBorrowerAttributes);
30
use C4::Members::Attributes qw(GetBorrowerAttributes);
31
31
32
use C4::Dates qw/format_date/;
33
my $input=new CGI;
32
my $input=new CGI;
34
33
35
34
(-)a/members/printinvoice.pl (-2 / +2 lines)
Lines 25-31 use warnings; Link Here
25
25
26
use C4::Auth;
26
use C4::Auth;
27
use C4::Output;
27
use C4::Output;
28
use C4::Dates qw/format_date/;
28
use Koha::DateUtils;
29
use CGI qw ( -utf8 );
29
use CGI qw ( -utf8 );
30
use C4::Members;
30
use C4::Members;
31
use C4::Branch;
31
use C4::Branch;
Lines 89-95 for ( my $i = 0 ; $i < $numaccts ; $i++ ) { Link Here
89
    }
89
    }
90
90
91
    my %row = (
91
    my %row = (
92
        'date'                    => format_date( $accts->[$i]{'date'} ),
92
        'date'                    => output_pref({ dt => dt_from_string( $accts->[$i]{'date'}, 'iso' ), dateonly => 1 }),
93
        'amountcredit'            => $accts->[$i]{'amountcredit'},
93
        'amountcredit'            => $accts->[$i]{'amountcredit'},
94
        'amountoutstandingcredit' => $accts->[$i]{'amountoutstandingcredit'},
94
        'amountoutstandingcredit' => $accts->[$i]{'amountoutstandingcredit'},
95
        'toggle'                  => $accts->[$i]{'toggle'},
95
        'toggle'                  => $accts->[$i]{'toggle'},
(-)a/members/readingrec.pl (-4 / +1 lines)
Lines 31-38 use C4::Members; Link Here
31
use C4::Branch qw(GetBranches);
31
use C4::Branch qw(GetBranches);
32
use List::MoreUtils qw/any uniq/;
32
use List::MoreUtils qw/any uniq/;
33
use Koha::DateUtils;
33
use Koha::DateUtils;
34
35
use C4::Dates qw/format_date/;
36
use C4::Members::Attributes qw(GetBorrowerAttributes);
34
use C4::Members::Attributes qw(GetBorrowerAttributes);
37
35
38
my $input = CGI->new;
36
my $input = CGI->new;
Lines 77-84 my $branches = GetBranches(); Link Here
77
75
78
#   barcode export
76
#   barcode export
79
if ( $op eq 'export_barcodes' ) {
77
if ( $op eq 'export_barcodes' ) {
80
    my $today = C4::Dates->new();
78
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
81
    $today = $today->output('iso');
82
    my @barcodes =
79
    my @barcodes =
83
      map { $_->{barcode} } grep { $_->{returndate} =~ m/^$today/o } @{$issues};
80
      map { $_->{barcode} } grep { $_->{returndate} =~ m/^$today/o } @{$issues};
84
    my $borrowercardnumber =
81
    my $borrowercardnumber =
(-)a/opac/opac-messaging.pl (-1 lines)
Lines 27-33 use C4::Context; Link Here
27
use C4::Koha;
27
use C4::Koha;
28
use C4::Circulation;
28
use C4::Circulation;
29
use C4::Output;
29
use C4::Output;
30
use C4::Dates qw/format_date/;
31
use C4::Members;
30
use C4::Members;
32
use C4::Members::Messaging;
31
use C4::Members::Messaging;
33
use C4::Branch;
32
use C4::Branch;
(-)a/opac/opac-privacy.pl (-1 lines)
Lines 24-30 use C4::Context; Link Here
24
use C4::Circulation;
24
use C4::Circulation;
25
use C4::Members;
25
use C4::Members;
26
use C4::Output;
26
use C4::Output;
27
use C4::Dates;
28
27
29
my $query = new CGI;
28
my $query = new CGI;
30
29
(-)a/opac/opac-user.pl (-1 / +3 lines)
Lines 292-298 foreach my $res (@reserves) { Link Here
292
    if ($show_priority) {
292
    if ($show_priority) {
293
        $res->{'priority'} ||= '';
293
        $res->{'priority'} ||= '';
294
    }
294
    }
295
    $res->{'suspend_until'} = C4::Dates->new( $res->{'suspend_until'}, "iso")->output("syspref") if ( $res->{'suspend_until'} );
295
    if ( $res->{'suspend_until'} ) {
296
        $res->{'suspend_until'} = output_pref({ dt => dt_from_string( $res->{'suspend_until'} , 'iso' ), dateonly => 1 });
297
    }
296
}
298
}
297
299
298
# use Data::Dumper;
300
# use Data::Dumper;
(-)a/tags/list.pl (-1 lines)
Lines 24-30 use CGI qw ( -utf8 ); Link Here
24
use C4::Auth qw(:DEFAULT check_cookie_auth);
24
use C4::Auth qw(:DEFAULT check_cookie_auth);
25
use C4::Biblio;
25
use C4::Biblio;
26
use C4::Context;
26
use C4::Context;
27
use C4::Dates qw(format_date);
28
use C4::Items;
27
use C4::Items;
29
use C4::Koha;
28
use C4::Koha;
30
use C4::Tags qw(get_tags remove_tag get_tag_rows);
29
use C4::Tags qw(get_tags remove_tag get_tag_rows);
(-)a/tools/koha-news.pl (-3 / +3 lines)
Lines 28-47 use CGI qw ( -utf8 ); Link Here
28
use C4::Auth;
28
use C4::Auth;
29
use C4::Koha;
29
use C4::Koha;
30
use C4::Context;
30
use C4::Context;
31
use C4::Dates qw(format_date_in_iso);
32
use C4::Output;
31
use C4::Output;
33
use C4::NewsChannels;
32
use C4::NewsChannels;
34
use C4::Languages qw(getTranslatedLanguages);
33
use C4::Languages qw(getTranslatedLanguages);
35
use Date::Calc qw/Date_to_Days Today/;
34
use Date::Calc qw/Date_to_Days Today/;
36
use C4::Branch qw/GetBranches/;
35
use C4::Branch qw/GetBranches/;
36
use Koha::DateUtils;
37
37
38
my $cgi = new CGI;
38
my $cgi = new CGI;
39
39
40
my $id             = $cgi->param('id');
40
my $id             = $cgi->param('id');
41
my $title          = $cgi->param('title');
41
my $title          = $cgi->param('title');
42
my $new            = $cgi->param('new');
42
my $new            = $cgi->param('new');
43
my $expirationdate = format_date_in_iso($cgi->param('expirationdate'));
43
my $expirationdate = output_pref({ dt => dt_from_string( $cgi->param('expirationdate') ), dateformat => 'iso', dateonly => 1 });
44
my $timestamp      = format_date_in_iso($cgi->param('timestamp'));
44
my $timestamp      = output_pref({ dt => dt_from_string( $cgi->param('timestamp') ), dateformat => 'iso', dateonly => 1 });
45
my $number         = $cgi->param('number');
45
my $number         = $cgi->param('number');
46
my $lang           = $cgi->param('lang');
46
my $lang           = $cgi->param('lang');
47
my $branchcode     = $cgi->param('branch');
47
my $branchcode     = $cgi->param('branch');
(-)a/tools/scheduler.pl (-3 / +3 lines)
Lines 25-31 use C4::Reports::Guided; Link Here
25
use C4::Auth;
25
use C4::Auth;
26
use CGI qw ( -utf8 );
26
use CGI qw ( -utf8 );
27
use C4::Output;
27
use C4::Output;
28
use C4::Dates;
28
use Koha::DateUtils;;
29
29
30
use vars qw($debug);
30
use vars qw($debug);
31
31
Lines 62-71 my $id = $input->param('id'); Link Here
62
if ( $mode eq 'job_add' ) {
62
if ( $mode eq 'job_add' ) {
63
63
64
    # Retrieving the date according to the dateformat syspref
64
    # Retrieving the date according to the dateformat syspref
65
    my $c4date = C4::Dates->new($input->param('startdate'));
65
    my $c4date = output_pref({ dt => dt_from_string( $input->param('startdate') ), dateformat => 'iso', dateonly => 1 });
66
66
67
    # Formatting it for Schedule::At
67
    # Formatting it for Schedule::At
68
    my $startdate = join('', (split /-/, $c4date->output("iso")));
68
    my $startdate = join('', (split /-/, $c4date));
69
69
70
    my $starttime = $input->param('starttime');
70
    my $starttime = $input->param('starttime');
71
    $starttime =~ s/\://g;
71
    $starttime =~ s/\://g;
(-)a/tools/viewlog.pl (-2 lines)
Lines 25-31 use CGI qw ( -utf8 ); Link Here
25
use Text::CSV::Encoded;
25
use Text::CSV::Encoded;
26
use C4::Context;
26
use C4::Context;
27
use C4::Koha;
27
use C4::Koha;
28
use C4::Dates;
29
use C4::Output;
28
use C4::Output;
30
use C4::Log;
29
use C4::Log;
31
use C4::Items;
30
use C4::Items;
32
- 

Return to bug 13813