Example #1
0
<?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 = '';
            ?>
Example #2
0
function task_breaker_transaction_renew_task()
{
    $task_id = (int) filter_input(INPUT_POST, 'task_id', FILTER_VALIDATE_INT);
    $args = array('message' => 'success', 'task_id' => 0);
    $task = new ThriveProjectTasksController();
    $task_id = $task->renewTask($task_id);
    if ($task_id) {
        $args['message'] = 'success';
        $args['task_id'] = $task_id;
    } else {
        $args['message'] = 'fail';
    }
    task_breaker_api_message($args);
}
Example #3
0
/**
 * Renders the tasks
 * @param  array $args The post type configs
 * @return void
 */
function task_breaker_the_tasks($args)
{
    ob_start();
    require_once plugin_dir_path(__FILE__) . '../controllers/tasks.php';
    $config = array('project_id' => 0, 'page' => 1, 'priority' => -1, 'search' => '', 'orderby' => 'date_created', 'order' => 'desc', 'show_completed' => 'no', 'echo' => true);
    foreach ($config as $option => $value) {
        if (!empty($args[$option])) {
            ${$option} = $args[$option];
        } else {
            ${$option} = $value;
        }
    }
    $task_breaker_tasks = new ThriveProjectTasksController();
    $tasks = $task_breaker_tasks->renderTasks($args);
    // Fallback to default values when there are no tasks.
    if (empty($tasks)) {
        // Default parameters.
        $tasks = array('stats' => array('total' => 0, 'perpage' => 5, 'current_page' => 1, 'total_page' => 1, 'min_page' => 0, 'max_page' => 0));
    }
    $tasks['project_id'] = $project_id;
    ?>

<div class="clearfix"></div>

<div id="task_breaker-project-tasks">

	<?php 
    task_breaker_locate_template('task-loop', $tasks);
    ?>

</div><!--#task_breaker-project-tasks-->

<?php 
    return ob_get_clean();
}