New naming convention applied to many functions, see #118 for details
[mailer.git] / inc / modules / admin / what-config_bonus.php
index 0a97e29a00966ebda2008f5b63d95f9734f97cf6..1f2ff3bac7eb7b7054c71794042aafbb3c97a3ce 100644 (file)
@@ -47,17 +47,17 @@ ADD_DESCR('admin', __FILE__);
 
 if (IS_FORM_SENT()) {
        // Replace german decimal commas to computer decimal dots
-       REQUEST_POST('login_bonus')         = REVERT_COMMA(REQUEST_POST('login_bonus')        );
-       REQUEST_POST('turbo_bonus')         = REVERT_COMMA(REQUEST_POST('turbo_bonus')        );
-       REQUEST_POST('bonus_ref')           = REVERT_COMMA(REQUEST_POST('bonus_ref')          );
-       REQUEST_POST('bonus_order')         = REVERT_COMMA(REQUEST_POST('bonus_order')        );
-       REQUEST_SET_POST('bonus_notify_points', REVERT_COMMA(REQUEST_POST('bonus_notify_points')));
+       REQUEST_POST('login_bonus')         = convertCommaToDot(REQUEST_POST('login_bonus')        );
+       REQUEST_POST('turbo_bonus')         = convertCommaToDot(REQUEST_POST('turbo_bonus')        );
+       REQUEST_POST('bonus_ref')           = convertCommaToDot(REQUEST_POST('bonus_ref')          );
+       REQUEST_POST('bonus_order')         = convertCommaToDot(REQUEST_POST('bonus_order')        );
+       REQUEST_SET_POST('bonus_notify_points', convertCommaToDot(REQUEST_POST('bonus_notify_points')));
 
        // Generate string for saving ranks
        REQUEST_SET_POST('turbo_rates', '');
        $RATES = array();
        foreach (REQUEST_POST('rate') as $rate) {
-               $rate = trim(REVERT_COMMA($rate));
+               $rate = trim(convertCommaToDot($rate));
                if (!empty($rate)) $RATES[] = $rate;
        }
        REQUEST_SET_POST('turbo_rates', trim(implode(';', $RATES)));
@@ -75,12 +75,12 @@ if (IS_FORM_SENT()) {
        setConfigEntry('bonus_di_notify', REQUEST_POST('bonus_di_notify'));
 } else {
        // Prepare contants for the template
-       define('__LOGIN_VALUE' , TRANSLATE_COMMA(getConfig('login_bonus')        , false));
-       define('__TURBO_VALUE' , TRANSLATE_COMMA(getConfig('turbo_bonus')        , false));
-       define('__ORDER_VALUE' , TRANSLATE_COMMA(getConfig('bonus_order')        , false));
-       define('__REF_VALUE'   , TRANSLATE_COMMA(getConfig('bonus_ref')          , false));
-       define('__STATS_VALUE' , TRANSLATE_COMMA(getConfig('bonus_stats')        , false));
-       define('__NOTIFY_VALUE', TRANSLATE_COMMA(getConfig('bonus_notify_points'), false));
+       define('__LOGIN_VALUE' , translateComma(getConfig('login_bonus')        , false));
+       define('__TURBO_VALUE' , translateComma(getConfig('turbo_bonus')        , false));
+       define('__ORDER_VALUE' , translateComma(getConfig('bonus_order')        , false));
+       define('__REF_VALUE'   , translateComma(getConfig('bonus_ref')          , false));
+       define('__STATS_VALUE' , translateComma(getConfig('bonus_stats')        , false));
+       define('__NOTIFY_VALUE', translateComma(getConfig('bonus_notify_points'), false));
        define('__TRANKS_VALUE', getConfig('bonus_ranks'));
        define('__TLINES_VALUE', getConfig('bonus_lines'));
 
@@ -92,7 +92,7 @@ if (IS_FORM_SENT()) {
        $RANKS = explode(';', getConfig('turbo_rates'));
 
        // Automatically calculate bonus points for ranks 2 and 3 when not set
-       if (getConfig('turbo_rates') == "") $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4));
+       if (getConfig('turbo_rates') == '') $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4));
 
        // Generate list
        $OUT = "<ol start=\"2\">\n";
@@ -115,9 +115,9 @@ if (IS_FORM_SENT()) {
        $OUT .= "</ol>\n";
        define('__TRATES_LIST', $OUT);
 
-       define('__LOGIN_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('login_timeout')    , "login_timeout"    , "WDh"));
-       define('__BONUS_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('bonus_timeout')    , "bonus_timeout"    , "WDh"));
-       define('__WAIT_SELECTION'         , CREATE_TIME_SELECTIONS(getConfig('bonus_notify_wait'), "bonus_notify_wait", "ms" ));
+       define('__LOGIN_TIMEOUT_SELECTION', createTimeSelections(getConfig('login_timeout')    , "login_timeout"    , "WDh"));
+       define('__BONUS_TIMEOUT_SELECTION', createTimeSelections(getConfig('bonus_timeout')    , "bonus_timeout"    , "WDh"));
+       define('__WAIT_SELECTION'         , createTimeSelections(getConfig('bonus_notify_wait'), "bonus_notify_wait", "ms" ));
 
        // Activate / Deactivate bonus active rallye (Y/N)
        switch (getConfig('bonus_active'))