From e79e1454e88271e35086963a0422a51cc243e67a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 18 May 2008 16:26:56 +0000 Subject: [PATCH 1/1] New feature of repaying points to user/jackpot/shred added --- inc/extensions/ext-order.php | 20 +++- inc/extensions/ext-sql_patches.php | 10 +- inc/language/de.php | 1 + inc/language/order_de.php | 6 + inc/modules/admin/action-task.php | 6 +- inc/modules/admin/overview-inc.php | 105 ++++++++---------- inc/modules/admin/what-config_order.php | 27 ++++- inc/modules/admin/what-del_email.php | 8 +- inc/modules/admin/what-del_task.php | 8 +- inc/modules/admin/what-list_task.php | 7 +- inc/modules/admin/what-overview.php | 24 ++-- .../de/html/admin/admin_config_order.tpl | 29 ++++- 12 files changed, 150 insertions(+), 101 deletions(-) diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index 873f7fd74b..16f7f73740 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -38,13 +38,13 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) { } // Version number -$EXT_VERSION = "0.4.8"; +$EXT_VERSION = "0.4.9"; // Auto-set extension version if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION; // Version history array (add more with , "0.1" and so on) -$EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8"); +$EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9"); switch ($EXT_LOAD_MODE) { @@ -292,15 +292,23 @@ nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der Us $UPDATE_NOTES = "Menüpunkt "Mailbuchungsseite" nach "Mailbuchung" umbenannt und weitere Einstellungen aus Sonstige Einstellungen verschoben."; break; + case "0.4.9": // SQL queries for v0.4.9 + $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD repay_deleted_mails ENUM('REPAY', 'JACKPOT', 'SHRED') not null default 'REPAY'"; + + // Update notes (these will be set as task text!) + $UPDATE_NOTES = "Bei Löschung von Mailbuchungen kann nun global entschieden werden (Einstellungen also), ob die verbliebenen ".POINTS." wieder gutgeschrieben werden sollen oder in den Jackpot landen."; + break; + } break; default: // Do stuff when extension is loaded $dummy = LOAD_CONFIG(); - $_CONFIG['order_min'] = $dummy['order_min']; // Order at least X mails - $_CONFIG['order_max'] = $dummy['order_max_full']; // Ordering mode: as much as possible or as much as the user want's to receive - $_CONFIG['order_select'] = $dummy['order_select']; // Sorting mode for selecting users while looking some up for mail delivery - $_CONFIG['order_mode'] = $dummy['order_mode']; // Ascending or descending sort order for above + $_CONFIG['order_min'] = $dummy['order_min']; // Order at least X mails + $_CONFIG['order_max'] = $dummy['order_max_full']; // Ordering mode: as much as possible or as much as the user want's to receive + $_CONFIG['order_select'] = $dummy['order_select']; // Sorting mode for selecting users while looking some up for mail delivery + $_CONFIG['order_mode'] = $dummy['order_mode']; // Ascending or descending sort order for above + $_CONFIG['repay_deleted_mails'] = $dummy['repay_deleted_mails']; // Wether repay points or send them to jackpot/shreder on mail order deletion unset($dummy); // Do daily reset only when installed and extension version is at least 0.1.1 diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 3cb088c025..294db45c19 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -581,15 +581,11 @@ default: // Do stuff when extension is loaded } // Test again - if ((!empty($_CONFIG['file_hash'])) && (!empty($_CONFIG['master_salt'])) && (!empty($_CONFIG['pass_scramble']))) - { + if ((!empty($_CONFIG['file_hash'])) && (!empty($_CONFIG['master_salt'])) && (!empty($_CONFIG['pass_scramble']))) { // File hash fas generated so we can also file the secret file... hopefully. - if ((file_exists(PATH."inc/.secret/.".$_CONFIG['file_hash'])) && (is_readable(PATH."inc/.secret/.".$_CONFIG['file_hash']))) - { + if ((file_exists(PATH."inc/.secret/.".$_CONFIG['file_hash'])) && (is_readable(PATH."inc/.secret/.".$_CONFIG['file_hash']))) { $_CONFIG['secret_key'] = implode("", file(PATH."inc/.secret/.".$_CONFIG['file_hash'])); - } - else - { + } else { // Cannot read secret file! mxchange_die("Cannot read secret file!"); } diff --git a/inc/language/de.php b/inc/language/de.php index 650db038c2..eb4144f820 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -1107,6 +1107,7 @@ define('SUBJECT_DIRECT_PAYMENT', "Direkte {!POINTS!}-Gutschrift durch das System define('ADMIN_LOGOUT_SQL_PATCHES_DONE', "Sie wurden automatisch ausgeloggt, da Sie die Erweiterung sql_patches installiert haben und dabei das Passort-Hashing geändert/verbessert wurde. Bitte erneut einloggen!"); define('ADMIN_POINTS_REPAYED', "Es wurden dem Mitglied %s {!POINTS!} zurückgeschrieben."); define('ADMIN_NO_POINTS_REPAYED', "Die Mailbuchung hatte keine {!POINTS!} zum zurückbuchen!"); +define('EXTENSION_WARNING_EXT_INACTIVE', "Die Erweiterung %s ist nicht aktiv. Dies kann zu Störungen führen.
\nBitte aktivieren Sie diese unter Verschiedenes->Erweiterungen."); // ?> diff --git a/inc/language/order_de.php b/inc/language/order_de.php index 6663f4b432..b0767dfb05 100644 --- a/inc/language/order_de.php +++ b/inc/language/order_de.php @@ -73,5 +73,11 @@ define('ADMIN_AUTOSEND_ACTIVE', "Der Auto-Versand ist in Ihrem {!MT_WORD!} derze define('MEMBER_AUTOSEND_INACTIVE', "Der Auto-Versand ist in unserem {!MT_WORD!} derzeit deaktiviert. Ihre Mailbuchung wird bald von einem Administrator ueberprueft und dann freigegeben."); define('MEMBER_AUTOSEND_ACTIVE', "Der Auto-Versand ist in unserem {!MT_WORD!} derzeit aktiviert. Ihr Mailbuchung wurde aktiviert und wird bald automatisch versant."); +// Repay deleted mails constants +define('ADMIN_CFG_REPAY_POINTS_REPAY', "Dem Mitglied gutschreiben"); +define('ADMIN_CFG_REPAY_POINTS_JACKPOT', "In den Jackpot legen"); +define('ADMIN_CFG_REPAY_POINTS_NEVER', "Nicht gutschreiben (verfällt dann)"); +define('ADMIN_REPAY_ON_DELETE_MODE', "Wie sollen {!POINTS!} von gelöschten Mails verbucht werden?"); + // ?> diff --git a/inc/modules/admin/action-task.php b/inc/modules/admin/action-task.php index 08c5eaa5ff..692d4f0d36 100644 --- a/inc/modules/admin/action-task.php +++ b/inc/modules/admin/action-task.php @@ -32,10 +32,12 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); +} elseif (!EXT_IS_ACTIVE("task")) { + ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "task"); + return; } // Add description as navigation point diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 605f525a1b..bdd3334894 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -47,7 +47,8 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) array(GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__); // We currently don't want to install an extension so let's find out if we need... - $EXT_LOAD_MODE = "register"; $JOBS_DONE = true; + $EXT_LOAD_MODE = "register"; + $JOBS_DONE = true; // Open the extension directory $handle = opendir(PATH."inc/extensions/") or mxchange_die("Cannot read extension directory!"); @@ -80,14 +81,15 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) // Is the extension not yet installed? if ((SQL_NUMROWS($result) == 0) && (empty($ext_ver))) { + // Generate subject line + $ext_subj = sprintf("[%s:]", $ext); + // Not installed and do we have created a task for the admin? - $ext_subj = "[".$ext.":] ".ADMIN_NEW_EXT_SUBJ; //* DEBUG: */ echo $ext.":".$ext_ver."="; - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE subject='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `id` FROM `"._MYSQL_PREFIX."_task_system` WHERE `subject` LIKE '%s%%' LIMIT 1", array($ext_subj), __FILE__, __LINE__); //* DEBUG: */ echo SQL_NUMROWS($result)."
\n"; - if ((SQL_NUMROWS($result) == 0) && (GET_EXT_VERSION($ext) == "")) - { + if ((SQL_NUMROWS($result) == 0) && (GET_EXT_VERSION($ext) == "")) { // Template file $tpl = sprintf("%stemplates/%s/html/ext/ext_%s.tpl", PATH, @@ -96,25 +98,22 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) ); // Load text for task - if ((file_exists($tpl)) && (is_readable($tpl))) - { + if ((file_exists($tpl)) && (is_readable($tpl))) { // Load extension's own text template (HTML!) $MSG = LOAD_TEMPLATE("ext_".$ext, true); - } - else - { + } else { // Load default message $MSG = LOAD_EMAIL_TEMPLATE("admin_new_ext","", 0); } // Task not created so it's a brand-new extension which we need to register and create a task for! - $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (assigned_admin, userid, status, task_type, subject, text, task_created) + $result_insert = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (assigned_admin, userid, status, task_type, subject, text, task_created) VALUES ('%s', '0', 'NEW', 'EXTENSION', '%s', '%s', UNIX_TIMESTAMP())", - array( - GET_ADMIN_ID(get_session('admin_login')), - $ext_subj, - addslashes($MSG), -), __FILE__, __LINE__, true, false); + array( + GET_ADMIN_ID(get_session('admin_login')), + $ext_subj, + addslashes($MSG), + ), __FILE__, __LINE__, true, false); } // Free memory @@ -122,12 +121,9 @@ VALUES ('%s', '0', 'NEW', 'EXTENSION', '%s', '%s', UNIX_TIMESTAMP())", // We maybe want to install an extension so let's test-drive it... include(PATH."inc/extensions/".$file); - } - else - { + } else { // Maybe we want to update? - if ((empty($cacheArray['extensions']['ext_version'][$ext])) && (SQL_NUMROWS($result) == 1)) - { + if ((empty($cacheArray['extensions']['ext_version'][$ext])) && (SQL_NUMROWS($result) == 1)) { list($dummy, $ext_ver) = SQL_FETCHROW($result); SQL_FREERESULT($result); } @@ -135,11 +131,9 @@ VALUES ('%s', '0', 'NEW', 'EXTENSION', '%s', '%s', UNIX_TIMESTAMP())", // Update extension if (!empty($ext_ver)) EXTENSION_UPDATE($file, $ext, $ext_ver); - if (!empty($cacheArray['active_extensions'][$ext])) - { + if (!empty($cacheArray['active_extensions'][$ext])) { // Maybe we want to keept the current extension active? - if (($cacheArray['active_extensions'][$ext] == 'Y') && (!EXT_IS_ACTIVE($ext, true, true))) - { + if (($cacheArray['active_extensions'][$ext] == 'Y') && (!EXT_IS_ACTIVE($ext, true, true))) { // Reactivate this extension! $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_extensions SET ext_active='Y' WHERE ext_name='%s' LIMIT 1", array($ext), __FILE__, __LINE__); @@ -159,46 +153,47 @@ FROM "._MYSQL_PREFIX."_task_system WHERE assigned_admin='%s' OR (assigned_admin='0' AND status='NEW') ORDER BY userid DESC, task_type DESC, subject, task_created DESC", array(GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__); - if (SQL_NUMROWS($result_tasks) > 0) - { + + if (SQL_NUMROWS($result_tasks) > 0) { // New jobs found! $JOBS_DONE = false; } + // Free the result + SQL_FREERESULT($result); + + // Return status return $JOBS_DONE; } + // -function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) -{ +function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) { global $_CONFIG, $NOTES; - if ((isset($_POST['assign'])) && (count($_POST['task']) > 0)) - { + if ((isset($_POST['assign'])) && (count($_POST['task']) > 0)) { // Assign / do tasks $OUT = ""; $SW = 2; - foreach ($_POST['task'] as $id=>$sel) - { + foreach ($_POST['task'] as $id=>$sel) { $result_task = SQL_QUERY_ESC("SELECT id, userid, task_type, subject, text, task_created, status, assigned_admin FROM "._MYSQL_PREFIX."_task_system WHERE id=%d AND (assigned_admin='%s' OR (assigned_admin='0' AND status='NEW')) LIMIT 1", array(bigintval($id), GET_ADMIN_ID(get_session('admin_login'))), __FILE__, __LINE__); - if (SQL_NUMROWS($result_task) == 1) - { + if (SQL_NUMROWS($result_task) == 1) { // Task is valid... list($tid, $uid, $type, $subj, $text, $created, $status, $aid) = SQL_FETCHROW($result_task); SQL_FREERESULT($result_task); - if ($aid == "0") - { + + if ($aid == "0") { // Assgin current admin to unassgigned task $result_assign = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET assigned_admin='%s' WHERE id=%d LIMIT 1", array(GET_ADMIN_ID(get_session('admin_login')), bigintval($tid)), __FILE__, __LINE__); } + $ADD = ""; - if ($type == "SUPPORT_MEMBER") - { + if ($type == "SUPPORT_MEMBER") { $mode = substr($text, 0, strpos($text, ":")); $text = substr($text, strpos($text, ":") + 1); $ADD = "
  • ".ADMIN_TASK_SUPPORT_MODE.": ".$mode."
  • "; } - if ($uid > 0) - { + + if ($uid > 0) { $result_user = SQL_QUERY_ESC("SELECT sex, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); if (SQL_NUMROWS($result_user) == 1) @@ -217,11 +212,9 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) $title = TASK_NO_TITLE; // Shall I list SQL commands assigned to an extension installation or update task? - if (((GET_EXT_VERSION("sql_patches") != '') && ($_CONFIG['verbose_sql'] == 'Y')) || (!EXT_IS_ACTIVE("sql_patches"))) - { + if (((GET_EXT_VERSION("sql_patches") != '') && ($_CONFIG['verbose_sql'] == 'Y')) || (!EXT_IS_ACTIVE("sql_patches"))) { $ext_name = substr($subj, 1, strpos($subj, ":") - 1); - if ($type == "EXTENSION") - { + if ($type == "EXTENSION") { // Load SQL commands for registering $SQLs = EXTENSION_REGISTER($ext_name, $id, true); @@ -230,9 +223,7 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) // Set title $title = ADMIN_SQLS_EXECUTED_ON_REGISTER; - } - elseif ($type == "EXTENSION_UPDATE") - { + } elseif ($type == "EXTENSION_UPDATE") { // Load SQL commands for update (already done!) $ext_name = substr($ext_name, 7); $ext_name = substr($ext_name, 0, strpos($ext_name, "-")); @@ -248,9 +239,7 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) // Set title $title = ADMIN_SQLS_EXECUTED_ON_UPDATE; - } - else - { + } else { // Remove extension's name $ext_name = ""; } @@ -262,9 +251,7 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) // Add verbose SQL table $text .= EXTENSION_VERBOSE_TABLE($SQLs, $title, " class=\"admin_table top2 left2 right2\"", true, "100%")."
    \n"; } - } - else - { + } else { // Run SQL commands in dry mode but only return the notes $SQLs = EXTENSION_UPDATE("ext-".$ext_name.".php", $ext_name, $ext_ver, true); $text .= $NOTES; @@ -292,16 +279,13 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) array($ext_name), __FILE__, __LINE__); $lines = SQL_NUMROWS($result_lines); SQL_FREERESULT($result_lines); - if ($lines == "0") - { + if ($lines == "0") { // New extension found $OUT .= LOAD_TEMPLATE("admin_ext_reg_form", true, array( 'id' => bigintval($id), 'ext_name' => $ext_name )); - } - else - { + } else { // Task is closed so nothing is todo $OUT .= "".ADMIN_EXT_ALREADY_REGISTERED."\n"; @@ -319,8 +303,7 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) $OUT .= "".ADMIN_EXTENSION_UPDATED."\n"; // Close task - if (($status != "CLOSED") && ($status != "DELETED")) - { + if (($status != "CLOSED") && ($status != "DELETED")) { $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET status='SOLVED' WHERE id=%d LIMIT 1", array(bigintval($tid)), __FILE__, __LINE__); } diff --git a/inc/modules/admin/what-config_order.php b/inc/modules/admin/what-config_order.php index 73fc2f7232..c864f160ed 100644 --- a/inc/modules/admin/what-config_order.php +++ b/inc/modules/admin/what-config_order.php @@ -40,13 +40,10 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { // Save data ADMIN_SAVE_SETTINGS($_POST); -} - else -{ +} else { // Prepare constants for the template switch ($_CONFIG['order_max']) { @@ -90,6 +87,26 @@ if (isset($_POST['ok'])) define('_CFG_TEST_TEXT_Y', ' checked'); } + switch ($_CONFIG['repay_deleted_mails']) { + case "REPAY": + define('_CFG_REPAY_POINTS_REPAY' , " selected=\"selected\""); + define('_CFG_REPAY_POINTS_JACKPOT', ""); + define('_CFG_REPAY_POINTS_NONE' , ""); + break; + + case "JACKPOT": + define('_CFG_REPAY_POINTS_REPAY' , ""); + define('_CFG_REPAY_POINTS_JACKPOT', " selected=\"selected\""); + define('_CFG_REPAY_POINTS_NONE' , ""); + break; + + case "NONE": + define('_CFG_REPAY_POINTS_REPAY' , ""); + define('_CFG_REPAY_POINTS_JACKPOT', ""); + define('_CFG_REPAY_POINTS_NONE' , " selected=\"selected\""); + break; + } + if ($_CONFIG['test_subj'] == 'N') { define('_CFG_TEST_SUBJ_N', ' checked'); define('_CFG_TEST_SUBJ_Y', ""); diff --git a/inc/modules/admin/what-del_email.php b/inc/modules/admin/what-del_email.php index d573eb6b2c..635b6443e9 100644 --- a/inc/modules/admin/what-del_email.php +++ b/inc/modules/admin/what-del_email.php @@ -92,7 +92,7 @@ WHERE s.pool_id=%d LIMIT 1", SQL_FREERESULT($result); // Shall we pay the points back to the user? - if ($_CONFIG['repay_deleted_mails'] == "Y") { + if ($_CONFIG['repay_deleted_mails'] != "NEVER") { // Get all user links $result = SQL_QUERY_ESC("SELECT COUNT(id) AS 'cnt' FROM "._MYSQL_PREFIX."_user_links WHERE stats_id=%d", array(bigintval($stats_id)), __FILE__, __LINE__); @@ -107,6 +107,12 @@ WHERE s.pool_id=%d LIMIT 1", $totalPoints = $links * $price; //* DEBUG: */ echo $stats_id.":".$totalPoints."/".$links."/".$price."
    \n"; if ($totalPoints > 0) { + // Shall we payback to user or jackpot? + if ($_CONFIG['repay_deleted_mails'] == "JACKPOT") { + // Set jackpot + $sender = 0; + } + // Pay back points //* DEBUG: */ echo "PAYBACK:".$sender."
    \n"; ADD_POINTS_REFSYSTEM($sender, $totalPoints, true, "0", false,"direct"); diff --git a/inc/modules/admin/what-del_task.php b/inc/modules/admin/what-del_task.php index ed8e7187fa..c04777e4e9 100644 --- a/inc/modules/admin/what-del_task.php +++ b/inc/modules/admin/what-del_task.php @@ -32,14 +32,16 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); +} elseif (!EXT_IS_ACTIVE("task")) { + ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "task"); + return; } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); -OUTPUT_HTML("

    "); // ?> diff --git a/inc/modules/admin/what-list_task.php b/inc/modules/admin/what-list_task.php index 7587438b11..a4c2c82f76 100644 --- a/inc/modules/admin/what-list_task.php +++ b/inc/modules/admin/what-list_task.php @@ -32,11 +32,14 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); +} elseif (!EXT_IS_ACTIVE("task")) { + ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "task"); + return; } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-overview.php b/inc/modules/admin/what-overview.php index 44991b3b28..799cae84f1 100644 --- a/inc/modules/admin/what-overview.php +++ b/inc/modules/admin/what-overview.php @@ -44,23 +44,23 @@ ADD_DESCR("admin", basename(__FILE__)); require_once(PATH."inc/modules/admin/overview-inc.php"); $JOBS_DONE = true; +$taskExt = false; // Default is that "task" is not installed + // When the admin is logging in check several things first (new jobs to complete and so on) if ($GLOBALS['action'] == "login") { - if ((EXT_IS_ACTIVE("task")) && (function_exists('OUTPUT_ADVANCED_OVERVIEW'))) - { + if ((EXT_IS_ACTIVE("task")) && (function_exists('OUTPUT_ADVANCED_OVERVIEW'))) { // When task extension is registered output advanced overview page $JOBS_DONE = OUTPUT_ADVANCED_OVERVIEW($result_tasks); // This function is provided by the extension 'task' - } - else - { + $taskExt = true; + } else { // Output standart overview (provided by overview-inc.php) $JOBS_DONE = OUTPUT_STANDARD_OVERVIEW($result_tasks); } } -// Do we have new jobs or not? -if ($JOBS_DONE) -{ + +// Are there jobs to be done? +if ($JOBS_DONE) { // Generate overview of all main menus global $menuDesription, $FATAL; if ((is_array($menuDesription)) && (sizeof($menuDesription) > 0)) { @@ -80,7 +80,13 @@ if ($JOBS_DONE) // Load base template LOAD_TEMPLATE("admin_menu_hints", false, $OUT); } -} elseif (!EXT_IS_ACTIVE("task")) { +} elseif (!$taskExt) { + if (EXT_IS_ACTIVE("task")) { + // Output warning message + LOAD_TEMPLATE("admin_settings_saved", false, sprintf(EXTENSION_WARNING_EXT_INACTIVE, "task")); + OUTPUT_HTML("
    "); + } + // List selected tasks on overview when task management is not active OUTPUT_SELECTED_TASKS($_POST, $result_tasks); } diff --git a/templates/de/html/admin/admin_config_order.tpl b/templates/de/html/admin/admin_config_order.tpl index b0f988e8e6..d5f79b0646 100644 --- a/templates/de/html/admin/admin_config_order.tpl +++ b/templates/de/html/admin/admin_config_order.tpl @@ -117,6 +117,24 @@   + +   + + + +   + {--ADMIN_REPAY_ON_DELETE_MODE--} +   + + + +   + +   @@ -145,11 +163,12 @@   {--ADMIN_ORDER_SELECTION_MODE--}:   - + + +   -- 2.30.2