removing old barcodes, itemsLabelConfig, and printerConfig
[koha_fer] / tools / newHolidays.pl
index e8fefe4..71dd839 100755 (executable)
@@ -5,8 +5,9 @@ use CGI;
 
 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();
@@ -19,7 +20,15 @@ my $year = $input->param('newYear');
 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,
@@ -38,4 +47,4 @@ if ($input->param('newOperation') eq '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");