Skip to content

Commit d53f2f8

Browse files
committed
2.0.2
1 parent 28b7bd2 commit d53f2f8

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

code/Module.class.php

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class Module extends FormToolsModule
1616
protected $author = "Ben Keen";
1717
protected $authorEmail = "[email protected]";
1818
protected $authorLink = "https://formtools.org";
19-
protected $version = "2.0.1";
20-
protected $date = "2018-02-17";
19+
protected $version = "2.0.2";
20+
protected $date = "2018-02-24";
2121
protected $originLanguage = "en_us";
2222
protected $cssFiles = array("{MODULEROOT}/css/styles.css");
2323

@@ -135,33 +135,29 @@ public function clearTables()
135135
}
136136

137137

138-
public function upgrade($old_version_info, $new_version_info)
138+
public function upgrade($module_id, $old_module_version)
139139
{
140140
$db = Core::$db;
141141

142-
$old_version_date = date("Ymd", General::convertDatetimeToTimestamp($old_version_info["module_date"]));
143-
144-
if ($old_version_date < 20091121) {
145-
$db->query("
146-
CREATE TABLE IF NOT EXISTS {PREFIX}module_submission_accounts_view_override (
147-
override_id mediumint(8) unsigned NOT NULL auto_increment,
148-
form_id mediumint(8) unsigned NOT NULL,
149-
field_id mediumint(9) NOT NULL,
150-
match_values varchar(255) NOT NULL,
151-
view_id mediumint(8) unsigned NOT NULL,
152-
process_order smallint(5) unsigned NOT NULL,
153-
PRIMARY KEY (override_id)
154-
) DEFAULT CHARSET=utf8
155-
");
156-
$db->execute();
157-
}
142+
$db->query("
143+
CREATE TABLE IF NOT EXISTS {PREFIX}module_submission_accounts_view_override (
144+
override_id mediumint(8) unsigned NOT NULL auto_increment,
145+
form_id mediumint(8) unsigned NOT NULL,
146+
field_id mediumint(9) NOT NULL,
147+
match_values varchar(255) NOT NULL,
148+
view_id mediumint(8) unsigned NOT NULL,
149+
process_order smallint(5) unsigned NOT NULL,
150+
PRIMARY KEY (override_id)
151+
) DEFAULT CHARSET=utf8
152+
");
153+
$db->execute();
158154

159155
if (!self::checkColumnExists("module_submission_accounts", "swatch")) {
160156
$db->query("ALTER TABLE {PREFIX}module_submission_accounts ADD swatch VARCHAR(255) NULL AFTER theme");
161157
$db->execute();
162158
}
163159

164-
if ($old_version_date < 20110930) {
160+
if (General::isVersionEarlierThan($old_module_version, "1.1.4")) {
165161
$db->query("UPDATE {PREFIX}module_submission_accounts SET swatch = 'green' WHERE theme = 'default'");
166162
$db->execute();
167163
}

0 commit comments

Comments
 (0)