Lines 23-29
use Carp;
Link Here
|
23 |
use Date::Calc qw( Date_to_Days Today); |
23 |
use Date::Calc qw( Date_to_Days Today); |
24 |
|
24 |
|
25 |
use C4::Context; |
25 |
use C4::Context; |
26 |
use Koha::Caches; |
|
|
27 |
|
26 |
|
28 |
use constant ISO_DATE_FORMAT => "%04d-%02d-%02d"; |
27 |
use constant ISO_DATE_FORMAT => "%04d-%02d-%02d"; |
29 |
|
28 |
|
Lines 276-282
sub insert_single_holiday {
Link Here
|
276 |
|
275 |
|
277 |
|
276 |
|
278 |
# changed the 'single_holidays' table, lets force/reset its cache |
277 |
# changed the 'single_holidays' table, lets force/reset its cache |
279 |
my $cache = Koha::Caches->get_instance(); |
278 |
my $cache = C4::Context->cache; |
280 |
$cache->clear_from_cache( 'single_holidays') ; |
279 |
$cache->clear_from_cache( 'single_holidays') ; |
281 |
$cache->clear_from_cache( 'exception_holidays') ; |
280 |
$cache->clear_from_cache( 'exception_holidays') ; |
282 |
|
281 |
|
Lines 321-327
sub insert_exception_holiday {
Link Here
|
321 |
$self->{'exception_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description}; |
320 |
$self->{'exception_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description}; |
322 |
|
321 |
|
323 |
# changed the 'single_holidays' table, lets force/reset its cache |
322 |
# changed the 'single_holidays' table, lets force/reset its cache |
324 |
my $cache = Koha::Caches->get_instance(); |
323 |
my $cache = C4::Context->cache; |
325 |
$cache->clear_from_cache( 'single_holidays') ; |
324 |
$cache->clear_from_cache( 'single_holidays') ; |
326 |
$cache->clear_from_cache( 'exception_holidays') ; |
325 |
$cache->clear_from_cache( 'exception_holidays') ; |
327 |
|
326 |
|
Lines 422-428
UPDATE special_holidays SET title = ?, description = ?
Link Here
|
422 |
$self->{'single_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description}; |
421 |
$self->{'single_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description}; |
423 |
|
422 |
|
424 |
# changed the 'single_holidays' table, lets force/reset its cache |
423 |
# changed the 'single_holidays' table, lets force/reset its cache |
425 |
my $cache = Koha::Caches->get_instance(); |
424 |
my $cache = C4::Context->cache; |
426 |
$cache->clear_from_cache( 'single_holidays') ; |
425 |
$cache->clear_from_cache( 'single_holidays') ; |
427 |
$cache->clear_from_cache( 'exception_holidays') ; |
426 |
$cache->clear_from_cache( 'exception_holidays') ; |
428 |
|
427 |
|
Lines 465-471
UPDATE special_holidays SET title = ?, description = ?
Link Here
|
465 |
$self->{'exception_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description}; |
464 |
$self->{'exception_holidays'}->{"$options{year}/$options{month}/$options{day}"}{description} = $options{description}; |
466 |
|
465 |
|
467 |
# changed the 'single_holidays' table, lets force/reset its cache |
466 |
# changed the 'single_holidays' table, lets force/reset its cache |
468 |
my $cache = Koha::Caches->get_instance(); |
467 |
my $cache = C4::Context->cache; |
469 |
$cache->clear_from_cache( 'single_holidays') ; |
468 |
$cache->clear_from_cache( 'single_holidays') ; |
470 |
$cache->clear_from_cache( 'exception_holidays') ; |
469 |
$cache->clear_from_cache( 'exception_holidays') ; |
471 |
|
470 |
|
Lines 546-552
sub delete_holiday {
Link Here
|
546 |
} |
545 |
} |
547 |
|
546 |
|
548 |
# changed the 'single_holidays' table, lets force/reset its cache |
547 |
# changed the 'single_holidays' table, lets force/reset its cache |
549 |
my $cache = Koha::Caches->get_instance(); |
548 |
my $cache = C4::Context->cache; |
550 |
$cache->clear_from_cache( 'single_holidays') ; |
549 |
$cache->clear_from_cache( 'single_holidays') ; |
551 |
$cache->clear_from_cache( 'exception_holidays') ; |
550 |
$cache->clear_from_cache( 'exception_holidays') ; |
552 |
|
551 |
|
Lines 577-583
sub delete_holiday_range {
Link Here
|
577 |
$sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year}); |
576 |
$sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year}); |
578 |
|
577 |
|
579 |
# changed the 'single_holidays' table, lets force/reset its cache |
578 |
# changed the 'single_holidays' table, lets force/reset its cache |
580 |
my $cache = Koha::Caches->get_instance(); |
579 |
my $cache = C4::Context->cache; |
581 |
$cache->clear_from_cache( 'single_holidays') ; |
580 |
$cache->clear_from_cache( 'single_holidays') ; |
582 |
$cache->clear_from_cache( 'exception_holidays') ; |
581 |
$cache->clear_from_cache( 'exception_holidays') ; |
583 |
|
582 |
|
Lines 631-637
sub delete_exception_holiday_range {
Link Here
|
631 |
$sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year}); |
630 |
$sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year}); |
632 |
|
631 |
|
633 |
# changed the 'single_holidays' table, lets force/reset its cache |
632 |
# changed the 'single_holidays' table, lets force/reset its cache |
634 |
my $cache = Koha::Caches->get_instance(); |
633 |
my $cache = C4::Context->cache; |
635 |
$cache->clear_from_cache( 'single_holidays') ; |
634 |
$cache->clear_from_cache( 'single_holidays') ; |
636 |
$cache->clear_from_cache( 'exception_holidays') ; |
635 |
$cache->clear_from_cache( 'exception_holidays') ; |
637 |
} |
636 |
} |