use C4::Auth;
use C4::Output;
-use C4::Interface::CGI::Output;
-use C4::Calendar::Calendar;
+
+
+use C4::Calendar;
my $input = new CGI;
my $dbh = C4::Context->dbh();
my $title = $input->param('newTitle');
my $description = $input->param('newDescription');
-my $calendar = C4::Calendar::Calendar->new(branchcode => $branchcode);
+$title || ($title = '');
+if ($description) {
+ $description =~ s/\r/\\r/g;
+ $description =~ s/\n/\\n/g;
+} else {
+ $description = '';
+}
+
+my $calendar = C4::Calendar->new(branchcode => $branchcode);
if ($input->param('newOperation') eq 'weekday') {
$calendar->insert_week_day_holiday(weekday => $weekday,
description => $description);
}
-print $input->redirect("/cgi-bin/koha/tools/holidays.pl?branch=$branchcode");
\ No newline at end of file
+print $input->redirect("/cgi-bin/koha/tools/holidays.pl?branch=$branchcode");