]> git.mxchange.org Git - mailer.git/commitdiff
Wrapper functions for converting commas in configuration added, ext-coupon continued
authorRoland Häder <roland@mxchange.org>
Sat, 25 Jun 2011 22:58:21 +0000 (22:58 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 25 Jun 2011 22:58:21 +0000 (22:58 +0000)
- First configuration template and script for ext-coupon added
- Wrapper functions convertCommaToDotInPostData() and convertCommaToDotInPostDataArray()
  introduced which will wrap converting German comma into Computer's version
- TODOs.txt updated

17 files changed:
.gitattributes
DOCS/TODOs.txt
inc/extensions/ext-coupon.php
inc/functions.php
inc/language/coupon_de.php [new file with mode: 0644]
inc/libs/coupon_functions.php [new file with mode: 0644]
inc/modules/admin/action-coupon.php [new file with mode: 0644]
inc/modules/admin/what-config_beg.php
inc/modules/admin/what-config_bonus.php
inc/modules/admin/what-config_coupon.php [new file with mode: 0644]
inc/modules/admin/what-config_doubler.php
inc/modules/admin/what-config_payouts.php
inc/modules/admin/what-config_refback.php
inc/modules/admin/what-config_surfbar.php
inc/wrapper-functions.php
templates/de/html/admin/admin_config_ [new file with mode: 0644]
templates/de/html/admin/admin_config_coupon.tpl [new file with mode: 0644]

index 75d40c21fe4bbaca594bc871d27cafd7fb65db02..527b1834db91b2311171e388cfe0bbd5ae451391 100644 (file)
@@ -260,6 +260,7 @@ inc/language/bonus_de.php svneol=native#text/plain
 inc/language/booking_de.php svneol=native#text/plain
 inc/language/cache_de.php svneol=native#text/plain
 inc/language/country_de.php svneol=native#text/plain
 inc/language/booking_de.php svneol=native#text/plain
 inc/language/cache_de.php svneol=native#text/plain
 inc/language/country_de.php svneol=native#text/plain
+inc/language/coupon_de.php svneol=native#text/plain
 inc/language/de.php svneol=native#text/plain
 inc/language/debug_de.php svneol=native#text/plain
 inc/language/doubler_de.php svneol=native#text/plain
 inc/language/de.php svneol=native#text/plain
 inc/language/debug_de.php svneol=native#text/plain
 inc/language/doubler_de.php svneol=native#text/plain
@@ -315,6 +316,7 @@ inc/libs/bonus_functions.php svneol=native#text/plain
 inc/libs/booking_functions.php svneol=native#text/plain
 inc/libs/cache_functions.php svneol=native#text/plain
 inc/libs/country_functions.php svneol=native#text/plain
 inc/libs/booking_functions.php svneol=native#text/plain
 inc/libs/cache_functions.php svneol=native#text/plain
 inc/libs/country_functions.php svneol=native#text/plain
+inc/libs/coupon_functions.php svneol=native#text/plain
 inc/libs/debug_functions.php svneol=native#text/plain
 inc/libs/doubler_functions.php svneol=native#text/plain
 inc/libs/events_functions.php svneol=native#text/plain
 inc/libs/debug_functions.php svneol=native#text/plain
 inc/libs/doubler_functions.php svneol=native#text/plain
 inc/libs/events_functions.php svneol=native#text/plain
@@ -391,6 +393,7 @@ inc/modules/admin/action- svneol=native#text/plain
 inc/modules/admin/action-admins.php svneol=native#text/plain
 inc/modules/admin/action-bank.php svneol=native#text/plain
 inc/modules/admin/action-country.php svneol=native#text/plain
 inc/modules/admin/action-admins.php svneol=native#text/plain
 inc/modules/admin/action-bank.php svneol=native#text/plain
 inc/modules/admin/action-country.php svneol=native#text/plain
+inc/modules/admin/action-coupon.php svneol=native#text/plain
 inc/modules/admin/action-doubler.php svneol=native#text/plain
 inc/modules/admin/action-email.php svneol=native#text/plain
 inc/modules/admin/action-holiday.php svneol=native#text/plain
 inc/modules/admin/action-doubler.php svneol=native#text/plain
 inc/modules/admin/action-email.php svneol=native#text/plain
 inc/modules/admin/action-holiday.php svneol=native#text/plain
@@ -441,6 +444,7 @@ inc/modules/admin/what-config_beg.php svneol=native#text/plain
 inc/modules/admin/what-config_birthday.php svneol=native#text/plain
 inc/modules/admin/what-config_bonus.php svneol=native#text/plain
 inc/modules/admin/what-config_cats.php svneol=native#text/plain
 inc/modules/admin/what-config_birthday.php svneol=native#text/plain
 inc/modules/admin/what-config_bonus.php svneol=native#text/plain
 inc/modules/admin/what-config_cats.php svneol=native#text/plain
+inc/modules/admin/what-config_coupon.php svneol=native#text/plain
 inc/modules/admin/what-config_doubler.php svneol=native#text/plain
 inc/modules/admin/what-config_email.php svneol=native#text/plain
 inc/modules/admin/what-config_extensions.php svneol=native#text/plain
 inc/modules/admin/what-config_doubler.php svneol=native#text/plain
 inc/modules/admin/what-config_email.php svneol=native#text/plain
 inc/modules/admin/what-config_extensions.php svneol=native#text/plain
@@ -967,6 +971,7 @@ templates/de/html/admin/admin_admins_mails_edit_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_admins_mails_list.tpl svneol=native#text/plain
 templates/de/html/admin/admin_admins_mails_list_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_cache_stats.tpl svneol=native#text/plain
 templates/de/html/admin/admin_admins_mails_list.tpl svneol=native#text/plain
 templates/de/html/admin/admin_admins_mails_list_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_cache_stats.tpl svneol=native#text/plain
+templates/de/html/admin/admin_config_ svneol=native#text/plain
 templates/de/html/admin/admin_config_active.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_admin.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_admins.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_active.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_admin.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_admins.tpl svneol=native#text/plain
@@ -981,6 +986,7 @@ templates/de/html/admin/admin_config_birthday.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_bonus.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_cats.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_cats_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_bonus.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_cats.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_cats_row.tpl svneol=native#text/plain
+templates/de/html/admin/admin_config_coupon.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_doubler.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_email.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_email_del.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_doubler.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_email.tpl svneol=native#text/plain
 templates/de/html/admin/admin_config_email_del.tpl svneol=native#text/plain
index 3fca4825ed773f590e9515135c1b53faa256d7bc..c1c290fe524cbda9158246458bb900be3d25514d 100644 (file)
 ./inc/extensions-functions.php:567:            // @TODO Extension is loaded, what next?
 ./inc/filter/bonus_filter.php:55:              // @TODO This query isn't right, it will only update if the user was for a longer time away!
 ./inc/filter/cache_filter.php:78:              // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal.
 ./inc/extensions-functions.php:567:            // @TODO Extension is loaded, what next?
 ./inc/filter/bonus_filter.php:55:              // @TODO This query isn't right, it will only update if the user was for a longer time away!
 ./inc/filter/cache_filter.php:78:              // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal.
-./inc/functions.php:1213:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
-./inc/functions.php:1301:                      // @TODO Are these convertions still required?
-./inc/functions.php:1319:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:1217:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
+./inc/functions.php:1305:                      // @TODO Are these convertions still required?
+./inc/functions.php:1323:// @TODO Rewrite this function to use readFromFile() and writeToFile()
 ./inc/functions.php:163:// @TODO Rewrite this to an extension 'smtp'
 ./inc/functions.php:163:// @TODO Rewrite this to an extension 'smtp'
-./inc/functions.php:1901:      // @TODO Find a way to cache this
-./inc/functions.php:2002:      // @TODO This is still very static, rewrite it somehow
-./inc/functions.php:2182:      // @TODO Rename column data_type to e.g. mail_status
+./inc/functions.php:1905:      // @TODO Find a way to cache this
+./inc/functions.php:2006:      // @TODO This is still very static, rewrite it somehow
+./inc/functions.php:2186:      // @TODO Rename column data_type to e.g. mail_status
 ./inc/functions.php:92:                // @TODO Extension 'msg' does not exist
 ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter
 ./inc/install-functions.php:57:        // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
 ./inc/functions.php:92:                // @TODO Extension 'msg' does not exist
 ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter
 ./inc/install-functions.php:57:        // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
index 03d3a9495df4c3f0861a3b7ffea0d65c3e8c5e1d..c6b6a3e22a333663dfee7fbcbc7102682fa5772a 100644 (file)
@@ -82,7 +82,7 @@ UNIQUE KEY (`coupon_code`)
 
                // Configuration entries
                addConfigAddSql('coupon_default_time', 'BIGINT(20) NOT NULL DEFAULT ' . (getOneDay() * 7));
 
                // Configuration entries
                addConfigAddSql('coupon_default_time', 'BIGINT(20) NOT NULL DEFAULT ' . (getOneDay() * 7));
-               addConfigAddSql('coupon_default_points', 'FLOAT(20,5) NOT NULL DEFAULT 1000.00000');
+               addConfigAddSql('coupon_default_points', 'FLOAT(20,5) NOT NULL DEFAULT 100.00000');
 
                // Menu systems:
                //  - Admin entries
 
                // Menu systems:
                //  - Admin entries
index da112b43fab7d71e293f3c5c0fe2df27ad410655..bc397426cfbe564414d6b866e518e24d5fa68bff 100644 (file)
@@ -346,14 +346,18 @@ function translateComma ($dotted, $cut = true, $max = '0') {
        // First, cast all to double, due to PHP changes
        $dotted = (double) $dotted;
 
        // First, cast all to double, due to PHP changes
        $dotted = (double) $dotted;
 
-       // Default is 3 you can change this in admin area "Misc -> Misc Options"
-       if (!isConfigEntrySet('max_comma')) setConfigEntry('max_comma', 3);
+       // Default is 3 you can change this in admin area "Settings -> Misc Options"
+       if (!isConfigEntrySet('max_comma')) {
+               setConfigEntry('max_comma', 3);
+       } // END - if
 
        // Use from config is default
        $maxComma = getConfig('max_comma');
 
        // Use from parameter?
 
        // Use from config is default
        $maxComma = getConfig('max_comma');
 
        // Use from parameter?
-       if ($max > 0) $maxComma = $max;
+       if ($max > 0) {
+               $maxComma = $max;
+       } // END - if
 
        // Cut zeros off?
        if (($cut === true) && ($max == '0')) {
 
        // Cut zeros off?
        if (($cut === true) && ($max == '0')) {
diff --git a/inc/language/coupon_de.php b/inc/language/coupon_de.php
new file mode 100644 (file)
index 0000000..f183ad4
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 26/06/2011 *
+ * ===================                          Last change: 26/06/2011 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : coupon_de.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} // END - if
+
+// Language definitions
+addMessages(array(
+       'ADMIN_CONFIG_COUPON_SETTINGS_TITLE' => "Allgemeine Einstellungen zu den Gutscheinen",
+       'ADMIN_CONFIG_COUPON_DEFAULT_TIME' => "Zeit, bis Gutscheine ablaufen sollen. Sie k&ouml;nnen diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachtr&auml;glich anpassen.",
+       'ADMIN_CONFIG_COUPON_DEFAULT_POINTS' => "Ausgangsverg&uuml;tung in {?POINTS?}. Sie k&ouml;nnen diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachtr&auml;glich anpassen.",
+));
+
+// [EOF]
+?>
diff --git a/inc/libs/coupon_functions.php b/inc/libs/coupon_functions.php
new file mode 100644 (file)
index 0000000..e17e525
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 26/06/2011 *
+ * ===================                          Last change: 26/06/2011 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : coupon_functions.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for ext-                               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Funktionen fuer ext-                             *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} // END - if
+
+// Wrapper function for 'coupon_default_points'
+function getCouponDefaultPoints () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Get config entry
+               $GLOBALS[__FUNCTION__] = getConfig('coupon_default_points');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// [EOF]
+?>
diff --git a/inc/modules/admin/action-coupon.php b/inc/modules/admin/action-coupon.php
new file mode 100644 (file)
index 0000000..d40bd88
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 06/26/2011 *
+ * ===================                          Last change: 06/26/2011 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-coupon.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Coupon admin menus                               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Gutschein-Adminmenues                            *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+       die();
+} // END - if
+
+// Add description as navigation point
+addYouAreHereLink('admin', __FILE__);
+
+// Load the include file
+$inc = sprintf("inc/modules/admin/what-%s.php", getWhat());
+if (isIncludeReadable($inc)) { 
+       // Ok, we finally load the admin action module
+       loadInclude($inc);
+} else {
+       addFatalMessage(__FILE__, __LINE__, getMaskedMessage('ADMIN_WHAT_404', getWhat()));
+}
+
+// [EOF]
+?>
index 18f1c1aba545e0123391c2d7c267746cd49bd4dd..84062756e2c508246bc9724fda9619a6cdcceb76 100644 (file)
@@ -44,10 +44,8 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addYouAreHereLink('admin', __FILE__);
 
 if (isFormSent()) {
 addYouAreHereLink('admin', __FILE__);
 
 if (isFormSent()) {
-       // Translate german decimal commas to computer decimal dots
-       setPostRequestParameter('beg_points'      , convertCommaToDot(postRequestParameter('beg_points')      ));
-       setPostRequestParameter('beg_points_max'  , convertCommaToDot(postRequestParameter('beg_points_max')  ));
-       setPostRequestParameter('beg_notify_bonus', convertCommaToDot(postRequestParameter('beg_notify_bonus')));
+       // Replace german decimal comma with computer decimal dot
+       convertCommaToDotInPostDataArray(array('beg_points', 'beg_points_max', 'beg_notify_bonus'));
 
        // Save settings
        adminSaveSettingsFromPostData();
 
        // Save settings
        adminSaveSettingsFromPostData();
index bfa6a2feed6ff194765ddbb2f5d72122d486cec1..f8878843f5b44a3c4e88642c5de1d2f482666aff 100644 (file)
@@ -44,12 +44,8 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addYouAreHereLink('admin', __FILE__);
 
 if (isFormSent()) {
 addYouAreHereLink('admin', __FILE__);
 
 if (isFormSent()) {
-       // Replace german decimal commas to computer decimal dots
-       setPostRequestParameter('login_bonus',         convertCommaToDot(postRequestParameter('login_bonus')));
-       setPostRequestParameter('turbo_bonus',         convertCommaToDot(postRequestParameter('turbo_bonus')));
-       setPostRequestParameter('bonus_ref',           convertCommaToDot(postRequestParameter('bonus_ref')));
-       setPostRequestParameter('bonus_order',         convertCommaToDot(postRequestParameter('bonus_order')));
-       setPostRequestParameter('bonus_notify_points', convertCommaToDot(postRequestParameter('bonus_notify_points')));
+       // Replace german decimal comma with computer decimal dot
+       convertCommaToDotInPostDataArray(array('login_bonus', 'turbo_bonus', 'bonus_ref', 'bonus_order', 'bonus_notify_points'));
 
        // Generate string for saving ranks
        setPostRequestParameter('turbo_rates', '');
 
        // Generate string for saving ranks
        setPostRequestParameter('turbo_rates', '');
@@ -62,7 +58,9 @@ if (isFormSent()) {
        unsetPostRequestParameter('rate');
 
        // Automatically calculate bonus points for ranks 2 and 3 when not set
        unsetPostRequestParameter('rate');
 
        // Automatically calculate bonus points for ranks 2 and 3 when not set
-       if (!isPostRequestParameterSet('turbo_rates')) setPostRequestParameter('turbo_rates', ''.round(getConfig('turbo_bonus') / 2).';'.round(getConfig('turbo_bonus') / 4).'');
+       if (!isPostRequestParameterSet('turbo_rates')) {
+               setPostRequestParameter('turbo_rates', ''.round(getConfig('turbo_bonus') / 2).';'.round(getConfig('turbo_bonus') / 4).'');
+       } // END - if
 
        // Save data
        adminSaveSettingsFromPostData();
 
        // Save data
        adminSaveSettingsFromPostData();
diff --git a/inc/modules/admin/what-config_coupon.php b/inc/modules/admin/what-config_coupon.php
new file mode 100644 (file)
index 0000000..fb9a11a
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 26/06/2011 *
+ * ===================                          Last change: 26/06/2011 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_coupon.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Configuration for extension coupon               *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Konfiguration der Gutschein-Erweiterung          *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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 *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+       die();
+} // END - if
+
+// Add description as navigation point
+addYouAreHereLink('admin', __FILE__);
+
+if (isFormSent()) {
+       // Replace German comma with computer's version
+       convertCommaToDotInPostData('coupon_default_points');
+
+       // Save data
+       adminSaveSettingsFromPostData();
+} else {
+       // Prepare some template data
+       $content['coupon_default_time_selection'] = createConfigurationTimeSelections('coupon_default_time', 'WDh');
+
+       // Load template
+       loadTemplate('admin_config_coupon', false, $content);
+}
+
+// [EOF]
+?>
index 6738249233865bb73a84d7c0e865568ab2341c19..f26d37e2129b571585cae0d2a4ceb8535a418249 100644 (file)
@@ -44,18 +44,14 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addYouAreHereLink('admin', __FILE__);
 
 if (isFormSent()) {
 addYouAreHereLink('admin', __FILE__);
 
 if (isFormSent()) {
-       // Replace commata with decimal dot
-       setPostRequestParameter('doubler_charge', convertCommaToDot(postRequestParameter('doubler_charge')));
-       setPostRequestParameter('doubler_ref'   , convertCommaToDot(postRequestParameter('doubler_ref')));
-       setPostRequestParameter('doubler_min'   , convertCommaToDot(postRequestParameter('doubler_min')));
-       setPostRequestParameter('doubler_max'   , convertCommaToDot(postRequestParameter('doubler_max')));
-       setPostRequestParameter('doubler_left'  , convertCommaToDot(postRequestParameter('doubler_left')));
+       // Replace german decimal comma with computer decimal dot
+       convertCommaToDotInPostDataArray(array('doubler_charge', 'doubler_ref', 'doubler_min', 'doubler_max', 'doubler_left'));
 
        // Save settings
        adminSaveSettingsFromPostData();
 } else {
        // Init all Y/N selections
 
        // Save settings
        adminSaveSettingsFromPostData();
 } else {
        // Init all Y/N selections
-       foreach (array('jackpot','own','sent_all') as $entry) {
+       foreach (array('jackpot', 'own', 'sent_all') as $entry) {
                $content[$entry . '_y'] = '';
                $content[$entry . '_n'] = '';
                $content[$entry . '_' . strtolower(getConfig('doubler_' . $entry))] = ' checked="checked"';
                $content[$entry . '_y'] = '';
                $content[$entry . '_n'] = '';
                $content[$entry . '_' . strtolower(getConfig('doubler_' . $entry))] = ' checked="checked"';
index d3b77e7d5cea05f4c4c6c6ac85034460e33f8c6e..8a5e102d6c616808f6d049b983a31902ffb8ae44 100644 (file)
@@ -43,7 +43,10 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 // Add description as navigation point
 addYouAreHereLink('admin', __FILE__);
 
 // Add description as navigation point
 addYouAreHereLink('admin', __FILE__);
 
-if (isPostRequestParameterSet('rate')) setPostRequestParameter('rate', convertCommaToDot(postRequestParameter('rate')));
+// Convert 'rate' if set
+if (isPostRequestParameterSet('rate')) {
+       convertCommaToDotInPostData('rate');
+} // END - if
 
 if ((isFormSent('add')) && (isPostRequestParameterSet('title')) && (postRequestParameter('rate') > 0)) {
        // Add new payout type
 
 if ((isFormSent('add')) && (isPostRequestParameterSet('title')) && (postRequestParameter('rate') > 0)) {
        // Add new payout type
index bb5834696c76b03e67bab53c289f559f21b3752f..a8a381d16600bae1bbf9cda6a8fb19cff5419073 100644 (file)
@@ -45,8 +45,7 @@ addYouAreHereLink('admin', __FILE__);
 
 if (isFormSent()) {
        // Replace german decimal comma with computer decimal dot
 
 if (isFormSent()) {
        // Replace german decimal comma with computer decimal dot
-       if (isPostRequestParameterSet('refback_min_perc')) setPostRequestParameter('refback_min_perc', convertCommaToDot(postRequestParameter('refback_min_perc')));
-       if (isPostRequestParameterSet('refback_max_perc')) setPostRequestParameter('refback_max_perc', convertCommaToDot(postRequestParameter('refback_max_perc')));
+       convertCommaToDotInPostDataArray(array('refback_min_perc', 'refback_max_perc'));
 
        // Save configuration
        adminSaveSettingsFromPostData();
 
        // Save configuration
        adminSaveSettingsFromPostData();
index f0213cd06c69f7537d705f6b20f6263911c2c9d6..a0b77e469c1ada3183b9531c195c26353528f9f6 100644 (file)
@@ -46,9 +46,7 @@ addYouAreHereLink('admin', __FILE__);
 // Was the form submitted?
 if (isFormSent()) {
        // Replace german decimal comma with computer decimal dot
 // Was the form submitted?
 if (isFormSent()) {
        // Replace german decimal comma with computer decimal dot
-       if (isPostRequestParameterSet('surfbar_static_reward'))   setPostRequestParameter('surfbar_static_reward'  , convertCommaToDot(postRequestParameter('surfbar_static_reward')));
-       if (isPostRequestParameterSet('surfbar_static_costs'))    setPostRequestParameter('surfbar_static_costs'   , convertCommaToDot(postRequestParameter('surfbar_static_costs')));
-       if (isPostRequestParameterSet('surfbar_dynamic_percent')) setPostRequestParameter('surfbar_dynamic_percent', convertCommaToDot(postRequestParameter('surfbar_dynamic_percent')));
+       convertCommaToDotInPostDataArray(array('surfbar_static_reward', 'surfbar_static_costs', 'surfbar_dynamic_percent'));
 
        // Save settings
        adminSaveSettingsFromPostData();
 
        // Save settings
        adminSaveSettingsFromPostData();
index 81fbc2f8b03e1ee70af368e25d0b0e0658ac7259..9b27b66fee470c90631668d7dd5dce21a94b41ae 100644 (file)
@@ -2442,12 +2442,33 @@ function firstCharUpperCase ($str) {
 }
 
 // Shortens calls with configuration entry as first argument (the second will become obsolete in the future)
 }
 
 // Shortens calls with configuration entry as first argument (the second will become obsolete in the future)
-function createConfigurationTimeSelections ($configEntry, $stamps) {
+function createConfigurationTimeSelections ($configEntry, $stamps, $align = 'center') {
        // Get the configuration entry
        $configValue = getConfig($configEntry);
 
        // Call inner method
        // Get the configuration entry
        $configValue = getConfig($configEntry);
 
        // Call inner method
-       return createTimeSelections($configValue, $configEntry, $stamps);
+       return createTimeSelections($configValue, $configEntry, $stamps, $align);
+}
+
+// Shortens converting of German comma to Computer's version in POST data
+function convertCommaToDotInPostData ($postEntry) {
+       // Read and convert given entry
+       $postValue = convertCommaToDot(postRequestParameter($postEntry));
+
+       // ... and set it again
+       setPostRequestParameter($postEntry, $postValue);
+}
+
+// Converts German commas to Computer's version in all entries
+function convertCommaToDotInPostDataArray (array $postEntries) {
+       // Replace german decimal comma with computer decimal dot
+       foreach ($postEntries as $entry) {
+               // Is the entry there?
+               if (isPostRequestParameterSet($entry)) {
+                       // Then convert it
+                       convertCommaToDotInPostData($entry);
+               } // END - if
+       } // END - foreach
 }
 
 // [EOF]
 }
 
 // [EOF]
diff --git a/templates/de/html/admin/admin_config_ b/templates/de/html/admin/admin_config_
new file mode 100644 (file)
index 0000000..2d95556
--- /dev/null
@@ -0,0 +1,23 @@
+<div align="center">
+<form accept-charset="UTF-8" action="{%url=modules.php?module=admin&amp;what=config_%}" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
+       <tr>
+               <td class="table_header bottom" colspan="2" align="center">
+                       <strong>{--ADMIN_CONFIG__SETTINGS_TITLE--}:</strong>
+               </td>
+       </tr>
+       <tr>
+               <td class="bottom" align="right">{--ADMIN_CONFIG_--}:</td>
+               <td class="bottom" align="center">
+                       <input type="input" name="" class="form_field" value="{??}" size="5" maxlength="20" />
+               </td>
+       </tr>
+       <tr>
+               <td class="table_footer" colspan="2" align="center">
+                       <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
+                       <input type="submit" class="form_submit" name="ok" value="{--SAVE_SETTINGS--}" />
+               </td>
+       </tr>
+</table>
+</form>
+</div>
diff --git a/templates/de/html/admin/admin_config_coupon.tpl b/templates/de/html/admin/admin_config_coupon.tpl
new file mode 100644 (file)
index 0000000..3a221b8
--- /dev/null
@@ -0,0 +1,30 @@
+<div align="center">
+<form accept-charset="UTF-8" action="{%url=modules.php?module=admin&amp;what=config_coupon%}" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
+       <tr>
+               <td class="table_header bottom" colspan="2" align="center">
+                       <strong>{--ADMIN_CONFIG_COUPON_SETTINGS_TITLE--}:</strong>
+               </td>
+       </tr>
+       <tr>
+               <td class="bottom" align="right">{--ADMIN_CONFIG_COUPON_DEFAULT_TIME--}:</td>
+               <td class="bottom" align="center">
+                       $content[coupon_default_time_selection]
+               </td>
+       </tr>
+       <tr>
+               <td class="bottom" align="right">{--ADMIN_CONFIG_COUPON_DEFAULT_POINTS--}:</td>
+               <td class="bottom" align="center">
+                       <input type="input" name="coupon_default_points" class="form_field" value="{%config,translateComma=coupon_default_points%}" size="5" maxlength="20" />
+                       <span class="tiny">({?POINTS?})</span>
+               </td>
+       </tr>
+       <tr>
+               <td class="table_footer" colspan="2" align="center">
+                       <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
+                       <input type="submit" class="form_submit" name="ok" value="{--SAVE_SETTINGS--}" />
+               </td>
+       </tr>
+</table>
+</form>
+</div>