mailer project continued:
[mailer.git] / inc / extensions / ext-coupon.php
index 84ee50137cdeb35d1f3cf4c23f8fd319af5c9daa..4a90ed792057d8c8bf4a07332aefcb126e7765c0 100644 (file)
@@ -18,7 +18,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 *
@@ -102,7 +102,7 @@ UNIQUE (`coupon_code`)",
                addMemberMenuSql('coupon', 'list_coupon', 'Eingelöste auflisten', 2);
 
                // Add filter (for changing user_points column dynamically
-               registerFilter('determine_points_column_name', 'COUPON_CHANGE_POINTS_COLUMN_NAME', false, true, isExtensionDryRun());
+               registerFilter(__FILE__, __LINE__, 'determine_points_column_name', 'COUPON_CHANGE_POINTS_COLUMN_NAME', false, true, isExtensionDryRun());
                break;
 
        case 'remove': // Do stuff when removing extension
@@ -112,9 +112,12 @@ UNIQUE (`coupon_code`)",
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='coupon' LIMIT 4");
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='coupon' LIMIT 3");
 
+               // Remove points data
+               unregisterExtensionPointsData('coupon_cashed');
+
                // Remove all filters
-               unregisterFilter(__FUNCTION__, __LINE__, 'determine_points_column_name', 'COUPON_CHANGE_POINTS_COLUMN_NAME', true, isExtensionDryRun());
-               unregisterFilter(__FUNCTION__, __LINE__, 'post_cash_coupon', 'POST_CASH_COUPON', true, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'determine_points_column_name', 'COUPON_CHANGE_POINTS_COLUMN_NAME', true, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'post_cash_coupon', 'POST_CASH_COUPON', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
@@ -139,7 +142,7 @@ UNIQUE (`coupon_code`)",
                                addExtensionDependency('order');
 
                                // Insert data in new table
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`subject`,`column_name`,`locked_mode`,`payment_method`) VALUES ('coupon_cashed','order_points','LOCKED','DIRECT')");
+                               registerExtensionPointsData('coupon_cashed', 'order_points', 'LOCKED', 'DIRECT');
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes('');
@@ -154,7 +157,7 @@ UNIQUE (`coupon_code`)",
                                break;
 
                        case '0.0.3': // SQL queries for v0.0.3
-                               registerFilter('post_cash_coupon', 'POST_CASH_COUPON', false, true, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'post_cash_coupon', 'POST_CASH_COUPON', false, true, isExtensionDryRun());
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes('Filter zum Post- und Pre-Filter hinzugefügt.');