X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_task.php;h=23b861328989e8a92d74ac82141388b2d4c9f315;hb=98b92ea5ba992a63304091fa1b57f477befffc22;hp=97957c0b8bc0e36b824fc9844c81de862636bd63;hpb=32933a97e4462c232a794fc33bd91f01ff997cb9;p=mailer.git diff --git a/inc/modules/admin/what-list_task.php b/inc/modules/admin/what-list_task.php index 97957c0b8b..23b8613289 100644 --- a/inc/modules/admin/what-list_task.php +++ b/inc/modules/admin/what-list_task.php @@ -55,7 +55,7 @@ if (!isGetRequestParameterSet('type')) setGetRequestParameter('type', 'your'); switch (getRequestParameter('type')) { case 'your': // List only your own open (new) tasks - $whereStatement = "`assigned_admin`='".getCurrentAdminId()."' AND `status`='NEW' AND `task_type` != 'EXTENSION_UPDATE'"; + $whereStatement = "`assigned_admin`=".getCurrentAdminId()." AND `status`='NEW' AND `task_type` != 'EXTENSION_UPDATE'"; break; case 'updates': // List only updates assigned to you @@ -85,7 +85,7 @@ switch (getRequestParameter('type')) { } // END - switch if (!empty($whereStatement)) { - if ((isPostRequestParameterSet('assign')) && (countPostSelection() > 0)) { + if ((isPostRequestParameterSet('assign')) && (ifPostContainsSelections())) { // Assign / do tasks loadIncludeOnce('inc/modules/admin/overview-inc.php'); if (empty($dmy)) $dmy = ''; @@ -104,7 +104,7 @@ ORDER BY `subject` ASC, `task_created` DESC', __FILE__, __LINE__); - if ((countPostSelection() > 0) && (!isDemoModeActive())) { + if ((ifPostContainsSelections()) && (!isDemoModeActive())) { // Only unassign / delete tasks when there are selected tasks posted if (isPostRequestParameterSet('unassign')) { // Unassign from tasks @@ -142,22 +142,13 @@ ORDER BY } // There are uncompleted jobs! - $type = getMessage('ADMIN_OVERVIEW_TASK_'.strtoupper(getRequestParameter('type')).'_TYPE'); - // @TODO Rewrite these templates to one and add $OUT - loadTemplate('admin_overview_header_task', false, array( - 'message' => $type, - 'type' => getRequestParameter('type') - )); - $OUT = ''; $SW = 2; + $OUT = ''; while ($content = SQL_FETCHARRAY($result_tasks)) { // Init infos - $content['infos'] = '---'; - - // Generate link - $content['assigned_admin'] = generateAdminLink($content['assigned_admin']); + $content['infos'] = ''; // Get admin task - $content['task_type_msg'] = getMessage('ADMIN_TASK_IS_'.strtoupper($content['task_type']).''); + $content['task_type_msg'] = '{--ADMIN_TASK_IS_' . strtoupper($content['task_type']) . '--}'; // Generate infos switch ($content['task_type']) { @@ -177,40 +168,40 @@ ORDER BY } // Prepare content - // @TODO Rewritings: admin->assigned_admin,type->task_type_msg in template $content = merge_array($content, array( - 'sw' => $SW, - 'admin' => $content['assigned_admin'], - 'userid' => $content['userid'], - 'type' => $content['task_type_msg'], - 'created' => generateDateTime($content['task_created'], 2) + 'assign_admin' => $content['assigned_admin'], + 'userid' => $content['userid'], + 'task_type_msg' => $content['task_type_msg'], + 'task_created' => generateDateTime($content['task_created'], 2) )); // Do we have an extension task? - if (($content['task_type'] == 'EXTENSION') && (isExtensionNameValid($content['infos'])) && (!isExtensionInstalled($content['infos']))) { + if (isExtensionTask($content)) { // Load extension row template - // @TODO Rewrite this to $OUT .= ..., true, ... - loadTemplate('admin_list_task_ext_rows', false, $content); + $OUT .= loadTemplate('admin_list_task_ext_rows', true, $content); } else { // Load default row template - // @TODO Rewrite this to $OUT .= ..., true, ... - loadTemplate('admin_list_task_rows', false, $content); + $OUT .= loadTemplate('admin_list_task_rows', true, $content); } - - // Switch colors - $SW = 3 - $SW; } // END - while // Free memory SQL_FREERESULT($result_tasks); + // Prepare content + $content = array( + 'message' => '{--ADMIN_OVERVIEW_TASK_' . strtoupper(getRequestParameter('type')) . '_TYPE--}', + 'type' => getRequestParameter('type'), + 'rows' => $OUT + ); + // Load footer template if (getRequestParameter('type') == 'deleted') { // Delete now button - loadTemplate('admin_overview_footer_task'); + loadTemplate('admin_list_task_delete', false, $content); } else { // Normal footer - loadTemplate('admin_overview_footer'); + loadTemplate('admin_list_task', false, $content); } } } // END - if