mailer project continued:
[mailer.git] / inc / modules / admin / what-config_points.php
index 11c547539044e670e291999fe8ed28110c8b8ba9..f444ac4459569a27946b6757f52a1b6dcfad68ec 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 *
@@ -119,14 +119,18 @@ if (isFormSent()) {
                                array('allow_direct_pay', 'ref_payout'),
                                array(postRequestElement('allow_direct_pay'), $REF)
                        );
-                       if ((getConfig('ref_payout') == '0') && (postRequestElement('ref_payout') > 0)) {
+                       if ((getRefPayout() == '0') && (postRequestElement('ref_payout') > 0)) {
                                // Update account's ref_payout for "must-confirm"
-                               addSql(sprintf("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=(%s - `mails_confirmed`)
+                               addSql(sprintf("UPDATE
+       `{?_MYSQL_PREFIX?}_user_data`
+SET
+       `ref_payout`=(%s - `mails_confirmed`)
 WHERE
        `mails_confirmed` < %s", $REF, $REF));
-                       } elseif ((getConfig('ref_payout') > 0) && (postRequestElement('ref_payout') == '0')) {
+                       } elseif ((getRefPayout() > 0) && (postRequestElement('ref_payout') == '0')) {
                                // Update account's ref_payout for "not-must-confirm"
                                addSql("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=0 WHERE `ref_payout` > 0");
+                               // @TODO Rewrite these two lines for new user_points columns (e.g. locked_order_points) with a filter
                                addSql("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `points`=`points`+`locked_points` WHERE `locked_points` > 0");
                                addSql("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `locked_points`=0 WHERE `locked_points` > 0");
                        }