X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FCalendar.pm;h=1e687db7aa247c39decf1f304c5aa10315df21dd;hb=5d6c092921919526ade501facb1220f8a108a08f;hp=a9d39dcaaf67c55df48ac6fb21c896b6bf1b914e;hpb=c9d0c168679d6b225e305b45331e1e86ee4939d1;p=koha_fer diff --git a/C4/Calendar.pm b/C4/Calendar.pm index a9d39dcaaf..1e687db7aa 100644 --- a/C4/Calendar.pm +++ b/C4/Calendar.pm @@ -514,6 +514,78 @@ sub delete_holiday { } return $self; } +=head2 delete_holiday_range + + delete_holiday_range(day => $day, + month => $month, + year => $year); + +Delete a holiday range of dates for $self->{branchcode}. + +C<$day> Is the day month to make the date to delete. + +C<$month> Is month to make the date to delete. + +C<$year> Is year to make the date to delete. + +=cut + +sub delete_holiday_range { + my $self = shift; + my %options = @_; + + my $dbh = C4::Context->dbh(); + my $sth = $dbh->prepare("DELETE FROM special_holidays WHERE (branchcode = ?) AND (day = ?) AND (month = ?) AND (year = ?)"); + $sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year}); +} + +=head2 delete_holiday_range_repeatable + + delete_holiday_range_repeatable(day => $day, + month => $month); + +Delete a holiday for $self->{branchcode}. + +C<$day> Is the day month to make the date to delete. + +C<$month> Is month to make the date to delete. + +=cut + +sub delete_holiday_range_repeatable { + my $self = shift; + my %options = @_; + + my $dbh = C4::Context->dbh(); + my $sth = $dbh->prepare("DELETE FROM repeatable_holidays WHERE (branchcode = ?) AND (day = ?) AND (month = ?)"); + $sth->execute($self->{branchcode}, $options{day}, $options{month}); +} + +=head2 delete_exception_holiday_range + + delete_exception_holiday_range(weekday => $weekday + day => $day, + month => $month, + year => $year); + +Delete a holiday for $self->{branchcode}. + +C<$day> Is the day month to make the date to delete. + +C<$month> Is month to make the date to delete. + +C<$year> Is year to make the date to delete. + +=cut + +sub delete_exception_holiday_range { + my $self = shift; + my %options = @_; + + my $dbh = C4::Context->dbh(); + my $sth = $dbh->prepare("DELETE FROM special_holidays WHERE (branchcode = ?) AND (isexception = 1) AND (day = ?) AND (month = ?) AND (year = ?)"); + $sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year}); +} =head2 isHoliday