File: D:/web/itpartnership.net (cms)/modules/FeedbackForm/method.upgrade.php
<?php
#-------------------------------------------------------------------------
# Module: Feedback Form
# Version: 0.9.12, released 6 March 2006
#
# Copyright (c) 2006, Samuel Goldstein <sjg@cmsmodules.com>
# For Information, Support, Bug Reports, etc, please visit the
# CMS Made Simple tracker at http://dev.cmsmadesimple.org
#
#-------------------------------------------------------------------------
# CMS - CMS Made Simple is (c) 2006 by Ted Kulp (wishy@cmsmadesimple.org)
# This project's homepage is: http://www.cmsmadesimple.org
#
#-------------------------------------------------------------------------
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Or read it online: http://www.gnu.org/licenses/licenses.html#GPL
#
#-------------------------------------------------------------------------
$this->initialize();
$current_version = $oldversion;
$db = &$this->mod_globals->DBHandle;
$dict = NewDataDictionary($db);
$taboptarray = array('mysql' => 'TYPE=MyISAM');
switch($current_version)
{
case "0.1":
$sqlarray = $dict->AddColumnSQL($this->option_table_name, "kind C(30)");
$dict->ExecuteSQLArray($sqlarray);
$flds = "flock_id I KEY, flock T";
$sqlarray = $dict->CreateTableSQL($this->flock_table_name, $flds, $taboptarray);
$dict->ExecuteSQLArray($sqlarray);
$sql = "DELETE from ".$this->option_table_name;
$rs = $db->Execute($sql);
$sql = "DELETE from ".$this->field_table_name;
$rs = $db->Execute($sql);
$current_version = "0.2";
case "0.2":
$sqlarray = $dict->AddColumnSQL($this->config_table_name, "language C(50)");
$dict->ExecuteSQLArray($sqlarray);
$current_version = "0.3";
case "0.3":
$current_version = "0.4";
case "0.4":
$current_version = "0.5";
case "0.5":
$current_version = "0.6";
case "0.6":
$this->RemovePermission('Remove Feedback Forms', 'Remove Feedback Forms');
$current_version = "0.7";
case "0.7":
$sqlarray = $dict->AddColumnSQL($this->config_table_name, "use_css L");
$dict->ExecuteSQLArray($sqlarray);
$sqlarray = $dict->AddColumnSQL($this->config_table_name, "title_pos I");
$dict->ExecuteSQLArray($sqlarray);
$sqlarray = $dict->AddColumnSQL($this->config_table_name, "hide_errors I");
$dict->ExecuteSQLArray($sqlarray);
$sqlarray = $dict->AddColumnSQL($this->form_table_name, "css_class C(255)");
$dict->ExecuteSQLArray($sqlarray);
$sqlarray = $dict->AddColumnSQL($this->form_table_name, "required_field_symbol C(255)");
$dict->ExecuteSQLArray($sqlarray);
$sqlarray = $dict->AddColumnSQL($this->form_table_name, "next_button_text C(35)");
$dict->ExecuteSQLArray($sqlarray);
$sqlarray = $dict->AddColumnSQL($this->field_table_name, "css_class C(255)");
$dict->ExecuteSQLArray($sqlarray);
$sqlarray = $dict->AddColumnSQL($this->field_table_name, "required L");
$dict->ExecuteSQLArray($sqlarray);
$current_version = "0.8";
case "0.8":
$current_version = "0.9";
case "0.9":
$current_version = "0.9.5";
case "0.9.5":
$sqlarray = $dict->AddColumnSQL($this->config_table_name, "use_id_and_name L");
$dict->ExecuteSQLArray($sqlarray);
$current_version = "0.9.6";
case "0.9.6":
$sqlarray = $dict->AddColumnSQL($this->field_table_name, "show_label L");
$dict->ExecuteSQLArray($sqlarray);
$current_version = "0.9.7";
case "0.9.7":
$sql = "UPDATE ".$this->field_table_name. " SET show_label=1";
$rs = $db->Execute($sql);
$current_version = "0.9.8";
case "0.9.8":
$sql = "UPDATE ".$this->field_table_name. " SET show_label=0";
$rs = $db->Execute($sql);
$current_version = "0.9.9";
case "0.9.9":
$sqlarray = $dict->AlterColumnSQL($this->option_table_name, "value X");
$dict->ExecuteSQLArray($sqlarray);
$current_version = "0.9.10";
case "0.9.10":
}
$this->Audit( 0, $this->Lang('friendlyname'), $this->Lang('upgraded',$this->GetVersion()));
# vim:ts=4 sw=4 noet
?>