diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-02-11 20:46:14 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-02-11 20:46:14 -0500 |
commit | 2c512f93acf6ce3e83e4600c199371ee5eb4f3a6 (patch) | |
tree | ed0c308dc6e8268899e78dca50f093131e8f5896 /app | |
parent | 59ee6f9fee1c8a8245d859c8788d6819223e3d20 (diff) |
Improve pull-request
Diffstat (limited to 'app')
-rw-r--r-- | app/Locale/da_DK/translations.php | 3 | ||||
-rw-r--r-- | app/Locale/de_DE/translations.php | 3 | ||||
-rw-r--r-- | app/Locale/es_ES/translations.php | 3 | ||||
-rw-r--r-- | app/Locale/fi_FI/translations.php | 3 | ||||
-rw-r--r-- | app/Locale/fr_FR/translations.php | 3 | ||||
-rw-r--r-- | app/Locale/hu_HU/translations.php | 3 | ||||
-rw-r--r-- | app/Locale/it_IT/translations.php | 3 | ||||
-rw-r--r-- | app/Locale/ja_JP/translations.php | 3 | ||||
-rw-r--r-- | app/Locale/pl_PL/translations.php | 3 | ||||
-rw-r--r-- | app/Locale/pt_BR/translations.php | 3 | ||||
-rw-r--r-- | app/Locale/ru_RU/translations.php | 3 | ||||
-rw-r--r-- | app/Locale/sv_SE/translations.php | 3 | ||||
-rw-r--r-- | app/Locale/th_TH/translations.php | 3 | ||||
-rw-r--r-- | app/Locale/zh_CN/translations.php | 3 | ||||
-rw-r--r-- | app/Model/TaskFinder.php | 4 | ||||
-rw-r--r-- | app/Model/TaskPosition.php | 5 | ||||
-rw-r--r-- | app/Schema/Mysql.php | 48 | ||||
-rw-r--r-- | app/Schema/Postgres.php | 36 | ||||
-rw-r--r-- | app/Schema/Sqlite.php | 38 | ||||
-rw-r--r-- | app/Template/board/task.php | 4 |
20 files changed, 113 insertions, 64 deletions
diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php index 3fd68fab..d0bebe0c 100644 --- a/app/Locale/da_DK/translations.php +++ b/app/Locale/da_DK/translations.php @@ -683,4 +683,7 @@ return array( // 'Help on Bitbucket webhooks' => '', // 'Start' => '', // 'End' => '', + // 'Task age in days' => '', + // 'Days in this column' => '', + // '%dd' => '', ); diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php index 1efd9c99..42db9bcd 100644 --- a/app/Locale/de_DE/translations.php +++ b/app/Locale/de_DE/translations.php @@ -683,4 +683,7 @@ return array( 'Help on Bitbucket webhooks' => 'Hilfe für Bitbucket webhooks', // 'Start' => '', // 'End' => '', + // 'Task age in days' => '', + // 'Days in this column' => '', + // '%dd' => '', ); diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php index da3c01c6..e921c10f 100644 --- a/app/Locale/es_ES/translations.php +++ b/app/Locale/es_ES/translations.php @@ -683,4 +683,7 @@ return array( // 'Help on Bitbucket webhooks' => '', // 'Start' => '', // 'End' => '', + // 'Task age in days' => '', + // 'Days in this column' => '', + // '%dd' => '', ); diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php index 7b329105..0ed1031b 100644 --- a/app/Locale/fi_FI/translations.php +++ b/app/Locale/fi_FI/translations.php @@ -683,4 +683,7 @@ return array( // 'Help on Bitbucket webhooks' => '', // 'Start' => '', // 'End' => '', + // 'Task age in days' => '', + // 'Days in this column' => '', + // '%dd' => '', ); diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index 7b8c0a4a..7fc5e842 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -685,4 +685,7 @@ return array( 'Help on Bitbucket webhooks' => 'Aide sur les webhooks Bitbucket', 'Start' => 'Début', 'End' => 'Fin', + 'Task age in days' => 'Age de la tâche en jours', + 'Days in this column' => 'Jours dans cette colonne', + '%dd' => '%dj', ); diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php index ba6b18a0..c19eb850 100644 --- a/app/Locale/hu_HU/translations.php +++ b/app/Locale/hu_HU/translations.php @@ -683,4 +683,7 @@ return array( // 'Help on Bitbucket webhooks' => '', // 'Start' => '', // 'End' => '', + // 'Task age in days' => '', + // 'Days in this column' => '', + // '%dd' => '', ); diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php index 9fdc2631..5c3ef47b 100644 --- a/app/Locale/it_IT/translations.php +++ b/app/Locale/it_IT/translations.php @@ -683,4 +683,7 @@ return array( // 'Help on Bitbucket webhooks' => '', // 'Start' => '', // 'End' => '', + // 'Task age in days' => '', + // 'Days in this column' => '', + // '%dd' => '', ); diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php index df12a789..91030bee 100644 --- a/app/Locale/ja_JP/translations.php +++ b/app/Locale/ja_JP/translations.php @@ -683,4 +683,7 @@ return array( // 'Help on Bitbucket webhooks' => '', // 'Start' => '', // 'End' => '', + // 'Task age in days' => '', + // 'Days in this column' => '', + // '%dd' => '', ); diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php index b46bc0f1..7acb1497 100644 --- a/app/Locale/pl_PL/translations.php +++ b/app/Locale/pl_PL/translations.php @@ -683,4 +683,7 @@ return array( // 'Help on Bitbucket webhooks' => '', // 'Start' => '', // 'End' => '', + // 'Task age in days' => '', + // 'Days in this column' => '', + // '%dd' => '', ); diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php index ca8ae3e9..ac865046 100644 --- a/app/Locale/pt_BR/translations.php +++ b/app/Locale/pt_BR/translations.php @@ -683,4 +683,7 @@ return array( 'Help on Bitbucket webhooks' => 'Ajuda sobre os webhooks Bitbucket', // 'Start' => '', // 'End' => '', + // 'Task age in days' => '', + // 'Days in this column' => '', + // '%dd' => '', ); diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php index f094b725..624a17f1 100644 --- a/app/Locale/ru_RU/translations.php +++ b/app/Locale/ru_RU/translations.php @@ -683,4 +683,7 @@ return array( // 'Help on Bitbucket webhooks' => '', // 'Start' => '', // 'End' => '', + // 'Task age in days' => '', + // 'Days in this column' => '', + // '%dd' => '', ); diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php index 3ebe8a34..b77a8a5a 100644 --- a/app/Locale/sv_SE/translations.php +++ b/app/Locale/sv_SE/translations.php @@ -683,4 +683,7 @@ return array( // 'Help on Bitbucket webhooks' => '', // 'Start' => '', // 'End' => '', + // 'Task age in days' => '', + // 'Days in this column' => '', + // '%dd' => '', ); diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php index 8cdab422..64e0170e 100644 --- a/app/Locale/th_TH/translations.php +++ b/app/Locale/th_TH/translations.php @@ -683,4 +683,7 @@ return array( // 'Help on Bitbucket webhooks' => '', // 'Start' => '', // 'End' => '', + // 'Task age in days' => '', + // 'Days in this column' => '', + // '%dd' => '', ); diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php index 48d2b69b..addf7fa6 100644 --- a/app/Locale/zh_CN/translations.php +++ b/app/Locale/zh_CN/translations.php @@ -683,4 +683,7 @@ return array( // 'Help on Bitbucket webhooks' => '', // 'Start' => '', // 'End' => '', + // 'Task age in days' => '', + // 'Days in this column' => '', + // '%dd' => '', ); diff --git a/app/Model/TaskFinder.php b/app/Model/TaskFinder.php index 05168593..27fa8150 100644 --- a/app/Model/TaskFinder.php +++ b/app/Model/TaskFinder.php @@ -102,7 +102,7 @@ class TaskFinder extends Base 'tasks.is_active', 'tasks.score', 'tasks.category_id', - 'tasks.date_moved', + 'tasks.date_moved', 'users.username AS assignee_username', 'users.name AS assignee_name' ) @@ -243,7 +243,7 @@ class TaskFinder extends Base tasks.score, tasks.category_id, tasks.swimlane_id, - tasks.date_moved, + tasks.date_moved, project_has_categories.name AS category_name, projects.name AS project_name, columns.title AS column_title, diff --git a/app/Model/TaskPosition.php b/app/Model/TaskPosition.php index 9733999b..b8d9d7bf 100644 --- a/app/Model/TaskPosition.php +++ b/app/Model/TaskPosition.php @@ -30,10 +30,11 @@ class TaskPosition extends Base $result = $this->calculateAndSave($project_id, $task_id, $column_id, $position, $swimlane_id); if ($result) { + if ($original_task['column_id'] != $column_id) { - $this->db->table(Task::TABLE)->eq('id', $task_id)->update(array('date_moved' => time(), - )); + $this->db->table(Task::TABLE)->eq('id', $task_id)->update(array('date_moved' => time())); } + if ($original_task['swimlane_id'] != $swimlane_id) { $this->calculateAndSave($project_id, 0, $column_id, 1, $original_task['swimlane_id']); } diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index e4be05b7..24bc2baf 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -9,33 +9,35 @@ const VERSION = 45; function version_45($pdo) { - $pdo->exec('ALTER TABLE tasks ADD COLUMN date_moved INT DEFAULT 0'); - - /* Update tasks.date_moved from project_activities table if tasks.date_moved = null or 0. - * We take max project_activities.date_creation where event_name in task.create','task.move.column - * since creation date is always less than task moves - */ - $pdo->exec("UPDATE tasks - SET date_moved = ( - SELECT md + $pdo->exec('ALTER TABLE tasks ADD COLUMN date_moved INT DEFAULT 0'); + + /* Update tasks.date_moved from project_activities table if tasks.date_moved = null or 0. + * We take max project_activities.date_creation where event_name in task.create','task.move.column + * since creation date is always less than task moves + */ + $pdo->exec("UPDATE tasks + SET date_moved = ( + SELECT md FROM ( - SELECT task_id, max(date_creation) md - FROM project_activities - WHERE event_name IN ('task.create', 'task.move.column') - GROUP BY task_id - ) src + SELECT task_id, max(date_creation) md + FROM project_activities + WHERE event_name IN ('task.create', 'task.move.column') + GROUP BY task_id + ) src WHERE id = src.task_id - ) + ) WHERE (date_moved IS NULL OR date_moved = 0) AND id IN ( SELECT task_id FROM ( - SELECT task_id, max(date_creation) md - FROM project_activities - WHERE event_name IN ('task.create', 'task.move.column') - GROUP BY task_id - ) src - ) - "); + SELECT task_id, max(date_creation) md + FROM project_activities + WHERE event_name IN ('task.create', 'task.move.column') + GROUP BY task_id + ) src + )"); + + // If there is no activities for some tasks use the date_creation + $pdo->exec("UPDATE tasks SET date_moved = date_creation WHERE date_moved IS NULL OR date_moved = 0"); } function version_44($pdo) @@ -65,7 +67,7 @@ function version_43($pdo) function version_42($pdo) { - $pdo->exec('ALTER TABLE columns ADD COLUMN description TEXT'); + $pdo->exec('ALTER TABLE columns ADD COLUMN description TEXT'); } function version_41($pdo) diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index 92587273..d3fb9fc4 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -14,33 +14,35 @@ function version_26($pdo) /* Update tasks.date_moved from project_activities table if tasks.date_moved = null or 0. * We take max project_activities.date_creation where event_name in task.create','task.move.column * since creation date is always less than task moves - */ + */ $pdo->exec("UPDATE tasks - SET date_moved = ( - SELECT md + SET date_moved = ( + SELECT md FROM ( - SELECT task_id, max(date_creation) md - FROM project_activities - WHERE event_name IN ('task.create', 'task.move.column') - GROUP BY task_id - ) src + SELECT task_id, max(date_creation) md + FROM project_activities + WHERE event_name IN ('task.create', 'task.move.column') + GROUP BY task_id + ) src WHERE id = src.task_id - ) + ) WHERE (date_moved IS NULL OR date_moved = 0) AND id IN ( SELECT task_id FROM ( - SELECT task_id, max(date_creation) md - FROM project_activities - WHERE event_name IN ('task.create', 'task.move.column') - GROUP BY task_id - ) src - ) - "); + SELECT task_id, max(date_creation) md + FROM project_activities + WHERE event_name IN ('task.create', 'task.move.column') + GROUP BY task_id + ) src + )"); + + // If there is no activities for some tasks use the date_creation + $pdo->exec("UPDATE tasks SET date_moved = date_creation WHERE date_moved IS NULL OR date_moved = 0"); } function version_25($pdo) { - $pdo->exec("ALTER TABLE users ADD COLUMN disable_login_form BOOLEAN DEFAULT '1'"); + $pdo->exec("ALTER TABLE users ADD COLUMN disable_login_form BOOLEAN DEFAULT '0'"); } function version_24($pdo) diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index 7e0668e3..f027cf91 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -12,30 +12,32 @@ function version_44($pdo) $pdo->exec('ALTER TABLE tasks ADD COLUMN date_moved INTEGER DEFAULT 0'); /* Update tasks.date_moved from project_activities table if tasks.date_moved = null or 0. - * We take max project_activities.date_creation where event_name in task.create','task.move.column - * since creation date is always less than task moves - */ + * We take max project_activities.date_creation where event_name in task.create','task.move.column + * since creation date is always less than task moves + */ $pdo->exec("UPDATE tasks - SET date_moved = ( - SELECT md + SET date_moved = ( + SELECT md FROM ( - SELECT task_id, max(date_creation) md - FROM project_activities - WHERE event_name IN ('task.create', 'task.move.column') - GROUP BY task_id - ) src + SELECT task_id, max(date_creation) md + FROM project_activities + WHERE event_name IN ('task.create', 'task.move.column') + GROUP BY task_id + ) src WHERE id = src.task_id - ) + ) WHERE (date_moved IS NULL OR date_moved = 0) AND id IN ( SELECT task_id FROM ( - SELECT task_id, max(date_creation) md - FROM project_activities - WHERE event_name IN ('task.create', 'task.move.column') - GROUP BY task_id - ) src - ) - "); + SELECT task_id, max(date_creation) md + FROM project_activities + WHERE event_name IN ('task.create', 'task.move.column') + GROUP BY task_id + ) src + )"); + + // If there is no activities for some tasks use the date_creation + $pdo->exec("UPDATE tasks SET date_moved = date_creation WHERE date_moved IS NULL OR date_moved = 0"); } function version_43($pdo) diff --git a/app/Template/board/task.php b/app/Template/board/task.php index 3d3fb269..5cad4004 100644 --- a/app/Template/board/task.php +++ b/app/Template/board/task.php @@ -69,8 +69,8 @@ ) ?> </span> - <span title="<?= t('Task age in days')?>" class="task-days-age"><?= floor(time()/86400) - floor($task['date_creation']/86400)?>d</span> - <span title="<?= t('Days in this column')?>" class="task-days-incolumn"><?= floor(time()/86400) - floor($task['date_moved']/86400)?>d</span> + <span title="<?= t('Task age in days')?>" class="task-days-age"><?= t('%dd', floor(time()/86400) - floor($task['date_creation']/86400)) ?></span> + <span title="<?= t('Days in this column')?>" class="task-days-incolumn"><?= t('%dd', floor(time()/86400) - floor($task['date_moved']/86400)) ?></span> <?php if ($task['score']): ?> <span class="task-score"><?= $this->e($task['score']) ?></span> |