summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-08-17 09:43:57 -0700
committerFrédéric Guillot <fred@kanboard.net>2014-08-17 09:43:57 -0700
commiteb76e1e530627eae34c74f0db3ed33d9a0da6810 (patch)
treefb90ae9e1a2977b0f2ab5feef706949aebfc50fc /app
parent44e91721b0edec28b4e37d3c6b8847854c108233 (diff)
Highlight recently modified tasks on board (pull-request #201)
Diffstat (limited to 'app')
-rw-r--r--app/Model/Task.php7
-rw-r--r--app/Templates/board_show.php2
-rw-r--r--app/common.php3
3 files changed, 10 insertions, 2 deletions
diff --git a/app/Model/Task.php b/app/Model/Task.php
index 0753c57d..09c77573 100644
--- a/app/Model/Task.php
+++ b/app/Model/Task.php
@@ -387,6 +387,7 @@ class Task extends Base
// Prepare data
$this->prepare($values);
$values['date_creation'] = time();
+ $values['date_modification'] = $values['date_creation'];
$values['position'] = $this->countByColumnId($values['project_id'], $values['column_id']);
// Save task
@@ -426,9 +427,13 @@ class Task extends Base
// Prepare data
$this->prepare($values);
$updated_task = $values;
- $updated_task['date_modification'] = time();
unset($updated_task['id']);
+ // We update the modification date only for the selected task to highlight recent moves
+ if ($trigger_events) {
+ $updated_task['date_modification'] = time();
+ }
+
$result = $this->db->table(self::TABLE)->eq('id', $values['id'])->update($updated_task);
// Trigger events
diff --git a/app/Templates/board_show.php b/app/Templates/board_show.php
index 2d857497..e91ab4cf 100644
--- a/app/Templates/board_show.php
+++ b/app/Templates/board_show.php
@@ -32,7 +32,7 @@
data-task-limit="<?= $column['task_limit'] ?>"
>
<?php foreach ($column['tasks'] as $task): ?>
- <div class="task-board draggable-item task-<?= $task['color_id'] ?>"
+ <div class="task-board draggable-item task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - RECENT_TASK_PERIOD ? 'task-board-recent' : '' ?>"
data-task-id="<?= $task['id'] ?>"
data-owner-id="<?= $task['owner_id'] ?>"
data-category-id="<?= $task['category_id'] ?>"
diff --git a/app/common.php b/app/common.php
index f66a3fa9..9d48442b 100644
--- a/app/common.php
+++ b/app/common.php
@@ -33,6 +33,9 @@ defined('BOARD_PUBLIC_CHECK_INTERVAL') or define('BOARD_PUBLIC_CHECK_INTERVAL',
// Board refresh frequency in seconds (the value 0 disable this feature)
defined('BOARD_CHECK_INTERVAL') or define('BOARD_CHECK_INTERVAL', 10);
+// Period (in second) to consider a task was modified recently
+defined('RECENT_TASK_PERIOD') or define('RECENT_TASK_PERIOD', 48*60*60);
+
// Custom session save path
defined('SESSION_SAVE_PATH') or define('SESSION_SAVE_PATH', '');