Correcting class.labels_conf to be classification.labels_conf
authorChris Nighswonger <cnighswonger@foundations.edu>
Fri, 11 Apr 2008 13:32:40 +0000 (09:32 -0400)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 11 Apr 2008 21:56:31 +0000 (16:56 -0500)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Labels.pm
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl
kohaversion.pl

index 06d1ceb..6365c56 100644 (file)
@@ -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;
index 2b18bb9..c87a170 100644 (file)
@@ -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',
index 240b37e..e8fedf1 100755 (executable)
@@ -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
index 6a67751..3660838 100644 (file)
@@ -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