[Koha-patches] [PATCH] Correcting class.labels_conf to be classification.labels_conf
Chris Nighswonger
cnighswonger at foundations.edu
Fri Apr 11 15:32:40 CEST 2008
---
C4/Labels.pm | 7 ++-----
installer/data/mysql/kohastructure.sql | 2 +-
installer/data/mysql/updatedatabase.pl | 7 +++++++
kohaversion.pl | 2 +-
4 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/C4/Labels.pm b/C4/Labels.pm
index 06d1ceb..6365c56 100644
--- a/C4/Labels.pm
+++ b/C4/Labels.pm
@@ -577,7 +577,7 @@ sub add_layout {
$sth2->execute();
$query2 = "INSERT INTO labels_conf
( barcodetype, title, subtitle, isbn,issn, itemtype, barcode,
- dewey, class, subclass, itemcallnumber, author, printingtype,
+ dewey, classification, subclass, itemcallnumber, author, printingtype,
guidebox, startlabel, layoutname, active )
values ( ?, ?, ?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?, ?,?,?, 1 )";
$sth2 = $dbh->prepare($query2);
@@ -609,7 +609,7 @@ sub save_layout {
my $dbh = C4::Context->dbh;
my $query2 = "update labels_conf set
barcodetype=?, title=?, subtitle=?, isbn=?,issn=?,
- itemtype=?, barcode=?, dewey=?, class=?,
+ itemtype=?, barcode=?, dewey=?, classification=?,
subclass=?, itemcallnumber=?, author=?, printingtype=?,
guidebox=?, startlabel=?, layoutname=? where id = ?";
my $sth2 = $dbh->prepare($query2);
@@ -920,9 +920,6 @@ sub DrawSpineText {
my ( $x_pos, $y_pos, $label_height, $label_width, $fontname, $fontsize, $left_text_margin,
$text_wrap_cols, $item, $conf_data, $printingtype, $nowrap ) = @_;
- # FIXME: we need to fix the column name mismatch betwen labels_conf.class, and bibitems.classification
- $$item->{'class'} = $$item->{'classification'};
-
# Replaced item's itemtype with the more user-friendly description...
my $dbh = C4::Context->dbh;
my %itemtypes;
diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index 2b18bb9..c87a170 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -1109,7 +1109,7 @@ CREATE TABLE `labels_conf` (
`itemtype` int(1) default '0',
`barcode` int(1) default '0',
`dewey` int(1) default '0',
- `class` int(1) default NULL,
+ `classification` int(1) default NULL,
`subclass` int(1) default '0',
`itemcallnumber` int(1) default '0',
`author` int(1) default '0',
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 240b37e..e8fedf1 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -1274,6 +1274,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
SetVersion ($DBversion);
}
+$DBversion = "3.00.00.069";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("ALTER TABLE labels_conf CHANGE COLUMN class classification int(1) DEFAULT NULL;");
+ print "Upgrade to $DBversion done ( Correcting columname in labels_conf )\n";
+ SetVersion ($DBversion);
+}
+
=item DropAllForeignKeys($table)
Drop all foreign keys of the table $table
diff --git a/kohaversion.pl b/kohaversion.pl
index 6a67751..3660838 100644
--- a/kohaversion.pl
+++ b/kohaversion.pl
@@ -10,7 +10,7 @@
use strict;
sub kohaversion {
- our $VERSION = "3.00.00.068";
+ our $VERSION = "3.00.00.069";
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install
--
1.5.3.7
More information about the Koha-patches
mailing list