<?php
/************************************************************************
- * MXChange v0.2.1 Start: 04/11/2004 *
- * ================ Last change: 11/15/2004 *
+ * Mailer v0.2.1-FINAL Start: 04/11/2004 *
+ * =================== Last change: 11/15/2004 *
* *
* -------------------------------------------------------------------- *
* File : ext-payout.php *
* $Date:: $ *
* $Tag:: 0.2.1-FINAL $ *
* $Author:: $ *
- * Needs to be in all Files and every File needs "svn propset *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * For more information visit: http://www.mxchange.org *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team *
+ * For more information visit: http://mxchange.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 *
// Some security stuff...
if (!defined('__SECURITY')) {
die();
-}
+} // END - if
// Version of this extension
setThisExtensionVersion('0.3.8');
-// Version history array (add more with , '0.1.0' and so on)
-setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8'));
+// Version history array (add more with , '0.0.1' and so on)
+setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8'));
switch (getExtensionMode()) {
- case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
+ case 'register': // Do stuff when installation is running
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_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`");
- 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?}");
+ addDropTableSql('user_payouts');
+ addCreateTableSql('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',
+PRIMARY KEY (`id`),
+INDEX (`userid`),
+INDEX (`payout_id`)",
+ 'Done user payouts (and status)');
+
+ addDropTableSql('payout_types');
+ addCreateTableSql('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`)",
+ 'Payout types');
+
+ // Admin menu
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);
+
+ // Member menu
+ addMemberMenuSql('main', 'payout', 'Auszahlungen', 11);
break;
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;
case 'activate': // Do stuff when admin activates this extension
// SQL commands to run
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='payout' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y',`locked`='N' WHERE `what`='payout' LIMIT 1");
break;
case 'deactivate': // Do stuff when admin deactivates this extension
// SQL commands to run
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='payout' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N',`locked`='Y' WHERE `what`='payout' LIMIT 1");
break;
case 'update': // Update an extension
- switch (getCurrentExtensionVersion())
- {
+ switch (getCurrentExtensionVersion()) {
case '0.1.2': // SQL queries for v0.1.2
addAdminMenuSql('payouts', NULL, 'Auszahlungsmanagement','Management der Auszahlungsarten.',8);
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `action`='payouts', `title`='Einstellungen' WHERE `action`='setup' AND `what`='config_payouts' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `action`='payouts',`title`='Einstellungen' WHERE `action`='setup' AND `what`='config_payouts' LIMIT 1");
break;
case '0.1.3': // SQL queries for v0.1.3
break;
case '0.1.6': // SQL queries for v0.1.6
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_payout_types` CHANGE pass_enc pass_enc ENUM('md5','base64','xxx') NOT NULL DEFAULT 'xxx'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_payout_types` CHANGE `pass_enc` `pass_enc` ENUM('md5','base64','xxx') NOT NULL DEFAULT 'xxx'");
break;
case '0.1.8': // SQL queries for v0.1.8
// Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Auflistung der Auszahlungen ausgelagert in Template <em>member_payout.tpl</em>.");
+ setExtensionUpdateNotes("Auflistung der Auszahlungen ausgelagert in Template <span class=\"bad\">member_payout.tpl</span>.");
break;
case '0.1.9': // SQL queries for v0.1.9
break;
case '0.2.1': // SQL queries for v0.2.1
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_payouts` CHANGE payout_total payout_total FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_payout_types` CHANGE rate rate FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_payouts` CHANGE `payout_total` `payout_total` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
+ addExtensionSql("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!)
setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
case '0.2.8': // SQL queries for v0.2.8
// Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Work-Arount-Lösung zu temporären Problemen mit der Task-ID eingebaut.");
+ setExtensionUpdateNotes("Work-Arount-Lösung zu temporären Problemen mit der Task-Id eingebaut.");
break;
case '0.2.9': // SQL queries for v0.2.9
break;
case '0.3.7': // SQL queries for v0.3.7
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET title = 'Auszahlungsmanagement' WHERE action = 'payouts' AND (`what`='' OR `what` IS NULL) LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Auszahlungsmanagement' WHERE `action`='payouts' AND (`what`='' OR `what` IS NULL) LIMIT 1");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Verwaltung nach Management umgestellt.");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
break;
- }
+ } // END - switch
break;
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
break;
default: // Unknown extension mode
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
+ logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
break;
-}
+} // END - switch
// [EOF]
?>