Highlight recently modified tasks on board (pull-request #201)
This commit is contained in:
@@ -387,6 +387,7 @@ class Task extends Base
|
|||||||
// Prepare data
|
// Prepare data
|
||||||
$this->prepare($values);
|
$this->prepare($values);
|
||||||
$values['date_creation'] = time();
|
$values['date_creation'] = time();
|
||||||
|
$values['date_modification'] = $values['date_creation'];
|
||||||
$values['position'] = $this->countByColumnId($values['project_id'], $values['column_id']);
|
$values['position'] = $this->countByColumnId($values['project_id'], $values['column_id']);
|
||||||
|
|
||||||
// Save task
|
// Save task
|
||||||
@@ -426,9 +427,13 @@ class Task extends Base
|
|||||||
// Prepare data
|
// Prepare data
|
||||||
$this->prepare($values);
|
$this->prepare($values);
|
||||||
$updated_task = $values;
|
$updated_task = $values;
|
||||||
$updated_task['date_modification'] = time();
|
|
||||||
unset($updated_task['id']);
|
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);
|
$result = $this->db->table(self::TABLE)->eq('id', $values['id'])->update($updated_task);
|
||||||
|
|
||||||
// Trigger events
|
// Trigger events
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
data-task-limit="<?= $column['task_limit'] ?>"
|
data-task-limit="<?= $column['task_limit'] ?>"
|
||||||
>
|
>
|
||||||
<?php foreach ($column['tasks'] as $task): ?>
|
<?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-task-id="<?= $task['id'] ?>"
|
||||||
data-owner-id="<?= $task['owner_id'] ?>"
|
data-owner-id="<?= $task['owner_id'] ?>"
|
||||||
data-category-id="<?= $task['category_id'] ?>"
|
data-category-id="<?= $task['category_id'] ?>"
|
||||||
|
|||||||
@@ -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)
|
// Board refresh frequency in seconds (the value 0 disable this feature)
|
||||||
defined('BOARD_CHECK_INTERVAL') or define('BOARD_CHECK_INTERVAL', 10);
|
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
|
// Custom session save path
|
||||||
defined('SESSION_SAVE_PATH') or define('SESSION_SAVE_PATH', '');
|
defined('SESSION_SAVE_PATH') or define('SESSION_SAVE_PATH', '');
|
||||||
|
|
||||||
|
|||||||
@@ -584,6 +584,10 @@ a.filter-on {
|
|||||||
font-size: 95%;
|
font-size: 95%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.task-board-recent {
|
||||||
|
box-shadow: 0px 0px 10px rgba(82, 158, 236, 1);
|
||||||
|
}
|
||||||
|
|
||||||
.task-table a,
|
.task-table a,
|
||||||
.task-board a {
|
.task-board a {
|
||||||
color: #000;
|
color: #000;
|
||||||
|
|||||||
@@ -77,8 +77,7 @@ Kanboard.Board = (function() {
|
|||||||
connectWith: ".column",
|
connectWith: ".column",
|
||||||
placeholder: "draggable-placeholder",
|
placeholder: "draggable-placeholder",
|
||||||
stop: function(event, ui) {
|
stop: function(event, ui) {
|
||||||
var task_id = parseInt(ui.item[0].getAttribute("data-task-id"));
|
board_save(ui.item.attr('data-task-id'));
|
||||||
board_save(task_id);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ define('BOARD_PUBLIC_CHECK_INTERVAL', 60);
|
|||||||
// Board refresh frequency in seconds (the value 0 disable this feature, 10 seconds by default)
|
// Board refresh frequency in seconds (the value 0 disable this feature, 10 seconds by default)
|
||||||
define('BOARD_CHECK_INTERVAL', 10);
|
define('BOARD_CHECK_INTERVAL', 10);
|
||||||
|
|
||||||
|
// Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)
|
||||||
|
define('RECENT_TASK_PERIOD', 48*60*60);
|
||||||
|
|
||||||
// Database driver: sqlite or mysql (sqlite by default)
|
// Database driver: sqlite or mysql (sqlite by default)
|
||||||
define('DB_DRIVER', 'sqlite');
|
define('DB_DRIVER', 'sqlite');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user