diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm index 3986038fda..90069b6a89 100644 --- a/Koha/Calendar.pm +++ b/Koha/Calendar.pm @@ -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; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 31bfc883b8..d16913f7e7 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -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"; diff --git a/kohaversion.pl b/kohaversion.pl index 3057f380a6..73f188bcc0 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -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