Bug 14251: Allow use of CSS in discharge letter
[koha-ffzg.git] / C4 / Calendar.pm
index 76c498f..257119c 100644 (file)
@@ -19,8 +19,8 @@ use strict;
 use warnings;
 use vars qw(@EXPORT);
 
-use Carp;
-use Date::Calc qw( Date_to_Days Today);
+use Carp qw( croak );
+use Date::Calc qw( Today );
 
 use C4::Context;
 use Koha::Caches;
@@ -277,8 +277,8 @@ sub insert_single_holiday {
 
     # changed the 'single_holidays' table, lets force/reset its cache
     my $cache = Koha::Caches->get_instance();
-    $cache->clear_from_cache( 'single_holidays') ;
-    $cache->clear_from_cache( 'exception_holidays') ;
+    my $key   = $self->{branchcode} . "_holidays";
+    $cache->clear_from_cache($key);
 
     return $self;
 
@@ -322,8 +322,8 @@ sub insert_exception_holiday {
 
     # changed the 'single_holidays' table, lets force/reset its cache
     my $cache = Koha::Caches->get_instance();
-    $cache->clear_from_cache( 'single_holidays') ;
-    $cache->clear_from_cache( 'exception_holidays') ;
+    my $key   = $self->{branchcode} . "_holidays";
+    $cache->clear_from_cache($key);
 
     return $self;
 }
@@ -423,8 +423,8 @@ UPDATE special_holidays SET title = ?, description = ?
 
     # changed the 'single_holidays' table, lets force/reset its cache
     my $cache = Koha::Caches->get_instance();
-    $cache->clear_from_cache( 'single_holidays') ;
-    $cache->clear_from_cache( 'exception_holidays') ;
+    my $key   = $self->{branchcode} . "_holidays";
+    $cache->clear_from_cache($key);
 
     return $self;
 }
@@ -466,8 +466,8 @@ UPDATE special_holidays SET title = ?, description = ?
 
     # changed the 'single_holidays' table, lets force/reset its cache
     my $cache = Koha::Caches->get_instance();
-    $cache->clear_from_cache( 'single_holidays') ;
-    $cache->clear_from_cache( 'exception_holidays') ;
+    my $key   = $self->{branchcode} . "_holidays";
+    $cache->clear_from_cache($key);
 
     return $self;
 }
@@ -547,8 +547,8 @@ sub delete_holiday {
 
     # changed the 'single_holidays' table, lets force/reset its cache
     my $cache = Koha::Caches->get_instance();
-    $cache->clear_from_cache( 'single_holidays') ;
-    $cache->clear_from_cache( 'exception_holidays') ;
+    my $key   = $self->{branchcode} . "_holidays";
+    $cache->clear_from_cache($key);
 
     return $self;
 }
@@ -578,8 +578,8 @@ sub delete_holiday_range {
 
     # changed the 'single_holidays' table, lets force/reset its cache
     my $cache = Koha::Caches->get_instance();
-    $cache->clear_from_cache( 'single_holidays') ;
-    $cache->clear_from_cache( 'exception_holidays') ;
+    my $key   = $self->{branchcode} . "_holidays";
+    $cache->clear_from_cache($key);
 
 }
 
@@ -632,8 +632,8 @@ sub delete_exception_holiday_range {
 
     # changed the 'single_holidays' table, lets force/reset its cache
     my $cache = Koha::Caches->get_instance();
-    $cache->clear_from_cache( 'single_holidays') ;
-    $cache->clear_from_cache( 'exception_holidays') ;
+    my $key   = $self->{branchcode} . "_holidays";
+    $cache->clear_from_cache($key);
 }
 
 =head2 isHoliday
@@ -733,3 +733,4 @@ __END__
 Koha Physics Library UNLP <matias_veleda@hotmail.com>
 
 =cut
+