koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/tools holidays.pl exceptionHolidays.pl [rel_2_2]


From: Ryan Higgins
Subject: [Koha-cvs] koha/tools holidays.pl exceptionHolidays.pl [rel_2_2]
Date: Mon, 09 Apr 2007 16:44:26 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Ryan Higgins <rych>     07/04/09 16:44:26

Modified files:
        tools          : holidays.pl 
Added files:
        tools          : exceptionHolidays.pl 

Log message:
        updating rel_2_2 holidays, changing default branch from fifth to first

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/tools/holidays.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.3.2.3&r2=1.3.2.4
http://cvs.savannah.gnu.org/viewcvs/koha/tools/exceptionHolidays.pl?cvsroot=koha&only_with_tag=rel_2_2&rev=1.3.2.1

Patches:
Index: holidays.pl
===================================================================
RCS file: /sources/koha/koha/tools/holidays.pl,v
retrieving revision 1.3.2.3
retrieving revision 1.3.2.4
diff -u -b -r1.3.2.3 -r1.3.2.4
--- holidays.pl 13 Feb 2007 09:54:05 -0000      1.3.2.3
+++ holidays.pl 9 Apr 2007 16:44:26 -0000       1.3.2.4
@@ -24,7 +24,7 @@
 }
 my @listValues = keys(%list);
 if (!defined($branch)) {
-       $branch =$listValues[4];
+       $branch =$listValues[0];
 }
 my $branchesList = CGI::scrolling_list(-name => 'branch', -id=>'branch',
                                               -values => address@hidden,

Index: exceptionHolidays.pl
===================================================================
RCS file: exceptionHolidays.pl
diff -N exceptionHolidays.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ exceptionHolidays.pl        9 Apr 2007 16:44:26 -0000       1.3.2.1
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+
+use strict;
+use CGI;
+
+use C4::Auth;
+use C4::Output;
+use C4::Interface::CGI::Output;
+#use C4::Database;
+#use HTML::Template;
+use C4::Calendar;
+
+my $input = new CGI;
+my $dbh = C4::Context->dbh();
+
+my $branchcode = $input->param('showBranchName');
+my $weekday = $input->param('showWeekday');
+my $day = $input->param('showDay');
+my $month = $input->param('showMonth');
+my $year = $input->param('showYear');
+my $title = $input->param('showTitle');
+my $description = $input->param('showDescription');
+
+my $calendar = C4::Calendar->new(branchcode => $branchcode);
+
+$title || ($title = '');
+if ($description) {
+    $description =~ s/\r/\\r/g;
+    $description =~ s/\n/\\n/g;
+} else {
+    $description = '';
+}   
+
+if ($input->param('showOperation') eq 'exception') {
+       $calendar->insert_exception_holiday(day => $day,
+                                                                               
month => $month,
+                                                                           
year => $year,
+                                                               title => $title,
+                                                               description => 
$description);
+} elsif ($input->param('showOperation') eq 'delete') {
+       $calendar->delete_holiday(weekday => $weekday,
+                                 day => $day,
+                                 month => $month,
+                                             year => $year);
+}
+print $input->redirect("/cgi-bin/koha/tools/holidays.pl?branch=$branchcode");




reply via email to

[Prev in Thread] Current Thread [Next in Thread]