]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-payout.php
New wrapper functions introduced, some one-line parameter monsters killed:
[mailer.git] / inc / extensions / ext-payout.php
index c625724d4300ab2234818165d3f5624c18e73e91..8a1b8fb86987d741f37a9ed9f7b7acbbeb3385cf 100644 (file)
@@ -16,7 +16,7 @@
  * $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 *
@@ -49,28 +49,28 @@ setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
                // SQL commands to run
-               addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_payouts`');
+               addDropTableSql('user_payouts');
                addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_payouts` (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-payout_total FLOAT(22,3) UNSIGNED NOT NULL DEFAULT '0.000',
-target_account VARCHAR(255) NOT NULL DEFAULT '',
-target_bank VARCHAR(255) NOT NULL DEFAULT '',
-payout_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-payout_timestamp VARCHAR(10) NOT NULL DEFAULT 0,
-status ENUM('NEW','ACCEPTED','REJECTED') NOT NULL DEFAULT 'NEW',
-KEY (userid),
-KEY (payout_id),
-PRIMARY KEY (id)
-) TYPE={?_TABLE_TYPE?}");
-               addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_payout_types`');
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`payout_total` FLOAT(22,3) UNSIGNED NOT NULL DEFAULT '0.000',
+`target_account` VARCHAR(255) NOT NULL DEFAULT '',
+`target_bank` VARCHAR(255) NOT NULL DEFAULT '',
+`payout_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`payout_timestamp` VARCHAR(10) NOT NULL DEFAULT 0,
+`status` ENUM('NEW','ACCEPTED','REJECTED') NOT NULL DEFAULT 'NEW',
+INDEX (`userid`),
+INDEX (`payout_id`),
+PRIMARY KEY (`id`)
+) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
+               addDropTableSql('payout_types');
                addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_payout_types` (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-type VARCHAR(255) NOT NULL DEFAULT '',
-rate FLOAT(22,3) UNSIGNED NOT NULL DEFAULT '0.000',
-min_points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-PRIMARY KEY (id)
-) TYPE={?_TABLE_TYPE?}");
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`type` VARCHAR(255) NOT NULL DEFAULT '',
+`rate` FLOAT(22,3) UNSIGNED NOT NULL DEFAULT '0.000',
+`min_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+PRIMARY KEY (`id`)
+) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
                addAdminMenuSql('setup','config_payouts','Auszahlungen','Auszahlungsarten einstellen, neu anlegen oder löschen.',15);
                addAdminMenuSql('payouts','list_payouts','Anfragen auflisten','Listet alle Auszahlungsanfragen Ihrer Mitglieder auf.',16);
                addMemberMenuSql('main','payout','Auszahlungen','N','N',11);
@@ -78,8 +78,8 @@ PRIMARY KEY (id)
 
        case 'remove': // Do stuff when removing extension
                // SQL commands to run
-               addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_payouts`');
-               addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_payout_types`');
+               addDropTableSql('user_payouts');
+               addDropTableSql('payout_types');
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='payouts'");
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='payout'");
                break;
@@ -240,7 +240,7 @@ PRIMARY KEY (id)
        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