X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_task.php;h=8835316d6f52b0ab889ac7464e5b21c6dff3672c;hp=06ae256575dd9a0e1a0899d360b2f283b7fb40ae;hb=2f0357c7ac9da6c17d361b8e7cb0b1ad09eb85f6;hpb=b8c86fa12322603c24a88ea2b0fd3dbeba612752 diff --git a/inc/modules/admin/what-list_task.php b/inc/modules/admin/what-list_task.php index 06ae256575..8835316d6f 100644 --- a/inc/modules/admin/what-list_task.php +++ b/inc/modules/admin/what-list_task.php @@ -10,7 +10,12 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Alle Aufgaben auflisten * * -------------------------------------------------------------------- * - * * + * $Revision:: $ * + * $Date:: $ * + * $Tag:: 0.2.1-FINAL $ * + * $Author:: $ * + * Needs to be in all Files and every File needs "svn propset * + * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2008 by Roland Haeder * * For more information visit: http://www.mxchange.org * @@ -33,17 +38,17 @@ // Some security stuff... if ((!defined('__SECURITY')) || (!IS_ADMIN())) { - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; + $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php'; require($INC); -} elseif (!EXT_IS_ACTIVE("task")) { - addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "task"); +} elseif (!EXT_IS_ACTIVE('task')) { + addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'task')); return; } // Add description as navigation point -ADD_DESCR("admin", __FILE__); +ADD_DESCR('admin', __FILE__); -$whereStatement = ""; +$whereStatement = ''; if (!REQUEST_ISSET_GET(('type'))) REQUEST_SET_GET('type', "your"); switch (REQUEST_GET('type')) @@ -74,7 +79,7 @@ case "closed": // List all closed default: // Unknown type DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", REQUEST_GET('type'))); - LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('ADMIN_TASK_UNKNOWN_MODE'), REQUEST_GET('type'))); + LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_TASK_UNKNOWN_MODE'), REQUEST_GET('type'))); break; } @@ -85,7 +90,7 @@ if (!empty($whereStatement)) { if ((REQUEST_ISSET_POST(('assign'))) && ($SEL > 0)) { // Assign / do tasks LOAD_INC_ONCE("inc/modules/admin/overview-inc.php"); - if (empty($dmy)) $dmy = ""; + if (empty($dmy)) $dmy = ''; OUTPUT_SELECTED_TASKS(REQUEST_POST_ARRAY(), $dmy); } else { // Start listing tasks matching selected filter @@ -101,7 +106,7 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin=0 WHERE id=%s AND assigned_admin=%s LIMIT 1", array(bigintval($id), GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__); } - } elseif (REQUEST_ISSET_POST(('del'))) { + } elseif (REQUEST_ISSET_POST('del')) { // Delete tasks foreach (REQUEST_POST('task') as $id => $sel) { if (REQUEST_GET('type') == "deleted") { @@ -120,58 +125,59 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L } // There are uncompleted jobs! - $type = constant('ADMIN_OVERVIEW_TASK_'.strtoupper(REQUEST_GET('type')).'_TYPE'); + $type = getMessage('ADMIN_OVERVIEW_TASK_'.strtoupper(REQUEST_GET('type')).'_TYPE'); + // @TODO Rewrite these templates to one and add $OUT LOAD_TEMPLATE("admin_overview_header_task", false, array( 'message' => $type, 'type' => REQUEST_GET('type') )); - $SW = 2; - while (list($id, $admin, $uid, $type, $subj, $text, $created) = SQL_FETCHROW($result_tasks)) { + $OUT = ''; $SW = 2; + while ($content = SQL_FETCHARRAY($result_tasks)) { // Init infos - $infos = "---"; + $content['infos'] = '---'; // Generate link - $admin = GENERATE_AID_LINK($admin); + $content['assigned_admin'] = GENERATE_AID_LINK($content['assigned_admin']); // Get admin task - $type_out = constant('ADMIN_TASK_IS_'.strtoupper($type).''); + $content['task_type_msg'] = getMessage('ADMIN_TASK_IS_'.strtoupper($content['task_type']).''); - $type2 = substr($text, 0, strpos($text, ":")); // Generate infos - switch ($type) + switch ($content['task_type']) { case "EXTENSION": case "EXTENSION_UPDATE": - $infos = substr($subj, 1, strpos($subj, ":") - 1); + $content['infos'] = substr($content['subject'], 1, strpos($content['subject'], ":") - 1); break; } // Member assigned with task? - if ($uid > 0) { + if ($content['userid'] > 0) { // Member found otherwise it's a system task - $uid = ADMIN_USER_PROFILE_LINK($uid); + $content['userid'] = ADMIN_USER_PROFILE_LINK($content['userid']); } else { // Is a system task! - $uid = "".ADMIN_IS_SYSTEM_TASK.""; + $content['userid'] = "{--ADMIN_IS_SYSTEM_TASK--}"; } // Prepare content - $content = array( + // @TODO Rewritings: admin->assigned_admin,uid->userid,type->task_type_msg in template + $content = merge_array($content, array( 'sw' => $SW, - 'id' => $id, - 'admin' => $admin, - 'infos' => $infos, - 'uid' => $uid, - 'type' => $type_out, - 'created' => MAKE_DATETIME($created, "2") - ); + 'admin' => $content['assigned_admin'], + 'uid' => $content['userid'], + 'type' => $content['task_type_msg'], + 'created' => MAKE_DATETIME($content['task_created'], "2") + )); // Do we have an extension task? - if (($type == "EXTENSION") && (GET_EXT_VERSION($infos) == "")) { + if (($content['task_type'] == "EXTENSION") && (GET_EXT_VERSION($content['infos']) == "")) { // Load extension row template + // @TODO Rewrite this to $OUT .= ..., true, ... LOAD_TEMPLATE("admin_list_task_ext_rows", false, $content); } else { // Load default row template + // @TODO Rewrite this to $OUT .= ..., true, ... LOAD_TEMPLATE("admin_list_task_rows", false, $content); } @@ -183,13 +189,10 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L SQL_FREERESULT($result_tasks); // Load footer template - if (REQUEST_GET('type') == "deleted") - { + if (REQUEST_GET('type') == "deleted") { // Delete now button LOAD_TEMPLATE("admin_overview_footer_task"); - } - else - { + } else { // Normal footer LOAD_TEMPLATE("admin_overview_footer"); }