From 45c95d74fc2115fe4cc7214553c0927d3ce9df8d Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 2 Jan 2015 21:11:19 -0500 Subject: Various fixes and improvements --- app/Controller/Board.php | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'app/Controller/Board.php') diff --git a/app/Controller/Board.php b/app/Controller/Board.php index 128d9215..48f2b518 100644 --- a/app/Controller/Board.php +++ b/app/Controller/Board.php @@ -198,11 +198,10 @@ class Board extends Base * * @access public */ - public function edit() + public function edit(array $values = array(), array $errors = array()) { $project = $this->getProject(); $columns = $this->board->getColumns($project['id']); - $values = array(); foreach ($columns as $column) { $values['title['.$column['id'].']'] = $column['title']; @@ -210,7 +209,7 @@ class Board extends Base } $this->response->html($this->projectLayout('board/edit', array( - 'errors' => array(), + 'errors' => $errors, 'values' => $values + array('project_id' => $project['id']), 'columns' => $columns, 'project' => $project, @@ -249,13 +248,7 @@ class Board extends Base } } - $this->response->html($this->projectLayout('board/edit', array( - 'errors' => $errors, - 'values' => $values + array('project_id' => $project['id']), - 'columns' => $columns, - 'project' => $project, - 'title' => t('Edit board') - ))); + $this->edit($values, $errors); } /** @@ -287,13 +280,7 @@ class Board extends Base } } - $this->response->html($this->projectLayout('board/edit', array( - 'errors' => $errors, - 'values' => $values + $data, - 'columns' => $columns, - 'project' => $project, - 'title' => t('Edit board') - ))); + $this->edit($values, $errors); } /** -- cgit v1.2.3