Koha/installer/data/mysql/atomicupdate/local_cover_images.pl
Jared Camins-Esakov 587e2e920e Bug 1633: QA follow-up
* Show the "Upload images" button when OPACLocalCoverImages is enabled but
LocalCoverImages (i.e. local cover images on the staff client) is not
* Correct copyright and license comments in new files
* perltidy and replace tabs by four spaces

Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-24 11:16:10 +01:00

30 lines
1.4 KiB
Perl
Executable file

#! /usr/bin/perl
use strict;
use warnings;
use C4::Context;
my $dbh = C4::Context->dbh;
$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";