Bugzilla – Attachment 14058 Details for
Bug 8917
Track clicks to links external to Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8917 : Creating tables and system pref, no functional changes at all
Bug-8917--Creating-tables-and-system-pref-no-funct.patch (text/plain), 4.90 KB, created by
Chris Cormack
on 2012-12-12 20:27:41 UTC
(
hide
)
Description:
Bug 8917 : Creating tables and system pref, no functional changes at all
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2012-12-12 20:27:41 UTC
Size:
4.90 KB
patch
obsolete
>From 1351e063ca9fbc5f60bafd671897fb10d1e310fe Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chrisc@catalyst.net.nz> >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 | 19 +++++++++++++++++ > installer/data/mysql/sysprefs.sql | 2 ++ > 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 f68c9c7..b6cc666 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2977,6 +2977,25 @@ CREATE TABLE borrower_attribute_types_branches( -- association table between bor > FOREIGN KEY (b_branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE > ) 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 */; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 0cc5a54..837083d 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -388,3 +388,5 @@ INSERT INTO systempreferences (variable, value, options, explanation, type) VALU > 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('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo'); >+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 39e4bde..f912c4f 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6181,6 +6181,28 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > >+$DBversion = "3.11.00.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 2866f8d..390701a 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.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8917
:
12831
|
12832
|
12833
|
12834
|
12998
|
12999
|
13000
|
13001
|
14058
|
14059
|
14060
|
14061
|
15669
|
15670
|
15671
|
15672
|
15711
|
15712
|
15713
|
15714
|
15715
|
15716
|
15783
|
15784
|
15785
|
15786
|
15787
|
15812
|
15815
|
15818
|
15819
|
15820
|
15821
|
15822
|
15823
|
15824
|
15825
|
15850
|
15851
|
15852
|
15853
|
15854
|
15855
|
15856
|
15857
|
15858