예제 #1
0
function task_breaker_transaction_add_ticket()
{
    $task = new ThriveProjectTasksController();
    $task_id = $task->addTicket($_POST);
    if (!task_breaker_can_add_task((int) $_POST['project_id'])) {
        task_breaker_api_message(array('message' => 'fail', 'response' => __('Unable to add tasks. Only a group administrator or a group moderator can add tasks.', ' task_breaker')));
    }
    if ($task_id) {
        task_breaker_api_message(array('message' => 'success', 'response' => array('id' => $task_id), 'stats' => $task->getTaskStatistics((int) $_POST['project_id'])));
    } else {
        task_breaker_api_message(array('message' => 'fail', 'response' => __('There was an error trying to add this task.
				Title and Description fields are required or there was
				an unexpected error.', ' task_breaker')));
    }
    return;
}