From dfc5c181bc6f0a800eec47180d8807fb114d2081 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Wed, 26 Dec 2007 18:35:13 -0600 Subject: [PATCH] Big bugfix for bug 1631 Signed-off-by: Joshua Ferraro --- C4/Members.pm | 9 ++- installer/data/mysql/kohastructure.sql | 7 ++ installer/data/mysql/updatedatabase.pl | 13 ++++ .../en/modules/members/memberentrygen.tmpl | 76 +++++++++++++++++++ .../prog/en/modules/members/moremember.tmpl | 13 +++- kohaversion.pl | 2 +- 6 files changed, 117 insertions(+), 3 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index c9ebc8b0a9..9c60562ab2 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -717,7 +717,14 @@ sub AddMember { . ",lost=" . $dbh->quote( $data{'lost'} ) . ",debarred=" . $dbh->quote( $data{'debarred'} ) . ",ethnicity=" . $dbh->quote( $data{'ethnicity'} ) - . ",ethnotes=" . $dbh->quote( $data{'ethnotes'} ) ; + . ",ethnotes=" . $dbh->quote( $data{'ethnotes'} ) + . ",altcontactsurname=" . $dbh->quote( $data{'altcontactsurname'} ) + . ",altcontactfirstname=" . $dbh->quote( $data{'altcontactfirstname'} ) + . ",altcontactaddress1=" . $dbh->quote( $data{'altcontactaddress1'} ) + . ",altcontactaddress2=" . $dbh->quote( $data{'altcontactaddress2'} ) + . ",altcontactaddress3=" . $dbh->quote( $data{'altcontactaddress3'} ) + . ",altcontactzipcode=" . $dbh->quote( $data{'altcontactzipcode'} ) + . ",altcontactphone=" . $dbh->quote( $data{'altcontactphone'} ) ; $debug and print STDERR "AddMember SQL: ($query)\n"; my $sth = $dbh->prepare($query); # print "Executing SQL: $query\n"; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index e35ffe64ec..277ee7cc0d 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -477,6 +477,13 @@ CREATE TABLE `borrowers` ( `contactnote` varchar(255) default NULL, `sort1` varchar(80) default NULL, `sort2` varchar(80) default NULL, + `altcontactfirstname` varchar(255) default NULL, + `altcontactsurname` varchar(255) default NULL, + `altcontactaddress1` varchar(255) default NULL, + `altcontactaddress2` varchar(255) default NULL, + `altcontactaddress3` varchar(255) default NULL, + `altcontactzipcode` varchar(50) default NULL, + `althcontactphone` varchar(50) default NULL, UNIQUE KEY `cardnumber` (`cardnumber`), PRIMARY KEY `borrowernumber` (`borrowernumber`), KEY `categorycode` (`categorycode`), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index fc61b4f31c..ca5a427a71 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -782,6 +782,19 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.00.00.037"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactfirstname` varchar(255)"); + $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactsurname` varchar(255)"); + $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactaddress1` varchar(255)"); + $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactaddress2` varchar(255)"); + $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactaddress3` varchar(255)"); + $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactzipcode` varchar(50)"); + $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactphone` varchar(50)"); + print "Upgrade to $DBversion done (Adding Alternative Contact Person information to borrowers table)\n"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl index d7ab91d34c..a3fe012693 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl @@ -452,6 +452,82 @@ patron +