From bf27df172028023ea845591d91677ef0c5166c59 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 23 Feb 2015 16:39:08 +0100 Subject: [PATCH] [SIGNED-OFF] Bug 2806: Remove issuingbranch columns This column is not in used in the Koha code and could be removed. Test plan: Verify the branch is correctly displayed on the circulation history (members/readingrec.pl) and that both reports Most-cisulated items (cat_issues_top.pl) and Avg checkout (issues_avg_stats.pl) work as before. Signed-off-by: Bernardo Gonzalez Kriegel No problems found. Fixed wrong table name on updatedatabase.pl and a tab char. --- installer/data/mysql/kohastructure.sql | 4 ---- installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ .../prog/en/modules/members/readingrec.tt | 3 ++- .../prog/en/modules/reports/cat_issues_top.tt | 2 +- .../prog/en/modules/reports/issues_avg_stats.tt | 8 -------- members/readingrec.pl | 3 --- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 08ef9ee..93f5ffe 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1144,7 +1144,6 @@ CREATE TABLE `issues` ( -- information related to check outs or issues `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss) `branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out - `issuingbranch` varchar(18) default NULL, `returndate` datetime default NULL, -- date the item was returned, will be NULL until moved to old_issues `lastreneweddate` datetime default NULL, -- date the item was last renewed `return` varchar(4) default NULL, @@ -1156,7 +1155,6 @@ CREATE TABLE `issues` ( -- information related to check outs or issues KEY `issuesborridx` (`borrowernumber`), KEY `itemnumber_idx` (`itemnumber`), KEY `branchcode_idx` (`branchcode`), - KEY `issuingbranch_idx` (`issuingbranch`), KEY `bordate` (`borrowernumber`,`timestamp`), CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT `issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE RESTRICT ON UPDATE CASCADE @@ -1618,7 +1616,6 @@ CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd) `branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out - `issuingbranch` varchar(18) default NULL, `returndate` datetime default NULL, -- date the item was returned `lastreneweddate` datetime default NULL, -- date the item was last renewed `return` varchar(4) default NULL, @@ -1630,7 +1627,6 @@ CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r KEY `old_issuesborridx` (`borrowernumber`), KEY `old_issuesitemidx` (`itemnumber`), KEY `branchcode_idx` (`branchcode`), - KEY `issuingbranch_idx` (`issuingbranch`), KEY `old_bordate` (`borrowernumber`,`timestamp`), CONSTRAINT `old_issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL, diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 0ed56c6..cc8b843 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9793,6 +9793,18 @@ if(CheckVersion($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.19.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q| + ALTER TABLE issues DROP COLUMN issuingbranch + |); + $dbh->do(q| + ALTER TABLE old_issues DROP COLUMN issuingbranch + |); + print "Upgrade to $DBversion done (Bug 2806: Remove issuingbranch columns)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt index 773995a..df13a17 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt @@ -1,5 +1,6 @@ [% USE KohaDates %] [% USE Koha %] +[% USE Branches %] [% INCLUDE 'doc-head-open.inc' %] Circulation History for [% INCLUDE 'patron-title.inc' %] [% INCLUDE 'doc-head-close.inc' %] @@ -108,7 +109,7 @@ [% issue.issuedate | $KohaDates %] - [% issue.issuingbranch %] + [% Branches.GetName( issue.branchcode ) %] [% IF issue.date_due %] [% issue.date_due | $KohaDates %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt index c7e45bd..c76fba7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt @@ -152,7 +152,7 @@
  • - - [% IF ( hassort1 ) %] Sort1 diff --git a/members/readingrec.pl b/members/readingrec.pl index de2baec..7f6d271 100755 --- a/members/readingrec.pl +++ b/members/readingrec.pl @@ -74,9 +74,6 @@ if ( $borrowernumber eq C4::Context->preference('AnonymousPatron') ){ } my $branches = GetBranches(); -foreach my $issue ( @{$issues} ) { - $issue->{issuingbranch} = $branches->{ $issue->{branchcode} }->{branchname}; -} # barcode export if ( $op eq 'export_barcodes' ) { -- 1.7.9.5