[Koha-cvs] koha/tools newHolidays.pl [rel_2_2]

Chris Cormack chris at katipo.co.nz
Tue Feb 13 11:01:20 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	Chris Cormack <rangi>	07/02/13 10:01:20

Added files:
	tools          : newHolidays.pl 

Log message:
	Second script needed for managing holidays

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/tools/newHolidays.pl?cvsroot=koha&only_with_tag=rel_2_2&rev=1.2.2.1

Patches:
Index: newHolidays.pl
===================================================================
RCS file: newHolidays.pl
diff -N newHolidays.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ newHolidays.pl	13 Feb 2007 10:01:20 -0000	1.2.2.1
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+
+use strict;
+use CGI;
+
+use C4::Auth;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use C4::Calendar;
+
+my $input = new CGI;
+my $dbh = C4::Context->dbh();
+
+my $branchcode = $input->param('newBranchName');
+my $weekday = $input->param('newWeekday');
+my $day = $input->param('newDay');
+my $month = $input->param('newMonth');
+my $year = $input->param('newYear');
+my $title = $input->param('newTitle');
+my $description = $input->param('newDescription');
+
+my $calendar = C4::Calendar::Calendar->new(branchcode => $branchcode);
+
+if ($input->param('newOperation') eq 'weekday') {
+	$calendar->insert_week_day_holiday(weekday => $weekday,
+							           title => $title,
+							           description => $description);
+} elsif ($input->param('newOperation') eq 'repeatable') {
+	$calendar->insert_day_month_holiday(day => $day,
+	                                    month => $month,
+							            title => $title,
+							            description => $description);
+} elsif ($input->param('newOperation') eq 'holiday') {
+	$calendar->insert_single_holiday(day => $day,
+	                                 month => $month,
+						             year => $year,
+						             title => $title,
+						             description => $description);
+
+}
+print $input->redirect("/cgi-bin/koha/tools/holidays.pl?branch=$branchcode");





More information about the Koha-cvs mailing list