@@ -, +, @@ display in OPAC. --- .../data/mysql/en/mandatory/userpermissions.sql | 1 + installer/data/mysql/kohastructure.sql | 13 + installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 16 + .../intranet-tmpl/prog/en/includes/tools-menu.inc | 3 + .../admin/preferences/enhanced_content.pref | 7 + .../prog/en/modules/tools/tools-home.tt | 5 + .../prog/en/modules/tools/upload-cover-image.tt | 126 +++++++ koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 1 + .../opac-tmpl/prog/en/modules/opac-results.tt | 1 + opac/opac-coverimage.pl | 105 ++++++ opac/opac-detail.pl | 5 + opac/opac-search.pl | 4 + tools/upload-cover-image.pl | 341 ++++++++++++++++++++ 14 files changed, 629 insertions(+), 1 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-cover-image.tt create mode 100755 opac/opac-coverimage.pl create mode 100755 tools/upload-cover-image.pl --- a/installer/data/mysql/en/mandatory/userpermissions.sql +++ a/installer/data/mysql/en/mandatory/userpermissions.sql @@ -36,6 +36,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES (13, 'manage_csv_profiles', 'Manage CSV export profiles'), (13, 'moderate_tags', 'Moderate patron tags'), (13, 'rotating_collections', 'Manage rotating collections'), + (13, 'upload_local_cover_images', 'Upload local cover images'), (15, 'check_expiration', 'Check the expiration of a serial'), (15, 'claim_serials', 'Claim missing serials'), (15, 'create_subscription', 'Create a new subscription'), --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -2665,6 +2665,19 @@ CREATE TABLE `fieldmapping` ( -- koha to keyword mapping PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- +-- Table structure for table `bibliocoverimage` +-- + +DROP TABLE IF EXISTS `bibliocoverimage`; + +CREATE TABLE `bibliocoverimage` ( + `biblionumber` int(11) NOT NULL, + `mimetype` varchar(15) NOT NULL, + `imagefile` mediumblob NOT NULL, + PRIMARY KEY (`biblionumber`), + CONSTRAINT `bibliocoverimage_fk1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -328,4 +328,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo'); - +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACLocalCoverImages','0','Display local cover images on OPAC search and details pages.','1','YesNo'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -4550,6 +4550,22 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.06.00.XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do( q|CREATE TABLE `bibliocoverimage` ( + `biblionumber` int(11) NOT NULL, + `mimetype` varchar(15) NOT NULL, + `imagefile` mediumblob NOT NULL, + PRIMARY KEY (`biblionumber`), + 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 mages on OPAC search and details pages.','1','YesNo')|); + $dbh->do( q|INSERT INTO permissions (module_bit, code, description) VALUES (13, 'upload_local_cover_images', 'Upload local cover images')|); + print "Upgrade to $DBversion done (Added bibliocoverimage table to stover local cover images)\n"; + SetVersion ($DBversion); +} + + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc @@ -70,6 +70,9 @@ [% IF ( CAN_user_tools_manage_staged_marc ) %]
  • Staged MARC management
  • [% END %] + [% IF ( CAN_user_tools_upload_local_cover_images ) %] +
  • Upload Local Cover Image
  • + [% END %]
    Additional Tools