summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorBusfreak <Busfreak@users.noreply.github.com>2016-07-05 17:09:13 +0200
committerFrédéric Guillot <fred@kanboard.net>2016-07-05 11:09:13 -0400
commit6ccd8c11faff4a8b5209b45c140d12f94d97449b (patch)
tree74fda85e7f5d1ab359e4aa77c8b944e92da59805 /app
parentb215296f971eaf35773218740d3d6696f8dc2310 (diff)
Hide tasks within specific columns in dashboard (#2424)
Diffstat (limited to 'app')
-rw-r--r--app/Controller/ColumnController.php4
-rw-r--r--app/Locale/bs_BA/translations.php1
-rw-r--r--app/Locale/cs_CZ/translations.php1
-rw-r--r--app/Locale/da_DK/translations.php1
-rw-r--r--app/Locale/de_DE/translations.php1
-rw-r--r--app/Locale/el_GR/translations.php1
-rw-r--r--app/Locale/es_ES/translations.php1
-rw-r--r--app/Locale/fi_FI/translations.php1
-rw-r--r--app/Locale/fr_FR/translations.php1
-rw-r--r--app/Locale/hu_HU/translations.php1
-rw-r--r--app/Locale/id_ID/translations.php1
-rw-r--r--app/Locale/it_IT/translations.php1
-rw-r--r--app/Locale/ja_JP/translations.php1
-rw-r--r--app/Locale/ko_KR/translations.php1
-rw-r--r--app/Locale/my_MY/translations.php1
-rw-r--r--app/Locale/nb_NO/translations.php1
-rw-r--r--app/Locale/nl_NL/translations.php1
-rw-r--r--app/Locale/pl_PL/translations.php1
-rw-r--r--app/Locale/pt_BR/translations.php1
-rw-r--r--app/Locale/pt_PT/translations.php1
-rw-r--r--app/Locale/ru_RU/translations.php1
-rw-r--r--app/Locale/sr_Latn_RS/translations.php1
-rw-r--r--app/Locale/sv_SE/translations.php1
-rw-r--r--app/Locale/th_TH/translations.php1
-rw-r--r--app/Locale/tr_TR/translations.php1
-rw-r--r--app/Locale/zh_CN/translations.php1
-rw-r--r--app/Model/ColumnModel.php6
-rw-r--r--app/Model/TaskFinderModel.php3
-rw-r--r--app/Schema/Mysql.php7
-rw-r--r--app/Schema/Postgres.php7
-rw-r--r--app/Schema/Sql/mysql.sql1
-rw-r--r--app/Schema/Sql/postgres.sql1
-rw-r--r--app/Schema/Sqlite.php7
-rw-r--r--app/Template/column/create.php2
-rw-r--r--app/Template/column/edit.php2
-rw-r--r--app/Template/project_view/show.php10
36 files changed, 66 insertions, 9 deletions
diff --git a/app/Controller/ColumnController.php b/app/Controller/ColumnController.php
index 95fbcaaa..e3f9bfff 100644
--- a/app/Controller/ColumnController.php
+++ b/app/Controller/ColumnController.php
@@ -66,7 +66,7 @@ class ColumnController extends BaseController
list($valid, $errors) = $this->columnValidator->validateCreation($values);
if ($valid) {
- if ($this->columnModel->create($project['id'], $values['title'], $values['task_limit'], $values['description']) !== false) {
+ if ($this->columnModel->create($project['id'], $values['title'], $values['task_limit'], $values['description'], $values['hide_in_dashboard']) !== false) {
$this->flash->success(t('Column created successfully.'));
return $this->response->redirect($this->helper->url->to('ColumnController', 'index', array('project_id' => $project['id'])), true);
} else {
@@ -111,7 +111,7 @@ class ColumnController extends BaseController
list($valid, $errors) = $this->columnValidator->validateModification($values);
if ($valid) {
- if ($this->columnModel->update($values['id'], $values['title'], $values['task_limit'], $values['description'])) {
+ if ($this->columnModel->update($values['id'], $values['title'], $values['task_limit'], $values['description'], $values['hide_in_dashboard']) !== false) {
$this->flash->success(t('Board updated successfully.'));
return $this->response->redirect($this->helper->url->to('ColumnController', 'index', array('project_id' => $project['id'])));
} else {
diff --git a/app/Locale/bs_BA/translations.php b/app/Locale/bs_BA/translations.php
index 4213d10d..e3c29261 100644
--- a/app/Locale/bs_BA/translations.php
+++ b/app/Locale/bs_BA/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/cs_CZ/translations.php b/app/Locale/cs_CZ/translations.php
index 78df7ecc..ce66eee5 100644
--- a/app/Locale/cs_CZ/translations.php
+++ b/app/Locale/cs_CZ/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php
index bf595a01..f9bc0031 100644
--- a/app/Locale/da_DK/translations.php
+++ b/app/Locale/da_DK/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php
index aa80f781..d3192f46 100644
--- a/app/Locale/de_DE/translations.php
+++ b/app/Locale/de_DE/translations.php
@@ -1216,4 +1216,5 @@ return array(
'Global tags' => 'Globale Schlagwörter',
'There is no global tag at the moment.' => 'Es gibt zur Zeit kein globales Schlagwort',
'This field cannot be empty' => 'Dieses Feld kann nicht leer sein',
+ 'Hide tasks in this column in the Dashboard' => 'Aufgaben in dieser Spalte im Dashboard ausblenden',
);
diff --git a/app/Locale/el_GR/translations.php b/app/Locale/el_GR/translations.php
index d4c55040..745acaea 100644
--- a/app/Locale/el_GR/translations.php
+++ b/app/Locale/el_GR/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php
index 40c9a8c0..604a5e3e 100644
--- a/app/Locale/es_ES/translations.php
+++ b/app/Locale/es_ES/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php
index 58360ab0..73b65463 100644
--- a/app/Locale/fi_FI/translations.php
+++ b/app/Locale/fi_FI/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php
index 8684d1e9..9431846d 100644
--- a/app/Locale/fr_FR/translations.php
+++ b/app/Locale/fr_FR/translations.php
@@ -1217,4 +1217,5 @@ return array(
'Global tags' => 'Libellés globaux',
'There is no global tag at the moment.' => 'Il n\'y a aucun libellé global pour le moment.',
'This field cannot be empty' => 'Ce champ ne peut être vide',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php
index c80c0a20..9acdbd1a 100644
--- a/app/Locale/hu_HU/translations.php
+++ b/app/Locale/hu_HU/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/id_ID/translations.php b/app/Locale/id_ID/translations.php
index d3776515..d8c42cf4 100644
--- a/app/Locale/id_ID/translations.php
+++ b/app/Locale/id_ID/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php
index 3d02201c..9d2af814 100644
--- a/app/Locale/it_IT/translations.php
+++ b/app/Locale/it_IT/translations.php
@@ -1216,4 +1216,5 @@ return array(
'Global tags' => 'Tag globali',
'There is no global tag at the moment.' => 'Non sono definiti tag globali al momento.',
'This field cannot be empty' => 'Questo campo non può essere vuoto',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php
index 692afb78..9f6ab88f 100644
--- a/app/Locale/ja_JP/translations.php
+++ b/app/Locale/ja_JP/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/ko_KR/translations.php b/app/Locale/ko_KR/translations.php
index 75d6be43..f48b7486 100644
--- a/app/Locale/ko_KR/translations.php
+++ b/app/Locale/ko_KR/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/my_MY/translations.php b/app/Locale/my_MY/translations.php
index 94e94780..bad6d919 100644
--- a/app/Locale/my_MY/translations.php
+++ b/app/Locale/my_MY/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/nb_NO/translations.php b/app/Locale/nb_NO/translations.php
index cfd7ba1b..19372419 100644
--- a/app/Locale/nb_NO/translations.php
+++ b/app/Locale/nb_NO/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/nl_NL/translations.php b/app/Locale/nl_NL/translations.php
index 69f2b862..8ba0d394 100644
--- a/app/Locale/nl_NL/translations.php
+++ b/app/Locale/nl_NL/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ //' Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php
index 7c132bbd..09c247d8 100644
--- a/app/Locale/pl_PL/translations.php
+++ b/app/Locale/pl_PL/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php
index 343915b6..7659ba2b 100644
--- a/app/Locale/pt_BR/translations.php
+++ b/app/Locale/pt_BR/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/pt_PT/translations.php b/app/Locale/pt_PT/translations.php
index d9ea27be..1f9a7030 100644
--- a/app/Locale/pt_PT/translations.php
+++ b/app/Locale/pt_PT/translations.php
@@ -1216,4 +1216,5 @@ return array(
'Global tags' => 'Etiquetas globais',
'There is no global tag at the moment.' => 'De momento não existe nenhuma etiqueta global.',
// 'This field cannot be empty' => '',
+ //'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php
index 8e9fb7f1..5b182dbf 100644
--- a/app/Locale/ru_RU/translations.php
+++ b/app/Locale/ru_RU/translations.php
@@ -1216,4 +1216,5 @@ return array(
'Global tags' => 'Глобальные метка',
'There is no global tag at the moment.' => 'Нет глобальных меток.',
'This field cannot be empty' => 'Это поле не может быть пустым',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/sr_Latn_RS/translations.php b/app/Locale/sr_Latn_RS/translations.php
index 00e607fd..7aec7142 100644
--- a/app/Locale/sr_Latn_RS/translations.php
+++ b/app/Locale/sr_Latn_RS/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php
index 88db5d63..bce1ccfb 100644
--- a/app/Locale/sv_SE/translations.php
+++ b/app/Locale/sv_SE/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php
index fd35d28c..48a0b3de 100644
--- a/app/Locale/th_TH/translations.php
+++ b/app/Locale/th_TH/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/tr_TR/translations.php b/app/Locale/tr_TR/translations.php
index 41e22596..b25ef122 100644
--- a/app/Locale/tr_TR/translations.php
+++ b/app/Locale/tr_TR/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php
index 2f456cc3..d000b706 100644
--- a/app/Locale/zh_CN/translations.php
+++ b/app/Locale/zh_CN/translations.php
@@ -1216,4 +1216,5 @@ return array(
// 'Global tags' => '',
// 'There is no global tag at the moment.' => '',
// 'This field cannot be empty' => '',
+ // 'Hide tasks in this column in the Dashboard' => '',
);
diff --git a/app/Model/ColumnModel.php b/app/Model/ColumnModel.php
index 795fe692..0a9c55a8 100644
--- a/app/Model/ColumnModel.php
+++ b/app/Model/ColumnModel.php
@@ -144,13 +144,14 @@ class ColumnModel extends Base
* @param string $description Column description
* @return boolean|integer
*/
- public function create($project_id, $title, $task_limit = 0, $description = '')
+ public function create($project_id, $title, $task_limit = 0, $description = '', $hide_in_dashboard = 0)
{
$values = array(
'project_id' => $project_id,
'title' => $title,
'task_limit' => intval($task_limit),
'position' => $this->getLastColumnPosition($project_id) + 1,
+ 'hide_in_dashboard' => $hide_in_dashboard,
'description' => $description,
);
@@ -167,11 +168,12 @@ class ColumnModel extends Base
* @param string $description Optional description
* @return boolean
*/
- public function update($column_id, $title, $task_limit = 0, $description = '')
+ public function update($column_id, $title, $task_limit = 0, $description = '', $hide_in_dashboard = 0)
{
return $this->db->table(self::TABLE)->eq('id', $column_id)->update(array(
'title' => $title,
'task_limit' => intval($task_limit),
+ 'hide_in_dashboard' => $hide_in_dashboard,
'description' => $description,
));
}
diff --git a/app/Model/TaskFinderModel.php b/app/Model/TaskFinderModel.php
index 0e8585ea..7268052c 100644
--- a/app/Model/TaskFinderModel.php
+++ b/app/Model/TaskFinderModel.php
@@ -81,7 +81,8 @@ class TaskFinderModel extends Base
->join(ColumnModel::TABLE, 'id', 'column_id')
->eq(TaskModel::TABLE.'.owner_id', $user_id)
->eq(TaskModel::TABLE.'.is_active', TaskModel::STATUS_OPEN)
- ->eq(ProjectModel::TABLE.'.is_active', ProjectModel::ACTIVE);
+ ->eq(ProjectModel::TABLE.'.is_active', ProjectModel::ACTIVE)
+ ->eq(ColumnModel::TABLE.'.hide_in_dashboard', 0);
}
/**
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php
index 82ccb8c8..99fed66f 100644
--- a/app/Schema/Mysql.php
+++ b/app/Schema/Mysql.php
@@ -6,7 +6,12 @@ use PDO;
use Kanboard\Core\Security\Token;
use Kanboard\Core\Security\Role;
-const VERSION = 111;
+const VERSION = 112;
+
+function version_112(PDO $pdo)
+{
+ $pdo->exec('ALTER TABLE columns ADD COLUMN hide_in_dashboard INT DEFAULT 0 NOT NULL');
+}
function version_111(PDO $pdo)
{
diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php
index 229cbd25..b982bcae 100644
--- a/app/Schema/Postgres.php
+++ b/app/Schema/Postgres.php
@@ -6,7 +6,12 @@ use PDO;
use Kanboard\Core\Security\Token;
use Kanboard\Core\Security\Role;
-const VERSION = 90;
+const VERSION = 91;
+
+function version_91(PDO $pdo)
+{
+ $pdo->exec("ALTER TABLE columns ADD COLUMN hide_in_dashboard BOOLEAN DEFAULT '0'");
+}
function version_90(PDO $pdo)
{
diff --git a/app/Schema/Sql/mysql.sql b/app/Schema/Sql/mysql.sql
index 9583989d..8d2f2dc0 100644
--- a/app/Schema/Sql/mysql.sql
+++ b/app/Schema/Sql/mysql.sql
@@ -44,6 +44,7 @@ CREATE TABLE `columns` (
`position` int(11) NOT NULL,
`project_id` int(11) NOT NULL,
`task_limit` int(11) DEFAULT '0',
+ `hide_in_dashboard` int(11) DEFAULT '0',
`description` text,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_title_project` (`title`,`project_id`),
diff --git a/app/Schema/Sql/postgres.sql b/app/Schema/Sql/postgres.sql
index 94239054..ae8b4fd5 100644
--- a/app/Schema/Sql/postgres.sql
+++ b/app/Schema/Sql/postgres.sql
@@ -98,6 +98,7 @@ CREATE TABLE "columns" (
"position" integer,
"project_id" integer NOT NULL,
"task_limit" integer DEFAULT 0,
+ "hide_in_dashboard" integer DEFAULT 0,
"description" "text"
);
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php
index dac348d4..2a7735ee 100644
--- a/app/Schema/Sqlite.php
+++ b/app/Schema/Sqlite.php
@@ -6,7 +6,12 @@ use Kanboard\Core\Security\Token;
use Kanboard\Core\Security\Role;
use PDO;
-const VERSION = 102;
+const VERSION = 103;
+
+function version_103(PDO $pdo)
+{
+ $pdo->exec("ALTER TABLE columns ADD COLUMN hide_in_dashboard INTEGER DEFAULT 0 NOT NULL");
+}
function version_102(PDO $pdo)
{
diff --git a/app/Template/column/create.php b/app/Template/column/create.php
index 023de525..387b6a47 100644
--- a/app/Template/column/create.php
+++ b/app/Template/column/create.php
@@ -13,6 +13,8 @@
<?= $this->form->label(t('Task limit'), 'task_limit') ?>
<?= $this->form->number('task_limit', $values, $errors) ?>
+ <?= $this->form->checkbox('hide_in_dashboard', t('Hide tasks in this column in the Dashboard'), 1) ?>
+
<?= $this->form->label(t('Description'), 'description') ?>
<?= $this->form->textarea('description', $values, $errors, array(), 'markdown-editor') ?>
diff --git a/app/Template/column/edit.php b/app/Template/column/edit.php
index a742e4b9..abd70119 100644
--- a/app/Template/column/edit.php
+++ b/app/Template/column/edit.php
@@ -15,6 +15,8 @@
<?= $this->form->label(t('Task limit'), 'task_limit') ?>
<?= $this->form->number('task_limit', $values, $errors) ?>
+ <?= $this->form->checkbox('hide_in_dashboard', t('Hide tasks in this column in the Dashboard'), 1, $values['hide_in_dashboard'] == 1) ?>
+
<?= $this->form->label(t('Description'), 'description') ?>
<?= $this->form->textarea('description', $values, $errors, array(), 'markdown-editor') ?>
diff --git a/app/Template/project_view/show.php b/app/Template/project_view/show.php
index 5efe8ce6..0ad8852b 100644
--- a/app/Template/project_view/show.php
+++ b/app/Template/project_view/show.php
@@ -54,9 +54,10 @@
</div>
<table class="table-stripped">
<tr>
- <th class="column-60"><?= t('Column') ?></th>
+ <th class="column-40"><?= t('Column') ?></th>
<th class="column-20"><?= t('Task limit') ?></th>
<th class="column-20"><?= t('Active tasks') ?></th>
+ <th class="column-20"><?= t('Hide tasks in this column in the Dashboard') ?></th>
</tr>
<?php foreach ($stats['columns'] as $column): ?>
<tr>
@@ -70,6 +71,13 @@
</td>
<td><?= $column['task_limit'] ?: '∞' ?></td>
<td><?= $column['nb_active_tasks'] ?></td>
+ <td>
+ <?php if ($column['hide_in_dashboard'] == 1): ?>
+ <?= t('Yes') ?>
+ <?php else: ?>
+ <?= t('No') ?>
+ <?php endif ?>
+ </td>
</tr>
<?php endforeach ?>
</table>