8 use C4::Interface::CGI::Output;
14 my $dbh = C4::Context->dbh();
16 my $branchcode = $input->param('newBranchName');
17 my $weekday = $input->param('newWeekday');
18 my $day = $input->param('newDay');
19 my $month = $input->param('newMonth');
20 my $year = $input->param('newYear');
21 my $title = $input->param('newTitle');
22 my $description = $input->param('newDescription');
24 my $calendar = C4::Calendar->new(branchcode => $branchcode);
26 if ($input->param('newOperation') eq 'weekday') {
27 $calendar->insert_week_day_holiday(weekday => $weekday,
29 description => $description);
30 } elsif ($input->param('newOperation') eq 'repeatable') {
31 $calendar->insert_day_month_holiday(day => $day,
34 description => $description);
35 } elsif ($input->param('newOperation') eq 'holiday') {
36 $calendar->insert_single_holiday(day => $day,
40 description => $description);
43 print $input->redirect("/cgi-bin/koha/tools/holidays.pl?branch=$branchcode");