]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-bonus.php
mailer project continued:
[mailer.git] / inc / extensions / ext-bonus.php
index cf745843ecb5be7d5d951242a0a57d517a2d6270..c2ff1730f82836dd52b68b3733fc4fc96afcd1fc 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version of this extension
-setThisExtensionVersion('0.9.7');
+setThisExtensionVersion('0.9.9');
 
 // Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.1.6', '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', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9', '0.9.0', '0.9.1', '0.9.2', '0.9.3', '0.9.4', '0.9.5', '0.9.6', '0.9.7'));
+setExtensionVersionHistory(array('0.0.0', '0.1.6', '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', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9', '0.9.0', '0.9.1', '0.9.2', '0.9.3', '0.9.4', '0.9.5', '0.9.6', '0.9.7', '0.9.8', '0.9.9'));
 
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running
@@ -88,10 +88,15 @@ INDEX (`cat_id`)",
                addDropTableSql('bonus_customer');
                addDropTableSql('bonus_turbo');
 
+               // Unregister points data
+               unregisterExtensionPointsData('monthly_bonus');
+
                // Unregister filter
-               unregisterFilter(__FUNCTION__, __LINE__, 'member_login_check', 'ADD_LOGIN_BONUS', true, isExtensionDryRun());
-               unregisterFilter(__FUNCTION__, __LINE__, 'generate_admin_mail_links', 'GENERATE_BONUS_MAIL_LINKS', true, isExtensionDryRun());
-               unregisterFilter(__FUNCTION__, __LINE__, 'add_bonus_points_user_columns', 'ADD_BONUS_POINTS_USER_COLUMNS', true, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'member_login_check', 'ADD_LOGIN_BONUS', true, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'generate_admin_mail_links', 'GENERATE_BONUS_MAIL_LINKS', true, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'add_bonus_points_user_columns', 'ADD_BONUS_POINTS_USER_COLUMNS', true, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'BONUS_USER_REGISTRATION_ADD_SQL_COLUMNS', true, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'init', 'SEND_BONUS_NOTIFICATIONS', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
@@ -560,7 +565,7 @@ ORDER BY
 
                        case '0.9.0': // SQL queries for v0.9.0
                                // Register filter
-                               registerFilter('member_login_check', 'ADD_LOGIN_BONUS', false, true, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'member_login_check', 'ADD_LOGIN_BONUS', false, true, isExtensionDryRun());
 
                                // Update notes
                                setExtensionUpdateNotes("Filter hinzugefügt der den Login-Bonus aktualisiert (bzw. soll) (internes TODO).");
@@ -603,14 +608,15 @@ ORDER BY
 
                        case '0.9.5': // SQL queries for v0.9.5
                                // Register filter
-                               registerFilter('generate_admin_mail_links', 'GENERATE_BONUS_MAIL_LINKS', false, true, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'generate_admin_mail_links', 'GENERATE_BONUS_MAIL_LINKS', false, true, isExtensionDryRun());
 
                                // Update notes
                                setExtensionUpdateNotes("Filter zum Generieren von Admin-Links für Bonus-Mails hinzugefügt.");
                                break;
 
                        case '0.9.6': // SQL queries for v0.9.6
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`subject`,`column_name`,`locked_mode`,`payment_method`) VALUES ('monthly_bonus','points','LOCKED','DIRECT')");
+                               // Register points data
+                               registerExtensionPointsData('monthly_bonus', 'points', 'LOCKED', 'DIRECT');
 
                                // This depends on ext-sql_patches
                                addExtensionDependency('sql_patches');
@@ -627,11 +633,30 @@ ORDER BY
                                addConfigChangeSql('bonus_click_yn', 'include_bonus_click', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
 
                                // Register filter
-                               registerFilter('add_bonus_points_user_columns', 'ADD_BONUS_POINTS_USER_COLUMNS', false, true, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'add_bonus_points_user_columns', 'ADD_BONUS_POINTS_USER_COLUMNS', false, true, isExtensionDryRun());
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Konfigurationseinträge umbenannt.");
                                break;
+
+                       case '0.9.8': // SQL queries for v0.9.8
+                               // Register filter
+                               registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'BONUS_USER_REGISTRATION_ADD_SQL_COLUMNS', false, true, isExtensionDryRun());
+
+                               // Add dependency to ext-register
+                               addExtensionDependency('register');
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Filter zum Hinzufügen von SQL-Spalten bei der Mitgliederanmeldung.");
+                               break;
+
+                       case '0.9.9': // SQL queries for v0.9.9
+                               // Register filter
+                               registerFilter(__FILE__, __LINE__, 'init', 'SEND_BONUS_NOTIFICATIONS', false, true, isExtensionDryRun());
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Filter zum Hinzufügen von SQL-Spalten bei der Mitgliederanmeldung.");
+                               break;
                } // END - switch
                break;
 
@@ -642,11 +667,6 @@ ORDER BY
                break;
 
        case 'init': // Do stuff when extension is initialized
-               // Check for bonus rallye is active and send mails out
-               if ((isBonusRallyeActive()) && (isBonusNewMemberNotifyEnabled())) {
-                       // Include file for sending out mails
-                       addIncludeToPool('notify', 'inc/mails/bonus_mails.php');
-               } // END - if
                break;
 
        default: // Unknown extension mode