More fixes, menus are no longer set visible if extension is deactivated, thanks to...
[mailer.git] / inc / extensions / ext-payout.php
index fc56e138795ed8664dbeecee3bc7434c8e811369..c79b935663ff9fad7d0bcd2b3683b4ae89f1aaa3 100644 (file)
@@ -53,12 +53,12 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
        $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_payouts";
        $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_payouts (
 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
-payout_total DOUBLE(22,3) UNSIGNED NOT NULL DEFAULT '0.000',
+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',
+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),
@@ -68,8 +68,8 @@ PRIMARY KEY(id)
        $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_payout_types (
 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 type VARCHAR(255) NOT NULL DEFAULT '',
-rate DOUBLE(22,3) UNSIGNED NOT NULL DEFAULT '0.000',
-min_points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+rate FLOAT(22,3) UNSIGNED NOT NULL DEFAULT '0.000',
+min_points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 PRIMARY KEY(id)
 ) TYPE=MyISAM";
        $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_payouts','Auszahlungen','Auszahlungsarten einstellen, neu anlegen oder löschen.','15')";
@@ -92,7 +92,7 @@ case "activate": // Do stuff when admin activates this extension
 
 case "deactivate": // Do stuff when admin deactivates this extension
        // SQL commands to run
-       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='payout' LIMIT 1";
+       $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='N', locked='Y' WHERE what='payout' LIMIT 1";
        break;
 
 case "update": // Update an extension
@@ -143,8 +143,8 @@ case "update": // Update an extension
                break;
 
        case "0.2.1": // SQL queries for v0.2.1
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_payouts CHANGE payout_total payout_total DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payout_types CHANGE rate rate DOUBLE(22,5) NOT NULL DEFAULT '0.00000'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_payouts CHANGE payout_total payout_total FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_payout_types CHANGE rate rate FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
@@ -242,8 +242,5 @@ default: // Do stuff when extension is loaded
        break;
 }
 
-// Language file prefix
-$EXT_LANG_PREFIX = "payout";
-
 //
 ?>