New functions introduced:
authorRoland Häder <roland@mxchange.org>
Tue, 21 Dec 2010 23:32:04 +0000 (23:32 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 21 Dec 2010 23:32:04 +0000 (23:32 +0000)
- sql_patches must now be 0.7.4 in what-email_details.php
- New (?) template function 'generateExtensionOutdatedMessage() introduced
- Wrapper getMailsPage() introduced
- TODOs.txt updated

DOCS/TODOs.txt
inc/language/de.php
inc/modules/admin/what-add_rallye.php
inc/modules/admin/what-email_archiv.php
inc/modules/admin/what-email_details.php
inc/modules/admin/what-list_notifications.php
inc/template-functions.php
inc/wrapper-functions.php

index b99f1752a8fa0437e020c5642d2ea59057fc6a30..046d0145c2806877fe70d4ae61b0fb022e193cdb 100644 (file)
@@ -49,8 +49,8 @@
 ./inc/functions.php:2272:      // @TODO This is still very static, rewrite it somehow
 ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter
 ./inc/install-functions.php:57:        // @TODO DEACTIVATED: changeDataInInclude(getCachePath() . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
 ./inc/functions.php:2272:      // @TODO This is still very static, rewrite it somehow
 ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter
 ./inc/install-functions.php:57:        // @TODO DEACTIVATED: changeDataInInclude(getCachePath() . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
-./inc/language/de.php:1085:// @TODO Rewrite these two constants
-./inc/language/de.php:1100:// @TODO Rewrite these three constants
+./inc/language/de.php:1087:// @TODO Rewrite these two constants
+./inc/language/de.php:1102:// @TODO Rewrite these three constants
 ./inc/language/de.php:280:     // @TODO Following two are unused?
 ./inc/language/de.php:784:// @TODO Are these constants longer used?
 ./inc/language-functions.php:243:      // @TODO These are all valid languages, again hard-coded
 ./inc/language/de.php:280:     // @TODO Following two are unused?
 ./inc/language/de.php:784:// @TODO Are these constants longer used?
 ./inc/language-functions.php:243:      // @TODO These are all valid languages, again hard-coded
 ./inc/template-functions.php:1054:                     // @TODO Deprecate this thing
 ./inc/template-functions.php:1141:     // @TODO This can be easily moved out after the merge from EL branch to this is complete
 ./inc/template-functions.php:1174:             // @TODO Add a little more infos here
 ./inc/template-functions.php:1054:                     // @TODO Deprecate this thing
 ./inc/template-functions.php:1141:     // @TODO This can be easily moved out after the merge from EL branch to this is complete
 ./inc/template-functions.php:1174:             // @TODO Add a little more infos here
-./inc/template-functions.php:1462:// @TODO Lame description for this function
-./inc/template-functions.php:1484:                     // @TODO Move this in a filter
+./inc/template-functions.php:1483:// @TODO Lame description for this function
+./inc/template-functions.php:1505:                     // @TODO Move this in a filter
 ./inc/template-functions.php:189:       * @TODO On some pages this is buggy
 ./inc/template-functions.php:265:      // @TODO Remove this sanity-check if all is fine
 ./inc/template-functions.php:578:// @TODO $simple/$constants are deprecated
 ./inc/template-functions.php:189:       * @TODO On some pages this is buggy
 ./inc/template-functions.php:265:      // @TODO Remove this sanity-check if all is fine
 ./inc/template-functions.php:578:// @TODO $simple/$constants are deprecated
index 95be0696ab878a4e7d4e32ddfb9e11aa08c1ef61..490be12ee221389e733c5ce6c6e26a1cc237144e 100644 (file)
@@ -963,11 +963,13 @@ addMessages(array(
        'ADMIN_NO_POINTS_REPAYED' => "Die Mailbuchung hatte keine {?POINTS?} zum zur&uuml;ckbuchen.",
        'ADMIN_POINTS_SHREDDED' => "Es wurden <span class=\"data\">%s {?POINTS?}</span> geschrettert.",
        'ADMIN_EXTENSION_PROBLEM_EXTENSION_INACTIVE' => "Die Erweiterung <span class=\"data\">%s</span> ist derzeit deaktiviert. <a href=\"{%%url=modules.php?module=admin&amp;what=extensions%%}\">Hier</a> k&ouml;nnen Sie diese aktivieren.",
        'ADMIN_NO_POINTS_REPAYED' => "Die Mailbuchung hatte keine {?POINTS?} zum zur&uuml;ckbuchen.",
        'ADMIN_POINTS_SHREDDED' => "Es wurden <span class=\"data\">%s {?POINTS?}</span> geschrettert.",
        'ADMIN_EXTENSION_PROBLEM_EXTENSION_INACTIVE' => "Die Erweiterung <span class=\"data\">%s</span> ist derzeit deaktiviert. <a href=\"{%%url=modules.php?module=admin&amp;what=extensions%%}\">Hier</a> k&ouml;nnen Sie diese aktivieren.",
+       'ADMIN_EXTENSION_PROBLEM_EXTENSION_OUTDATED' => "Die Erweiterung <span class=\"data\">%s</span> ist veraltet. Ihre Version: <span class=\"data\">{%%ext,version=%s%%}</span>, erwartete Version: <span class=\"data\">%s</span>.",
        'ADMIN_EXTENSION_PROBLEM_EXTENSION_NOT_INSTALLED' => "Die Erweiterung <span class=\"data\">%s</span> ist derzeit nicht installiert. <a href=\"{%%url=modules.php?module=admin&amp;what=extensions%%}\">Hier</a> k&ouml;nnen Sie diese aktivieren.",
        'ADMIN_TASK_ROW_EXTENSION_NOT_INSTALLED' => "Erweiterung <span class=\"data\">%s</span> nicht installiert..",
        'EXTENSION_PROBLEM_EXTENSION_INACTIVE' => "Kann nicht fortfahren! Fehler: Erweiterung <span class=\"data\">%s</span> deaktiviert.",
        'EXTENSION_PROBLEM_EXTENSION_NOT_INSTALLED' => "Kann nicht fortfahren! Fehler: Erweiterung <span class=\"data\">%s</span> nicht installiert.",
        'EXTENSION_PROBLEM_UNSET_EXT' => "Skriptfehler: Parameter <strong>ext</strong> nicht gesetzt.",
        'ADMIN_EXTENSION_PROBLEM_EXTENSION_NOT_INSTALLED' => "Die Erweiterung <span class=\"data\">%s</span> ist derzeit nicht installiert. <a href=\"{%%url=modules.php?module=admin&amp;what=extensions%%}\">Hier</a> k&ouml;nnen Sie diese aktivieren.",
        'ADMIN_TASK_ROW_EXTENSION_NOT_INSTALLED' => "Erweiterung <span class=\"data\">%s</span> nicht installiert..",
        'EXTENSION_PROBLEM_EXTENSION_INACTIVE' => "Kann nicht fortfahren! Fehler: Erweiterung <span class=\"data\">%s</span> deaktiviert.",
        'EXTENSION_PROBLEM_EXTENSION_NOT_INSTALLED' => "Kann nicht fortfahren! Fehler: Erweiterung <span class=\"data\">%s</span> nicht installiert.",
        'EXTENSION_PROBLEM_UNSET_EXT' => "Skriptfehler: Parameter <strong>ext</strong> nicht gesetzt.",
+       'EXTENSION_PROBLEM_EXTENSION_OUTDATED' => "Kann nicht fortfahren! Fehler Eine Erweiterung ist veraltet. Bitte benachrichten Sie den Support.",
        'EXTENSION_WARNING_EXTENSION_INACTIVE' => "Die Erweiterung <span class=\"data\">%s</span> ist nicht aktiv. Dies kann zu St&ouml;rungen f&uuml;hren.<br />\nBitte aktivieren Sie diese unter <em>Verschiedenes-&gt;Erweiterungen</em>.",
        'EXTENSION_WARNING_USER_LIMIT' => "Die Erweiterung <u>user</u> ist nicht aktiv. Die Anzahl Mitglieder pro Seite wurde auf 100 gesetzt. Bitte aktivieren Sie diese unter <em>Verschiedenes-&gt;Erweiterungen</em>.",
        'ADMIN_PROXY_SETTINGS_INVALID' => "Ihre Proxy-Einstellungen scheinen ung&uuml;ltig zu sein.",
        'EXTENSION_WARNING_EXTENSION_INACTIVE' => "Die Erweiterung <span class=\"data\">%s</span> ist nicht aktiv. Dies kann zu St&ouml;rungen f&uuml;hren.<br />\nBitte aktivieren Sie diese unter <em>Verschiedenes-&gt;Erweiterungen</em>.",
        'EXTENSION_WARNING_USER_LIMIT' => "Die Erweiterung <u>user</u> ist nicht aktiv. Die Anzahl Mitglieder pro Seite wurde auf 100 gesetzt. Bitte aktivieren Sie diese unter <em>Verschiedenes-&gt;Erweiterungen</em>.",
        'ADMIN_PROXY_SETTINGS_INVALID' => "Ihre Proxy-Einstellungen scheinen ung&uuml;ltig zu sein.",
index aa8bc4371be037f5d0ac93526e0d19425cf5f690..ac12eb6b8e712104e4ffd5cba3e159c3ed5fc285 100644 (file)
@@ -85,7 +85,7 @@ VALUES (%s,'%s','%s','%s',%s,%s,'%s','%s','%s')",
                // Overlapping detected
                loadTemplate('admin_settings_saved', false, '{--RALLYE_OVERLAP_TIMES--}');
        }
                // Overlapping detected
                loadTemplate('admin_settings_saved', false, '{--RALLYE_OVERLAP_TIMES--}');
        }
-}
+} // END - if
 
 // Prepare some constants for the template
 $content['auto_add_options'] = generateOptionList('/ARRAY/', array('Y','N'), array('{--YES--}', '{--NO--}' ));
 
 // Prepare some constants for the template
 $content['auto_add_options'] = generateOptionList('/ARRAY/', array('Y','N'), array('{--YES--}', '{--NO--}' ));
index c132c629a52f6b697416d74860a3f7c88a73bfa4..b5771216083750ddf44993da78e1d8223f1ce01d 100644 (file)
@@ -61,7 +61,7 @@ $result_maximum = SQL_QUERY($sql, __FILE__, __LINE__);
 
 // Set offset an current page to default values
 if (!isGetRequestParameterSet('page'))   setGetRequestParameter('page'  , 1);
 
 // Set offset an current page to default values
 if (!isGetRequestParameterSet('page'))   setGetRequestParameter('page'  , 1);
-if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', getConfig('mails_page'));
+if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', getMailsPage());
 
 // Add limitation to SQL string
 $sql .= ' LIMIT ' . (getRequestParameter('offset') * getRequestParameter('page') - getRequestParameter('offset')) . ', ' . getRequestParameter('offset');
 
 // Add limitation to SQL string
 $sql .= ' LIMIT ' . (getRequestParameter('offset') * getRequestParameter('page') - getRequestParameter('offset')) . ', ' . getRequestParameter('offset');
@@ -70,7 +70,7 @@ $sql .= ' LIMIT ' . (getRequestParameter('offset') * getRequestParameter('page')
 $result = SQL_QUERY($sql, __FILE__, __LINE__);
 
 // Calculate pages
 $result = SQL_QUERY($sql, __FILE__, __LINE__);
 
 // Calculate pages
-$numPages = round(SQL_NUMROWS($result_maximum) / getConfig('mails_page') + 0.5);
+$numPages = round(SQL_NUMROWS($result_maximum) / getMailsPage() + 0.5);
 
 // Free the result which we don't need
 SQL_FREERESULT($result_maximum);
 
 // Free the result which we don't need
 SQL_FREERESULT($result_maximum);
@@ -79,8 +79,8 @@ if (!SQL_HASZERONUMS($result)) {
        // Mail orders are in pool so we can display them
 
        // Add navigation table rows
        // Mail orders are in pool so we can display them
 
        // Add navigation table rows
-       $content['top_email_nav']    = addEmailNavigation($numPages, getConfig('mails_page'), true , 3, true);
-       $content['bottom_email_nav'] = addEmailNavigation($numPages, getConfig('mails_page'), false, 3, true);
+       $content['top_email_nav']    = addEmailNavigation($numPages, getMailsPage(), true , 3, true);
+       $content['bottom_email_nav'] = addEmailNavigation($numPages, getMailsPage(), false, 3, true);
 
        // List all entries
        $OUT = '';
 
        // List all entries
        $OUT = '';
index 52775b3073764a97a286d79923077020d76f0973..09e6922b4df5b3bb21d7de858a6382a476d05052 100644 (file)
@@ -43,6 +43,13 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 // Add description as navigation point
 addYouAreHereLink('admin', __FILE__);
 
 // Add description as navigation point
 addYouAreHereLink('admin', __FILE__);
 
+// Is 'sql_patches' updated?
+if (!isExtensionInstalledAndNewer('sql_patches', '0.7.4')) {
+       // No, abort here
+       loadTemplate('admin_settings_saved', false, generateExtensionOutdatedMessage('sql_patches', '0.7.4'));
+       return false;
+} // END - if
+
 // Normal mails ordered by your members
 $sql = "SELECT
        `id`, `sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `target_send`, `mails_sent`, `cat_id`
 // Normal mails ordered by your members
 $sql = "SELECT
        `id`, `sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `target_send`, `mails_sent`, `cat_id`
@@ -97,7 +104,7 @@ WHERE
        `is_notify`='N'
 ORDER BY
        `timestamp` DESC", __FILE__, __LINE__);
        `is_notify`='N'
 ORDER BY
        `timestamp` DESC", __FILE__, __LINE__);
-}
+} // END - if
 
 // Check for maximum pages
 $result_normal = SQL_QUERY($sql, __FILE__, __LINE__);
 
 // Check for maximum pages
 $result_normal = SQL_QUERY($sql, __FILE__, __LINE__);
@@ -108,7 +115,7 @@ if (!isGetRequestParameterSet('page')) setGetRequestParameter('page', 1);
 if (!isGetRequestParameterSet('offset')) {
        if (isConfigEntrySet('mails_page')) {
                // Set config entry
 if (!isGetRequestParameterSet('offset')) {
        if (isConfigEntrySet('mails_page')) {
                // Set config entry
-               setGetRequestParameter('offset', getConfig('mails_page'));
+               setGetRequestParameter('offset', getMailsPage());
        } else {
                // Set default one
                setGetRequestParameter('offset', 10);
        } else {
                // Set default one
                setGetRequestParameter('offset', 10);
@@ -134,7 +141,7 @@ if ((!empty($SQL2)) && (empty($WHO))) $result_bonus = SQL_QUERY($SQL2, __FILE__,
 // Calculate pages
 $numPages = '0';
 if (isConfigEntrySet('mails_page')) {
 // Calculate pages
 $numPages = '0';
 if (isConfigEntrySet('mails_page')) {
-       $numPages = round(SQL_NUMROWS($result_normal) / getConfig('mails_page') + 0.3);
+       $numPages = round(SQL_NUMROWS($result_normal) / getMailsPage() + 0.3);
 } // END - if
 
 // Free result
 } // END - if
 
 // Free result
@@ -171,7 +178,7 @@ if (!SQL_HASZERONUMS($result_list)) {
        SQL_FREERESULT($result_list);
 
        // Add navigation (with change box and colspan=3)
        SQL_FREERESULT($result_list);
 
        // Add navigation (with change box and colspan=3)
-       $content['nav'] = addEmailNavigation($numPages, getConfig('mails_page'), false, 3, true);
+       $content['nav'] = addEmailNavigation($numPages, getMailsPage(), false, 3, true);
 
        // Prepare content
        $content['rows'] = $OUT;
 
        // Prepare content
        $content['rows'] = $OUT;
@@ -191,7 +198,7 @@ if ((isExtensionActive('bonus')) && (empty($WHO))) {
        // Load bonus mails only when extension is active
        if (!SQL_HASZERONUMS($result_bonus)) {
                // Calculate pages
        // Load bonus mails only when extension is active
        if (!SQL_HASZERONUMS($result_bonus)) {
                // Calculate pages
-               $numPages = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
+               $numPages = round(SQL_NUMROWS($result_bonus) / getMailsPage() + 0.5);
 
                // List emails
                $OUT = '';
 
                // List emails
                $OUT = '';
@@ -207,7 +214,7 @@ if ((isExtensionActive('bonus')) && (empty($WHO))) {
                } // END - while
 
                // Add navigation (without change box but with colspan=3)
                } // END - while
 
                // Add navigation (without change box but with colspan=3)
-               $content['nav'] = addEmailNavigation($numPages, getConfig('mails_page'), false, 3, true);
+               $content['nav'] = addEmailNavigation($numPages, getMailsPage(), false, 3, true);
 
                // Prepare content
                $content['rows'] = $OUT;
 
                // Prepare content
                $content['rows'] = $OUT;
index f1f3bb965731fa1f11adf58aabb9598196a8ae80..1323a6014ebf533d71e249d6b23ef19ec669e49a 100644 (file)
@@ -49,7 +49,7 @@ $result_max = false;
 
 // Set offset an current page to default values
 if (!isGetRequestParameterSet('page'))   setGetRequestParameter('page'  , 1);
 
 // Set offset an current page to default values
 if (!isGetRequestParameterSet('page'))   setGetRequestParameter('page'  , 1);
-if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', getConfig('mails_page'));
+if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', getMailsPage());
 
 if (isExtensionActive('bonus')) {
        // Bonus mails sent by you
 
 if (isExtensionActive('bonus')) {
        // Bonus mails sent by you
@@ -83,7 +83,7 @@ if ((isExtensionActive('bonus')) && (!SQL_HASZERONUMS($result_max)) && (!empty($
        // Load bonus mails only when extension is active
        if (!SQL_HASZERONUMS($result_bonus)) {
                // Calculate pages
        // Load bonus mails only when extension is active
        if (!SQL_HASZERONUMS($result_bonus)) {
                // Calculate pages
-               $numPages = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
+               $numPages = round(SQL_NUMROWS($result_bonus) / getMailsPage() + 0.5);
 
                // List emails
                $OUT = ''; $content = array();
 
                // List emails
                $OUT = ''; $content = array();
@@ -99,7 +99,7 @@ if ((isExtensionActive('bonus')) && (!SQL_HASZERONUMS($result_max)) && (!empty($
                } // END - if
 
                // Add navigation (without change box but with colspan=3)
                } // END - if
 
                // Add navigation (without change box but with colspan=3)
-               $content['nav'] = addEmailNavigation($numPages, getConfig('mails_page'), false, 3, true);
+               $content['nav'] = addEmailNavigation($numPages, getMailsPage(), false, 3, true);
 
                // Prepare content
                $content['rows'] = $OUT;
 
                // Prepare content
                $content['rows'] = $OUT;
index f5f1c25965d5967179d1a5ed82c0a2dc355914dc..1b9dacc836bbb2a829984d80c3d9753c61d23288 100644 (file)
@@ -1237,6 +1237,27 @@ function handleCodeMessage () {
        } // END - if
 }
 
        } // END - if
 }
 
+// Generates a 'extension foo out-dated' message
+function generateExtensionOutdatedMessage ($ext_name, $ext_ver) {
+       // Is the extension empty?
+       if (empty($ext_name)) {
+               // This should not happen
+               debug_report_bug(__FUNCTION__, __LINE__, 'Parameter ext is empty. This should not happen.');
+       } // END - if
+
+       // Default message
+       $message = getMaskedMessage('EXTENSION_PROBLEM_EXTENSION_OUTDATED', $ext_name);
+
+       // Is an admin logged in?
+       if (isAdmin()) {
+               // Then output admin message
+               $message = sprintf(getMessage('ADMIN_EXTENSION_PROBLEM_EXTENSION_INACTIVE'), $ext_name, $ext_name, $ext_ver);
+       } // END - if
+
+       // Return prepared message
+       return $message;
+}
+
 // Generates a 'extension foo inactive' message
 function generateExtensionInactiveMessage ($ext_name) {
        // Is the extension empty?
 // Generates a 'extension foo inactive' message
 function generateExtensionInactiveMessage ($ext_name) {
        // Is the extension empty?
index 80a4236061b0257e1eb83ee3eda39b7fa487eb0d..5941dd496744b1a7727a032ceacc8dafb7d21d87 100644 (file)
@@ -2021,6 +2021,18 @@ function getMaxSend () {
        return $GLOBALS[__FUNCTION__];
 }
 
        return $GLOBALS[__FUNCTION__];
 }
 
+// "Getter" for mails_page
+function getMailsPage () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('mails_page');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // "Getter" for __DB_NAME
 function getDbName () {
        // Do we have cache?
 // "Getter" for __DB_NAME
 function getDbName () {
        // Do we have cache?