]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_bonus.php
Filters for configurable userid exclusion added:
[mailer.git] / inc / modules / admin / what-config_bonus.php
index f2176b48664d1c9fc682a9cfa6205bfdecf9d2e7..fdbcd3cc1213c1ee84d08caf03bc6fe8f3f8a189 100644 (file)
@@ -16,8 +16,8 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * 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 *
  * it under the terms of the GNU General Public License as published by *
@@ -43,7 +43,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 // Add description as navigation point
 addYouAreHereLink('admin', __FILE__);
 
-if (isFormSent()) {
+if (isFormSent('save_config')) {
        // Replace german decimal comma with computer decimal dot
        convertCommaToDotInPostDataArray(array('login_bonus', 'turbo_bonus', 'bonus_ref', 'bonus_order', 'bonus_notify_points'));
 
@@ -51,15 +51,19 @@ if (isFormSent()) {
        setPostRequestElement('turbo_rates', '');
        $RATES = array();
        foreach (postRequestElement('rate') as $rate) {
+               // Convert German comma to dot
                $rate = trim(convertCommaToDot($rate));
-               if (!empty($rate)) $RATES[] = $rate;
+
+               if (!empty($rate)) {
+                       array_push($RATES, $rate);
+               } // END - if
        } // END - foreach
        setPostRequestElement('turbo_rates', trim(implode(';', $RATES)));
        unsetPostRequestElement('rate');
 
        // Automatically calculate bonus points for ranks 2 and 3 when not set
        if (!isPostRequestElementSet('turbo_rates')) {
-               setPostRequestElement('turbo_rates', ''.round(getConfig('turbo_bonus') / 2).';'.round(getConfig('turbo_bonus') / 4).'');
+               setPostRequestElement('turbo_rates', ''.round(getTurboBonus() / 2).';'.round(getTurboBonus() / 4).'');
        } // END - if
 
        // Save data
@@ -71,13 +75,13 @@ if (isFormSent()) {
        setConfigEntry('bonus_disable_notify', postRequestElement('bonus_disable_notify'));
 } else {
        // Transfer options to template
-       $content['bonus_userid'] = addMemberSelectionBox(getBonusUserid(), false, true, true, 'bonus_userid');
+       $content['bonus_userid'] = addMemberSelectionBox(getBonusUserid(), FALSE, TRUE, TRUE, 'bonus_userid');
 
        // Initialize array for the points list
        $RANKS = explode(';', getTurboRates());
 
        // Automatically calculate bonus points for ranks 2 and 3 when not set
-       if (getTurboRates() == '') $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4));
+       if (getTurboRates() == '') $RANKS = array(round(getTurboBonus() / 2), round(getTurboBonus() / 4));
 
        // Generate list
        $OUT = '<ol start="2">';
@@ -107,7 +111,7 @@ if (isFormSent()) {
        $content['wait_selection']          = createConfigurationTimeSelections('bonus_notify_wait', 'ms' );
 
        // Load final template
-       loadTemplate('admin_config_bonus', false, $content);
+       loadTemplate('admin_config_bonus', FALSE, $content);
 }
 
 // [EOF]