From 13d58861f4db6150e310f01dbffacb43c78b02c8 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Mon, 15 Oct 2012 11:29:55 +1300 Subject: [PATCH] Bug 8917 : Creating tables and system pref, no functional changes at all --- installer/data/mysql/kohastructure.sql | 20 ++++++++++++++++++ installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 22 ++++++++++++++++++++ .../prog/en/modules/admin/preferences/opac.pref | 8 +++++++ 4 files changed, 51 insertions(+) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 29ee782..0f02a0d 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2936,6 +2936,26 @@ CREATE TABLE `quotes` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- +-- Table structure for table linktracker +-- This stores clicks to external links +-- + +DROP TABLE IF EXISTS linktracker; +CREATE TABLE linktracker ( + id int(11) NOT NULL AUTO_INCREMENT, -- primary key identifier + biblionumber int(11) DEFAULT NULL, -- biblionumber of the record the link is from + itemnumber int(11) DEFAULT NULL, -- itemnumber if applicable that the link was from + borrowernumber int(11) DEFAULT NULL, -- borrowernumber who clicked the link + url text, -- the link itself + timeclicked datetime DEFAULT NULL, -- the date and time the link was clicked + PRIMARY KEY (id), + KEY bibidx (biblionumber), + KEY itemidx (itemnumber), + KEY borridx (borrowernumber), + KEY dateidx (timeclicked) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index a4e4102..13ca754 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -386,3 +386,4 @@ INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidy INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'); INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('TrackClicks','0','Track links clicked',NULL,'Integer'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4759034..e7ca544 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6019,6 +6019,28 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("CREATE TABLE linktracker ( + id int(11) NOT NULL AUTO_INCREMENT, + biblionumber int(11) DEFAULT NULL, + itemnumber int(11) DEFAULT NULL, + borrowernumber int(11) DEFAULT NULL, + url text, + timeclicked datetime DEFAULT NULL, + PRIMARY KEY (id), + KEY bibidx (biblionumber), + KEY itemidx (itemnumber), + KEY borridx (borrowernumber), + KEY dateidx (timeclicked) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + $dbh->do(" + INSERT INTO systempreferences (variable,value,explanation,options,type) + VALUES('TrackClicks','0','Track links clicked',NULL,'Integer')"); + print "Upgrade to $DBversion done (Adds feature Bug 8917, the ability to track links clicked)"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 1a9fa09..cc3efda 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -498,6 +498,14 @@ OPAC: - pref: AnonymousPatron class: integer - as the Anonymous Patron (for anonymous suggestions and reading history) + - + - pref: TrackClicks + default: 0 + choices: + anonymous: "Track anonymously" + track: "Track" + no: "Don't track" + - links that patrons click on Shelf Browser: - -- 1.7.9.5