X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions%2Fext-coupon.php;h=84ee50137cdeb35d1f3cf4c23f8fd319af5c9daa;hb=f28e0b7c670860b68420a2b78c0aa2cc3838a1c6;hp=a84c4b20ebe8884d5050df3388d07058456e387d;hpb=3f7f0051c91c54cb691303b9d49fb9cd1a7a4e8c;p=mailer.git diff --git a/inc/extensions/ext-coupon.php b/inc/extensions/ext-coupon.php index a84c4b20eb..84ee50137c 100644 --- a/inc/extensions/ext-coupon.php +++ b/inc/extensions/ext-coupon.php @@ -19,7 +19,7 @@ * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * 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 * @@ -43,10 +43,10 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.0.1'); +setThisExtensionVersion('0.0.3'); // Version history array (add more with , '0.1' and so on) -setExtensionVersionHistory(array('0.0.0', '0.0.1')); +setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3')); switch (getExtensionMode()) { case 'register': // Do stuff when installtion is running @@ -77,8 +77,8 @@ PRIMARY KEY (`id`)", `coupon_code` VARCHAR(30) NULL DEFAULT NULL, `cashed_on` TIMESTAMP NULL DEFAULT NULL, PRIMARY KEY (`id`), -UNIQUE KEY `coupon_user` (`coupon_id`,`userid`), -UNIQUE KEY (`coupon_code`)", +UNIQUE INDEX `coupon_user` (`coupon_id`,`userid`), +UNIQUE (`coupon_code`)", 'Coupon->user connection'); // Configuration entries @@ -114,16 +114,17 @@ UNIQUE KEY (`coupon_code`)", // 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()); 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 `action`='coupon' LIMIT 3"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y',`locked`='N' WHERE `action`='coupon' LIMIT 3"); 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 `action`='coupon' LIMIT 3"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N',`locked`='Y' WHERE `action`='coupon' LIMIT 3"); break; case 'update': // Update an extension @@ -138,11 +139,26 @@ UNIQUE KEY (`coupon_code`)", addExtensionDependency('order'); // Insert data in new table - addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`ext_name`,`column_name`,`locked_mode`,`payment_method`) VALUES('coupon','order_points','LOCKED','DIRECT')"); + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`subject`,`column_name`,`locked_mode`,`payment_method`) VALUES ('coupon_cashed','order_points','LOCKED','DIRECT')"); // Update notes (these will be set as task text!) setExtensionUpdateNotes(''); break; + + case '0.0.2': // SQL queries for v0.0.2 + // Update data in points_data table + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_points_data` SET `subject`='coupon_cashed' WHERE `subject`='coupon' LIMIT 1"); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes('Eintrag in {CONFIG_OPEN}_MYSQL_PREFIX{CONFIG_CLOSE}_points_data umbenannt.'); + break; + + case '0.0.3': // SQL queries for v0.0.3 + registerFilter('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.'); + break; } // END - switch break;