<?php $tasks =& $args; ?> <?php $task_breaker_tasks = new ThriveProjectTasksController(); ?> <?php if (task_breaker_can_see_project_tasks(intval($tasks['project_id']))) { ?> <?php if (!empty($tasks['results'])) { ?> <ul class="project-tasks-results"> <?php foreach ($tasks['results'] as $task) { ?> <?php $priority_label = $task_breaker_tasks->getPriority($task->priority); ?> <?php $completed = ''; ?>
function task_breaker_transaction_fetch_task() { $task_id = (int) filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT); $page = (int) filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT); $project_id = (int) filter_input(INPUT_GET, 'project_id', FILTER_VALIDATE_INT); $priority = (int) filter_input(INPUT_GET, 'priority', FILTER_VALIDATE_INT); $search = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_URL); $show_completed = filter_input(INPUT_GET, 'show_completed', FILTER_SANITIZE_STRING); $callback_template = filter_input(INPUT_GET, 'template', FILTER_SANITIZE_STRING); $html_template = 'task_breaker_render_task'; $template = ''; if (!empty($callback_template) && function_exists($callback_template)) { $html_template = $callback_template; } if (!task_breaker_can_see_project_tasks($project_id)) { task_breaker_api_message(array('message' => 'fail', 'message_long' => __('Unable to access the task details. Only group members can access this page', 'task-breaker'), 'task' => array(), 'stats' => array(), 'debug' => __("Unauthorized Access", "task-breaker"), 'html' => "")); return; } $task = new ThriveProjectTasksController(); $args = array('project_id' => $project_id, 'id' => $task_id, 'page' => $page, 'priority' => $priority, 'search' => $search, 'show_completed' => $show_completed, 'orderby' => 'priority', 'order' => 'desc', 'echo' => 'no'); $task_collection = $task->renderTasks($args); // Push the ticket ID in the task_collection stack. $task_collection->task_id = absint($task_id); if (0 === $task_id) { $task_id = null; $template = $html_template($args); } else { if (!empty($callback_template)) { $template = $html_template($task_collection); } } $stats = array(); if (array_key_exists('stats', $task_collection)) { $stats = $task_collection['stats']; } task_breaker_api_message(array('message' => 'success', 'task' => $task_collection, 'stats' => $stats, 'debug' => $task_id, 'html' => $template)); return; }
<?php if (empty($args)) { return; } if (!empty($args->user)) { // Only allow members who has an access view to view the task. if (!task_breaker_can_see_project_tasks($args->project_id)) { ?> <div id="task_breaker-single-task"> <p class="info" id="message"> <?php _e("Unable to access the task details. Only group members can access this page.", "task-breaker"); ?> </p> </div> <?php return; } ?> <div id="task_breaker-single-task"> <div id="task_breaker-single-task-details"> <?php $priority_label = array('1' => __('Normal', 'task_breaker'), '2' => __('High', 'task_breaker'), '3' => __('Critical', 'task_breaker')); ?> <?php