Bugzilla – Attachment 61614 Details for
Bug 17762
Ability to translate notices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17762: DB changes - Add new 'lang' columns to letter and borrowers tables
Bug-17762-DB-changes---Add-new-lang-columns-to-let.patch (text/plain), 4.07 KB, created by
Jonathan Druart
on 2017-03-24 16:30:22 UTC
(
hide
)
Description:
Bug 17762: DB changes - Add new 'lang' columns to letter and borrowers tables
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-03-24 16:30:22 UTC
Size:
4.07 KB
patch
obsolete
>From 1f0821b68be37eb84b5579e987c014d92abd8c42 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 8 Dec 2016 10:16:29 +0000 >Subject: [PATCH] Bug 17762: DB changes - Add new 'lang' columns to letter and > borrowers tables > >Sponsored-by: Orex Digital > >Signed-off-by: Hugo Agud <hagud@orex.es> >--- > installer/data/mysql/atomicupdate/bug_xxxxx.perl | 15 +++++++++++++++ > installer/data/mysql/kohastructure.sql | 3 +++ > 2 files changed, 18 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_xxxxx.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_xxxxx.perl b/installer/data/mysql/atomicupdate/bug_xxxxx.perl >new file mode 100644 >index 0000000..b2e32ae >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_xxxxx.perl >@@ -0,0 +1,15 @@ >+$DBversion = 'XXX'; >+if( CheckVersion( $DBversion ) ) { >+ >+ if( !column_exists( 'letter', 'lang' ) ) { >+ $dbh->do( "ALTER TABLE letter ADD COLUMN lang VARCHAR(25) NOT NULL DEFAULT 'default' AFTER message_transport_type" ); >+ } >+ >+ if( !column_exists( 'borrowers', 'lang' ) ) { >+ $dbh->do( "ALTER TABLE borrowers ADD COLUMN lang VARCHAR(25) NOT NULL DEFAULT 'default' AFTER lastseen" ); >+ $dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN lang VARCHAR(25) NOT NULL DEFAULT 'default' AFTER lastseen" ); >+ } >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug XXXXX - Add columns letter.lang and borrowers.lang to allow translation of notices)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 40f0d88..d32e226 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -631,6 +631,7 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower > `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit'. > `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others) > `lastseen` datetime default NULL, -- last time a patron has been seed (connected at the OPAC or staff interface) >+ `lang` varchar(25) NOT NULL default 'default', -- lang to use to send notices to this patron > `overdrive_auth_token` text default NULL, -- persist OverDrive auth token > KEY borrowernumber (borrowernumber), > KEY `cardnumber` (`cardnumber`), >@@ -1657,6 +1658,7 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons > `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit'. > `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others) > `lastseen` datetime default NULL, -- last time a patron has been seed (connected at the OPAC or staff interface) >+ `lang` varchar(25) NOT NULL default 'default', -- lang to use to send notices to this patron > `overdrive_auth_token` text default NULL, -- persist OverDrive auth token > UNIQUE KEY `cardnumber` (`cardnumber`), > PRIMARY KEY `borrowernumber` (`borrowernumber`), >@@ -2530,6 +2532,7 @@ CREATE TABLE `letter` ( -- table for all notice templates in Koha > `title` varchar(200) NOT NULL default '', -- subject line of the notice > `content` text, -- body text for the notice or slip > `message_transport_type` varchar(20) NOT NULL DEFAULT 'email', -- transport type for this notice >+ `lang` varchar(25) NOT NULL DEFAULT 'default', -- lang of the notice > PRIMARY KEY (`module`,`code`, `branchcode`, `message_transport_type`), > CONSTRAINT `message_transport_type_fk` FOREIGN KEY (`message_transport_type`) > REFERENCES `message_transport_types` (`message_transport_type`) ON DELETE CASCADE ON UPDATE CASCADE >-- >2.9.3
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 17762
:
58133
|
58134
|
58135
|
58136
|
58137
|
58138
|
58139
|
58140
|
58141
|
58525
|
59452
|
59453
|
59454
|
59455
|
59456
|
59457
|
59458
|
59459
|
59460
|
59461
|
61614
|
61615
|
61616
|
61617
|
61618
|
61619
|
61620
|
61621
|
61622
|
61623
|
61624
|
63199
|
63200
|
63201
|
63202
|
63203
|
63204
|
63205
|
63206
|
63207
|
63208
|
63209
|
63210
|
63211