Merge remote-tracking branch 'origin/new/bug_9078' into 3.10.x

This commit is contained in:
Paul Poulain 2012-11-22 16:42:47 +01:00
commit f0da77b872
3 changed files with 19 additions and 10 deletions

View File

@ -177,22 +177,31 @@ sub addDays {
sub is_holiday {
my ( $self, $dt ) = @_;
my $localdt = $dt->clone();
my $day = $localdt->day;
my $month = $localdt->month;
$localdt->truncate( to => 'day' );
if ( $self->{exception_holidays}->contains($localdt) ) {
# exceptions are not holidays
return 0;
}
my $dow = $localdt->day_of_week;
# Representation fix
# TODO: Shouldn't we shift the rest of the $dow also?
if ( $dow == 7 ) {
$dow = 0;
}
if ( $self->{weekly_closed_days}->[$dow] == 1 ) {
return 1;
}
$localdt->truncate( to => 'day' );
my $day = $localdt->day;
my $month = $localdt->month;
if ( exists $self->{day_month_closed_days}->{$month}->{$day} ) {
return 1;
}
if ( $self->{exception_holidays}->contains($localdt) ) {
return 1;
}
if ( $self->{single_holidays}->contains($localdt) ) {
return 1;
}
@ -320,9 +329,9 @@ sub clear_weekly_closed_days {
sub add_holiday {
my $self = shift;
my $new_dt = shift;
my @dt = $self->{exception_holidays}->as_list;
my @dt = $self->{single_holidays}->as_list;
push @dt, $new_dt;
$self->{exception_holidays} =
$self->{single_holidays} =
DateTime::Set->from_datetimes( dates => \@dt );
return;

View File

@ -6062,7 +6062,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
SetVersion ($DBversion);
}
$DBversion = "3.09.00.XXX";
$DBversion = "3.09.00.067";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
$dbh->do("ALTER TABLE statistics CHANGE COLUMN ccode ccode varchar(10) NULL");
print "Upgrade to $DBversion done (Bug 9064: statistics.ccode potentially wrongly defined)\n";

View File

@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
use strict;
sub kohaversion {
our $VERSION = '3.09.00.066';
our $VERSION = '3.09.00.067';
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install