From 2c512f93acf6ce3e83e4600c199371ee5eb4f3a6 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 11 Feb 2015 20:46:14 -0500 Subject: Improve pull-request --- app/Locale/da_DK/translations.php | 3 +++ app/Locale/de_DE/translations.php | 3 +++ app/Locale/es_ES/translations.php | 3 +++ app/Locale/fi_FI/translations.php | 3 +++ app/Locale/fr_FR/translations.php | 3 +++ app/Locale/hu_HU/translations.php | 3 +++ app/Locale/it_IT/translations.php | 3 +++ app/Locale/ja_JP/translations.php | 3 +++ app/Locale/pl_PL/translations.php | 3 +++ app/Locale/pt_BR/translations.php | 3 +++ app/Locale/ru_RU/translations.php | 3 +++ app/Locale/sv_SE/translations.php | 3 +++ app/Locale/th_TH/translations.php | 3 +++ app/Locale/zh_CN/translations.php | 3 +++ app/Model/TaskFinder.php | 4 ++-- app/Model/TaskPosition.php | 5 ++-- app/Schema/Mysql.php | 48 ++++++++++++++++++++------------------- app/Schema/Postgres.php | 36 +++++++++++++++-------------- app/Schema/Sqlite.php | 38 ++++++++++++++++--------------- app/Template/board/task.php | 4 ++-- assets/css/app.css | 16 ++++++------- assets/css/src/task.css | 16 ++++++------- 22 files changed, 129 insertions(+), 80 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 @@ ) ?> - d - d + + e($task['score']) ?> diff --git a/assets/css/app.css b/assets/css/app.css index 2b8bb521..8ad66d15 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -1633,21 +1633,21 @@ a.task-board-nobody { } .task-days-age { - font-size: 0.8em; - border: #888 1px solid; - border-radius:2px; - padding:1px 4px 1px 2px; + font-size: 0.8em; + border: #888 1px solid; + border-radius:2px; + padding: 1px 4px 1px 2px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; } .task-days-incolumn { - font-size: 0.8em; - border: #888 1px solid; + font-size: 0.8em; + border: #888 1px solid; border-left: none; margin-left: -5px; - border-radius:2px; - padding:1px 2px 1px 4px; + border-radius:2px; + padding: 1px 2px 1px 4px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; } diff --git a/assets/css/src/task.css b/assets/css/src/task.css index e069b32c..11414364 100644 --- a/assets/css/src/task.css +++ b/assets/css/src/task.css @@ -207,21 +207,21 @@ a.task-board-nobody { } .task-days-age { - font-size: 0.8em; - border: #888 1px solid; - border-radius:2px; - padding:1px 4px 1px 2px; + font-size: 0.8em; + border: #888 1px solid; + border-radius:2px; + padding: 1px 4px 1px 2px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; } .task-days-incolumn { - font-size: 0.8em; - border: #888 1px solid; + font-size: 0.8em; + border: #888 1px solid; border-left: none; margin-left: -5px; - border-radius:2px; - padding:1px 2px 1px 4px; + border-radius:2px; + padding: 1px 2px 1px 4px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; } -- cgit v1.2.3