$sel) { SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=NULL WHERE `id`=%s AND `assigned_admin`=%s LIMIT 1", array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__); } // END - foreach } elseif (isFormSent('delete')) { // Delete tasks foreach (postRequestParameter('sel') as $id => $sel) { if (getRequestParameter('type') == 'deleted') { // Delete task immediately SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s LIMIT 1", array(bigintval($id)),__FILE__, __LINE__); } else { // Mark task as to be deleted (purged by autopurge extension) adminDeleteTask($id); } } // END - foreach } else { // Unknown action performed debug_report_bug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=
%s
", print_r(postRequestArray(), true))); } // Update query $result_tasks = SQL_QUERY('SELECT `id`, `assigned_admin`, `userid`, `task_type`, `subject`, `text`, `task_created` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE '.$whereStatement.' ORDER BY `subject` ASC, `task_created` DESC', __FILE__, __LINE__); } // There are uncompleted jobs! $OUT = ''; while ($content = SQL_FETCHARRAY($result_tasks)) { // Init infos $content['infos'] = ''; // Generate infos switch ($content['task_type']) { case 'EXTENSION': case 'EXTENSION_UPDATE': $content['infos'] = substr($content['subject'], 1, strpos($content['subject'], ':') - 1); break; } // END - switch // Member assigned with task? if (isValidUserId($content['userid'])) { // Member found otherwise it's a system task $content['userid'] = generateUserProfileLink($content['userid']); } else { // Is a system task! $content['userid'] = '{--ADMIN_IS_SYSTEM_TASK--}'; } // Prepare content $content = merge_array($content, array( 'task_created' => generateDateTime($content['task_created'], 2) )); // Do we have an extension task? if (isExtensionTask($content)) { // Load extension row template $OUT .= loadTemplate('admin_list_task_ext_rows', true, $content); } else { // Load default row template $OUT .= loadTemplate('admin_list_task_rows', true, $content); } } // 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_list_task_delete', false, $content); } else { // Normal footer loadTemplate('admin_list_task', false, $content); } } } // END - if // [EOF] ?>