koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/C4 Calendar.pm [rel_3_0]


From: Ryan Higgins
Subject: [Koha-cvs] koha/C4 Calendar.pm [rel_3_0]
Date: Thu, 25 Jan 2007 02:23:46 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     Ryan Higgins <rych>     07/01/25 02:23:46

Modified files:
        C4             : Calendar.pm 

Log message:
        using dbi escaping will allow apostrophes in description fields.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Calendar.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.2&r2=1.1.2.3

Patches:
Index: Calendar.pm
===================================================================
RCS file: /sources/koha/koha/C4/Attic/Calendar.pm,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -b -r1.1.2.2 -r1.1.2.3
--- Calendar.pm 22 Dec 2006 15:09:54 -0000      1.1.2.2
+++ Calendar.pm 25 Jan 2007 02:23:46 -0000      1.1.2.3
@@ -23,7 +23,7 @@
 # use Date::Calc;
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.1.2.2 $' =~ /\d+/g; shift(@v).".".join( 
"_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.1.2.3 $' =~ /\d+/g; shift(@v).".".join( 
"_", map { sprintf "%03d", $_ } @v ); };
 
 =head1 NAME
 
@@ -229,8 +229,8 @@
     my %options = @_;
 
     my $dbh = C4::Context->dbh();
-    my $insertHoliday = $dbh->prepare("insert into repeatable_holidays 
(id,branchcode,weekday,day,month,title,description) values ('', 
'$self->{branchcode}', $options{weekday}, NULL, NULL, '$options{title}', 
'$options{description}')");
-    $insertHoliday->execute;
+    my $insertHoliday = $dbh->prepare("insert into repeatable_holidays 
(id,branchcode,weekday,day,month,title,description) values ( 
'',?,?,NULL,NULL,?,? )"); 
+       $insertHoliday->execute( $self->{branchcode}, 
$options{weekday},$options{title}, $options{description});
     $insertHoliday->finish;
 
     $self->{'week_days_holidays'}->{$options{weekday}}{title} = 
$options{title};
@@ -262,8 +262,8 @@
     my %options = @_;
 
     my $dbh = C4::Context->dbh();
-    my $insertHoliday = $dbh->prepare("insert into repeatable_holidays 
(id,branchcode,weekday,day,month,title,description) values ('', 
'$self->{branchcode}', NULL, $options{day}, $options{month}, '$options{title}', 
'$options{description}')");
-    $insertHoliday->execute;
+    my $insertHoliday = $dbh->prepare("insert into repeatable_holidays 
(id,branchcode,weekday,day,month,title,description) values ('', ?, NULL, ?, ?, 
?,? )");
+       $insertHoliday->execute( $self->{branchcode}, 
$options{day},$options{month},$options{title}, $options{description});
     $insertHoliday->finish;
 
     $self->{'day_month_holidays'}->{"$options{month}/$options{day}"}{title} = 
$options{title};
@@ -299,8 +299,8 @@
 
     my $dbh = C4::Context->dbh();
     my $isexception = 0;
-    my $insertHoliday = $dbh->prepare("insert into special_holidays 
(id,branchcode,day,month,year,isexception,title,description) values ('', 
'$self->{branchcode}', $options{day}, $options{month}, $options{year}, 
$isexception, '$options{title}', '$options{description}')");
-    $insertHoliday->execute;
+    my $insertHoliday = $dbh->prepare("insert into special_holidays 
(id,branchcode,day,month,year,isexception,title,description) values ('', 
?,?,?,?,?,?,?)");
+       $insertHoliday->execute( $self->{branchcode}, 
$options{day},$options{month},$options{year}, $isexception, $options{title}, 
$options{description});
     $insertHoliday->finish;
 
     
$self->{'single_holidays'}->{"$options{year}/$options{month}/$options{day}"}{title}
 = $options{title};
@@ -336,8 +336,8 @@
 
     my $dbh = C4::Context->dbh();
     my $isexception = 1;
-    my $insertException = $dbh->prepare("insert into special_holidays 
(id,branchcode,day,month,year,isexception,title,description) values ('', 
'$self->{branchcode}', $options{day}, $options{month}, $options{year}, 
$isexception, '$options{title}', '$options{description}')");
-    $insertException->execute;
+    my $insertException = $dbh->prepare("insert into special_holidays 
(id,branchcode,day,month,year,isexception,title,description) values ('', 
?,?,?,?,?,?,?)");
+       $insertException->execute( $self->{branchcode}, 
$options{day},$options{month},$options{year}, $isexception, $options{title}, 
$options{description});
     $insertException->finish;
 
     
$self->{'exceptions_holidays'}->{"$options{year}/$options{month}/$options{day}"}{title}
 = $options{title};




reply via email to

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