Bug 6880- Reason for suggestions do not save
authorOwen Leonard <oleonard@myacpl.org>
Wed, 26 Oct 2011 18:17:52 +0000 (14:17 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 27 Dec 2011 16:14:38 +0000 (17:14 +0100)
The fix for Bug 1883 seems to have lacked the necessary
update to the database to add the "patronreason" column
to the suggestions table. This patch does so.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch adds database update and change to kohastructure.
After this patch is applied, the patron's reason for
making a suggestion (form in opac) is saved to the database
correctly. The reason is also shown in the detail view
of the suggestion.

This needs to be backported to 3.6

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl
kohaversion.pl

index a03bd23..5287d9f 100644 (file)
@@ -1863,7 +1863,8 @@ CREATE TABLE `suggestions` ( -- purchase suggestions
   `isbn` varchar(30) default NULL, -- isbn of the suggested item
   `mailoverseeing` smallint(1) default 0,
   `biblionumber` int(11) default NULL, -- foreign key linking the suggestion to the biblio table after the suggestion has been ordered
-  `reason` text, -- reason for making the suggestion
+  `reason` text, -- reason for accepting or rejecting the suggestion
+  `patronreason` text, -- reason for making the suggestion
    budgetid INT(11), -- foreign key linking the suggested budget to the aqbudgets table
    branchcode VARCHAR(10) default NULL, -- foreign key linking the suggested branch to the branches table
    collectiontitle text default NULL, -- collection name for the suggested item
index 0063a75..53d5bd7 100755 (executable)
@@ -4578,6 +4578,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.06.03.001";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("ALTER TABLE  `suggestions` ADD  `patronreason` TEXT NULL AFTER  `reason`");
+    print "Upgrade to $DBversion done (Add column to suggestions table to store patrons' reasons for submitting a suggestion. )\n";
+    SetVersion($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 DropAllForeignKeys($table)
index 29b43df..d89c677 100644 (file)
@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.06.02.001';
+    our $VERSION = '3.06.03.001';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install