From 5c5d24bc69d681914e50062f59a11508bba9a4ac Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 2 Oct 2014 10:11:32 -0400 Subject: [PATCH] Bug 13023: Nonpublic note for items should be mapped to a database column like itemnotes An item's public notes are mapped to a db column, but the librarian only notes are not. We need to map these so in the future we may display them in places other than the editor. Test Plan: 1) Create an item with a non-public note 2) Apply this patch 3) Run updatedatabase 4) Update your frameworks to map your nonpublic item note to items.itemnotes_nonpublic 5) Run misc/batchRebuildItemsTables.pl 6) Inspect the database, note that your non-public note is now in items.itemnotes_nonpublic Signed-off-by: Paola Rossi Signed-off-by: Brendan Gallagher Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/kohastructure.sql | 2 ++ installer/data/mysql/updatedatabase.pl | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index a74d81a5ea..85c0de5345 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -930,6 +930,7 @@ CREATE TABLE `deleteditems` ( `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (MARC21 952$5) `itemnotes` mediumtext, -- public notes on this item (MARC21 952$x) + `itemnotes_nonpublic` mediumtext default NULL, `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (MARC21 952$b) `paidfor` mediumtext, `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered @@ -1229,6 +1230,7 @@ CREATE TABLE `items` ( -- holdings/item information `reserves` smallint(6) default NULL, -- number of times this item has been placed on hold/reserved `restricted` tinyint(1) default NULL, -- authorized value defining use restrictions for this item (MARC21 952$5) `itemnotes` mediumtext, -- public notes on this item (MARC21 952$x) + `itemnotes_nonpublic` mediumtext default NULL, `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that is currently in possession item (MARC21 952$b) `paidfor` mediumtext, `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this item was last altered diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 42ccf9b868..7a2bd30c01 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -10142,6 +10142,14 @@ if(CheckVersion($DBversion)) { SetVersion($DBversion); } +$DBversion = '3.19.00.XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE items ADD COLUMN itemnotes_nonpublic MEDIUMTEXT AFTER itemnotes"); + $dbh->do("ALTER TABLE deleteditems ADD COLUMN itemnotes_nonpublic MEDIUMTEXT AFTER itemnotes"); + print "Upgrade to $DBversion done (Bug 4222: Nonpublic note not appearing in the staff client) Please check each of your frameworks to ensure your non-public item notes are mapped to items.itemnotes_nonpublic. After doing so please have your administrator run misc/batchRebuildItemsTables.pl )\n"; + SetVersion($DBversion); +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5