* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009, 2010 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
} // END - if
// Version number
-setThisExtensionVersion('0.0');
+setThisExtensionVersion('0.0.0');
-// Version history array (add more with , '0.1.0' and so on)
-setExtensionVersionHistory(array('0.0'));
+// Version history array (add more with , '0.0.1' and so on)
+setExtensionVersionHistory(array('0.0.0'));
// This extension is in development (non-productive)
enableExtensionProductive(false);
switch (getExtensionMode()) {
- case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
- // SQL commands to run
+ case 'register': // Do stuff when installation is running
+ // General and grade level data
+ addDropTableSql('grade_data');
+ addCreateTableSql('grade_data', "(
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`grade_name` VARCHAR(255) NOT NULL DEFAULT '',
+`grade_parent_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
+PRIMARY KEY (`id`),
+INDEX (`grade_parent_id`)
+) TYPE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Grade general data'");
+
+ // Data for if a grade level has been reached
+ addDropTableSql('grade_cash_data');
+ addCreateTableSql('grade_cash_data', "(
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`grade_cash_name` VARCHAR(255) NOT NULL DEFAULT '',
+`grade_cash_type` ENUM('DISCOUNT','BONUS') NOT NULL DEFAULT 'DISCOUNT',
+`reached_points` FLOAT(20,5) UNSIGNED NULL DEFAULT NULL,
+`reached_mails` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
+`time_valid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+PRIMARY KEY (`id`),
+) TYPE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Grade data if the grade have been \"cashed\"'");
+
+ // Connection grade<->cash data
+ addDropTableSql('grade_cash_connect');
+ addCreateTableSql('grade_cash_conenct', "(
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`grade_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`grade_cash_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+PRIMARY KEY (`id`),
+UNIQUE KEY `grade_cash` (`grade_id`,`grade_cash_id`),
+INDEX (`grade_cash_id`)
+) TYPE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Grade<->cash data connection'");
+
+ // Connection grade<->user data
+ addDropTableSql('grade_user_connect');
+ addCreateTableSql('grade_user_connect', "(
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`grade_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`grade_expired TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
+PRIMARY KEY (`id`),
+UNIQUE KEY (`userid`,`grade_id`),
+INDEX (`grade_id`)
+) TYPE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Grade<->user connection'");
break;
case 'remove': // Do stuff when removing extension
// SQL commands to run
+ addDropTableSql('grade_data');
+ addDropTableSql('grade_cash_data');
+ addDropTableSql('grade_cash_connect');
+ addDropTableSql('grade_user_connect');
break;
case 'activate': // Do stuff when admin activates this extension
case 'modify': // When the extension got modified
break;
- case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+ case 'test': // For testing purposes
break;
case 'init': // Do stuff when extension is initialized