From cc81a70e953828ae913b473b6ce2cfd2d03b6c44 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 17 Aug 2012 08:28:16 -0400 Subject: [PATCH] Bug 8215 - Add Course Reserves - Followup - Fix DB Updater & Makefile --- Makefile.PL | 1 + installer/data/mysql/updatedatabase.pl | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 46a3524..3e78aa5 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -261,6 +261,7 @@ my $target_map = { './changelanguage.pl' => 'INTRANET_CGI_DIR', './check_sysprefs.pl' => 'NONE', './circ' => 'INTRANET_CGI_DIR', + './course_reserves' => 'INTRANET_CGI_DIR', './offline_circ' => 'INTRANET_CGI_DIR', './edithelp.pl' => 'INTRANET_CGI_DIR', './etc' => { target => 'KOHA_CONF_DIR', trimdir => -1 }, diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 9e4b142..858495d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5632,10 +5632,12 @@ if(C4::Context->preference("Version") < TransformToNum($DBversion) ) { print "NOTE: The URL of your remote opac css file has been moved to preference opaclayoutstylesheet.\n"; } print "Upgrade to $DBversion done (BZ 8263: Make OPAC stylesheet preferences more consistent)\n"; -$DBversion = "3.07.00.XXX"; + SetVersion($DBversion); +} +$DBversion = "3.09.00.XXX"; if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { - $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo'"); + $dbh->do("INSERT INTO `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('UseCourseReserves', '0', NULL, 'Enable the course reserves feature.', 'YesNo')"); $dbh->do("INSERT INTO userflags (bit,flag,flagdesc,defaulton) VALUES ('18','coursereserves','Course Reserves','0')"); $dbh->do(" CREATE TABLE `courses` ( @@ -5652,14 +5654,18 @@ CREATE TABLE `courses` ( `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`course_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +"); +$dbh->do(" CREATE TABLE `course_instructors` ( `course_id` int(11) NOT NULL, `borrowernumber` int(11) NOT NULL, PRIMARY KEY (`course_id`,`borrowernumber`), KEY `borrowernumber` (`borrowernumber`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +"); +$dbh->do(" CREATE TABLE `course_items` ( `ci_id` int(11) NOT NULL AUTO_INCREMENT, `itemnumber` int(11) NOT NULL, @@ -5672,7 +5678,9 @@ CREATE TABLE `course_items` ( PRIMARY KEY (`ci_id`), UNIQUE KEY `itemnumber` (`itemnumber`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +"); +$dbh->do(" CREATE TABLE `course_reserves` ( `cr_id` int(11) NOT NULL AUTO_INCREMENT, `course_id` int(11) NOT NULL, @@ -5684,13 +5692,14 @@ CREATE TABLE `course_reserves` ( UNIQUE KEY `psuedo_key` (`course_id`,`ci_id`), KEY `course_id` (`course_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +"); +$dbh->do(" INSERT INTO permissions (module_bit, code, description) VALUES (18, 'manage_courses', 'Add, edit and delete courses'), (18, 'add_reserves', 'Add course reserves'), (18, 'delete_reserves', 'Remove course reserves') ; - "); print "Upgrade to $DBversion done (Add Course Reserves ( system preference UseCourseReserves ))\n"; -- 1.7.2.5