Bug 1633 localcoverimages, updatedatabase & kohaversion for pushing
authorPaul Poulain <paul.poulain@biblibre.com>
Tue, 24 Jan 2012 11:00:37 +0000 (12:00 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 24 Jan 2012 11:00:37 +0000 (12:00 +0100)
installer/data/mysql/updatedatabase.pl
kohaversion.pl

index b12196c..0982282 100755 (executable)
@@ -4626,6 +4626,34 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.07.00.010";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do(
+        q|CREATE TABLE `biblioimages` (
+          `imagenumber` int(11) NOT NULL AUTO_INCREMENT,
+          `biblionumber` int(11) NOT NULL,
+          `mimetype` varchar(15) NOT NULL,
+          `imagefile` mediumblob NOT NULL,
+          `thumbnail` mediumblob NOT NULL,
+          PRIMARY KEY (`imagenumber`),
+          CONSTRAINT `bibliocoverimage_fk1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
+          ) ENGINE=InnoDB DEFAULT CHARSET=utf8|
+    );
+    $dbh->do(
+        q|INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACLocalCoverImages','0','Display local cover images on OPAC search and details pages.','1','YesNo')|
+        );
+    $dbh->do(
+        q|INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('LocalCoverImages','0','Display local cover images on intranet search and details pages.','1','YesNo')|
+        );
+    $dbh->do(
+        q|INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowMultipleCovers','0','Allow multiple cover images to be attached to each bibliographic record.','1','YesNo')|
+    );
+    $dbh->do(
+        q|INSERT INTO permissions (module_bit, code, description) VALUES (13, 'upload_local_cover_images', 'Upload local cover images')|
+    );
+    print "Upgrade done (Added support for local cover images)\n";
+    SetVersion($DBversion);
+}
 =head1 FUNCTIONS
 
 =head2 DropAllForeignKeys($table)
index e0e6e87..a73324e 100644 (file)
@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.07.00.009';
+    our $VERSION = '3.07.00.010';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install