summaryrefslogtreecommitdiff
path: root/controllers
diff options
context:
space:
mode:
authorFrédéric Guillot <contact@fredericguillot.com>2014-02-25 22:09:44 -0500
committerFrédéric Guillot <contact@fredericguillot.com>2014-02-25 22:09:44 -0500
commit44b18060834b0afad7c875d32ea162c9f6e31621 (patch)
treef0e4f726fffc7a2c36f387083f6c9c7958386164 /controllers
parent44fc9c081fb7561b7b02115f9b2a6eb0349d2201 (diff)
Add task limit for each column
Diffstat (limited to 'controllers')
-rw-r--r--controllers/base.php5
-rw-r--r--controllers/board.php21
2 files changed, 14 insertions, 12 deletions
diff --git a/controllers/base.php b/controllers/base.php
index c7e59b18..a59220d3 100644
--- a/controllers/base.php
+++ b/controllers/base.php
@@ -67,9 +67,8 @@ abstract class Base
$language = $this->config->get('language', 'en_US');
if ($language !== 'en_US') \Translator\load($language);
- //set timezone
- $timezone = $this->config->get('timezone', 'UTC');
- date_default_timezone_set($timezone);
+ // Set timezone
+ date_default_timezone_set($this->config->get('timezone', 'UTC'));
$this->response->csp();
$this->response->nosniff();
diff --git a/controllers/board.php b/controllers/board.php
index 29633a14..a0f00367 100644
--- a/controllers/board.php
+++ b/controllers/board.php
@@ -119,11 +119,12 @@ class Board extends Base
if (! $project) $this->notfound();
- $columns = $this->board->getColumnsList($project_id);
+ $columns = $this->board->getColumns($project_id);
$values = array();
- foreach ($columns as $column_id => $column_title) {
- $values['title['.$column_id.']'] = $column_title;
+ foreach ($columns as $column) {
+ $values['title['.$column['id'].']'] = $column['title'];
+ $values['task_limit['.$column['id'].']'] = $column['task_limit'] ?: null;
}
$this->response->html($this->template->layout('board_edit', array(
@@ -146,19 +147,21 @@ class Board extends Base
if (! $project) $this->notfound();
- $columns = $this->board->getColumnsList($project_id);
+ $columns = $this->board->getColumns($project_id);
$data = $this->request->getValues();
- $values = array();
+ $values = $columns_list = array();
- foreach ($columns as $column_id => $column_title) {
- $values['title['.$column_id.']'] = isset($data['title'][$column_id]) ? $data['title'][$column_id] : '';
+ foreach ($columns as $column) {
+ $columns_list[$column['id']] = $column['title'];
+ $values['title['.$column['id'].']'] = isset($data['title'][$column['id']]) ? $data['title'][$column['id']] : '';
+ $values['task_limit['.$column['id'].']'] = isset($data['task_limit'][$column['id']]) ? $data['task_limit'][$column['id']] : 0;
}
- list($valid, $errors) = $this->board->validateModification($columns, $values);
+ list($valid, $errors) = $this->board->validateModification($columns_list, $values);
if ($valid) {
- if ($this->board->update($data['title'])) {
+ if ($this->board->update($data)) {
$this->session->flash(t('Board updated successfully.'));
$this->response->redirect('?controller=board&action=edit&project_id='.$project['id']);
}