Esempio n. 1
0
 /**
  * Display the template show task (common between different actions)
  *
  * @access protected
  * @param  array  $task               Task data
  * @param  array  $comment_form       Comment form data
  * @param  array  $description_form   Description form data
  * @param  array  $comment_edit_form  Comment edit form data
  */
 protected function showTask(array $task, array $comment_form = array(), array $description_form = array(), array $comment_edit_form = array())
 {
     if (empty($comment_form)) {
         $comment_form = array('values' => array('task_id' => $task['id'], 'user_id' => $this->acl->getUserId()), 'errors' => array());
     }
     if (empty($description_form)) {
         $description_form = array('values' => array('id' => $task['id']), 'errors' => array());
     }
     if (empty($comment_edit_form)) {
         $comment_edit_form = array('values' => array('id' => 0), 'errors' => array());
     } else {
         $hide_comment_form = true;
     }
     $this->response->html($this->template->layout('task_show', array('hide_comment_form' => isset($hide_comment_form), 'comment_edit_form' => $comment_edit_form, 'comment_form' => $comment_form, 'description_form' => $description_form, 'comments' => $this->comment->getAll($task['id']), 'task' => $task, 'columns_list' => $this->board->getColumnsList($task['project_id']), 'colors_list' => $this->task->getColors(), 'menu' => 'tasks', 'title' => $task['title'])));
 }