From ac2da44b69397296266694267deffca3ac102068 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Thu, 7 Apr 2011 16:28:38 +0200 Subject: [PATCH] Bug 5431: Separate state field for library addresses Signed-off-by: Magnus Enger Signed-off-by: Chris Cormack --- C4/Branch.pm | 10 ++++++---- admin/branches.pl | 3 ++- installer/data/mysql/kohastructure.sql | 1 + installer/data/mysql/updatedatabase.pl | 6 ++++++ .../intranet-tmpl/prog/en/modules/admin/branches.tmpl | 6 ++++-- kohaversion.pl | 2 +- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/C4/Branch.pm b/C4/Branch.pm index 1f26e35240..817aa385f2 100644 --- a/C4/Branch.pm +++ b/C4/Branch.pm @@ -203,7 +203,7 @@ sub ModBranch { my $query = " INSERT INTO branches (branchcode,branchname,branchaddress1, - branchaddress2,branchaddress3,branchzip,branchcity, + branchaddress2,branchaddress3,branchzip,branchcity,branchstate, branchcountry,branchphone,branchfax,branchemail, branchurl,branchip,branchprinter,branchnotes) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) @@ -213,7 +213,8 @@ sub ModBranch { $data->{'branchcode'}, $data->{'branchname'}, $data->{'branchaddress1'}, $data->{'branchaddress2'}, $data->{'branchaddress3'}, $data->{'branchzip'}, - $data->{'branchcity'}, $data->{'branchcountry'}, + $data->{'branchcity'}, $data->{'branchstate'}, + $data->{'branchcountry'}, $data->{'branchphone'}, $data->{'branchfax'}, $data->{'branchemail'}, $data->{'branchurl'}, $data->{'branchip'}, $data->{'branchprinter'}, @@ -225,7 +226,7 @@ sub ModBranch { UPDATE branches SET branchname=?,branchaddress1=?, branchaddress2=?,branchaddress3=?,branchzip=?, - branchcity=?,branchcountry=?,branchphone=?, + branchcity=?,branchstate=?,branchcountry=?,branchphone=?, branchfax=?,branchemail=?,branchurl=?,branchip=?, branchprinter=?,branchnotes=? WHERE branchcode=? @@ -235,7 +236,8 @@ sub ModBranch { $data->{'branchname'}, $data->{'branchaddress1'}, $data->{'branchaddress2'}, $data->{'branchaddress3'}, $data->{'branchzip'}, - $data->{'branchcity'}, $data->{'branchcountry'}, + $data->{'branchcity'}, $data->{'branchstate'}, + $data->{'branchcountry'}, $data->{'branchphone'}, $data->{'branchfax'}, $data->{'branchemail'}, $data->{'branchurl'}, $data->{'branchip'}, $data->{'branchprinter'}, diff --git a/admin/branches.pl b/admin/branches.pl index f4bcf661ad..d8fa236fa0 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -343,7 +343,7 @@ sub branchinfotable { for my $field ( 'branchaddress1', 'branchaddress2', 'branchaddress3', 'branchzip', - 'branchcity', 'branchcountry', + 'branchcity', 'branchstate', 'branchcountry', 'branchphone', 'branchfax', 'branchemail', 'branchurl', 'branchip', 'branchprinter', 'branchnotes' @@ -402,6 +402,7 @@ sub _branch_to_template { branchaddress3 => $data->{'branchaddress3'}, branchzip => $data->{'branchzip'}, branchcity => $data->{'branchcity'}, + branchstate => $data->{'branchstate'}, branchcountry => $data->{'branchcountry'}, branchphone => $data->{'branchphone'}, branchfax => $data->{'branchfax'}, diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 8a17bace36..1122826519 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -345,6 +345,7 @@ CREATE TABLE `branches` ( `branchaddress3` mediumtext, `branchzip` varchar(25) default NULL, `branchcity` mediumtext, + `branchstate` mediumtext, `branchcountry` text, `branchphone` mediumtext, `branchfax` mediumtext, diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 668ebc6a89..2675de20a3 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4268,6 +4268,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do("ALTER TABLE deletedborrowers ADD `B_state` mediumtext AFTER B_city;"); $dbh->do("ALTER TABLE deletedborrowers ADD `altcontactstate` mediumtext AFTER altcontactaddress3;"); print "Upgrade to $DBversion done (Add state field to patron's addresses)\n"; +} + +$DBversion = '3.0X.XX.XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE branches ADD `branchstate` mediumtext AFTER `branchcity`;"); + print "Upgrade to $DBversion done (Add state to branch address)\n"; SetVersion ($DBversion); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl index 4b6e3f131b..f940dd91c7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl @@ -109,7 +109,8 @@
  • " />
  • " />
  • " />
  • -
  • " />
  • +
  • " />
  • +
  • " />
  • " />
  • " />
  • " />
  • @@ -211,7 +212,8 @@
    -
    +
    , +
    diff --git a/kohaversion.pl b/kohaversion.pl index 392e6da079..3ece202bb5 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts : use strict; sub kohaversion { - our $VERSION = '3.03.00.047'; + our $VERSION = '3.0X.XX.XXX'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5