summaryrefslogtreecommitdiff
path: root/models/board.php
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 /models/board.php
parent44fc9c081fb7561b7b02115f9b2a6eb0349d2201 (diff)
Add task limit for each column
Diffstat (limited to 'models/board.php')
-rw-r--r--models/board.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/models/board.php b/models/board.php
index d213f257..1a5b8b81 100644
--- a/models/board.php
+++ b/models/board.php
@@ -61,8 +61,10 @@ class Board extends Base
{
$this->db->startTransaction();
- foreach ($values as $column_id => $column_title) {
- $this->db->table(self::TABLE)->eq('id', $column_id)->update(array('title' => $column_title));
+ foreach (array('title', 'task_limit') as $field) {
+ foreach ($values[$field] as $column_id => $field_value) {
+ $this->db->table(self::TABLE)->eq('id', $column_id)->update(array($field => $field_value));
+ }
}
$this->db->closeTransaction();
@@ -140,6 +142,8 @@ class Board extends Base
$rules = array();
foreach ($columns as $column_id => $column_title) {
+ $rules[] = new Validators\Integer('task_limit['.$column_id.']', t('This value must be an integer'));
+ $rules[] = new Validators\GreaterThan('task_limit['.$column_id.']', t('This value must be greater than %d', 0), 0);
$rules[] = new Validators\Required('title['.$column_id.']', t('The title is required'));
$rules[] = new Validators\MaxLength('title['.$column_id.']', t('The maximum length is %d characters', 50), 50);
}