Commit c33c964b authored by Thomas Bruederli's avatar Thomas Bruederli

Show changes of parent-child relations in diff view (#3271) + show complete...

Show changes of parent-child relations in diff view (#3271) + show complete path of parent task titles in task details
parent 7fec7914
......@@ -796,6 +796,7 @@ class tasklist_kolab_driver extends tasklist_driver
'attendee' => 'attendees',
'attach' => 'attachments',
'rrule' => 'recurrence',
'related-to' => 'parent_id',
'percent-complete' => 'complete',
'lastmodified-date' => 'changed',
);
......
......@@ -882,7 +882,7 @@ ul.toolbarmenu .sortcol.by-auto a {
background: url(images/badge_cancelled.png) top right no-repeat;
}
#task-parent-title {
.task-parent-title {
position: relative;
top: -0.6em;
}
......
......@@ -163,7 +163,7 @@
<div id="taskshow" class="taskshow">
<div class="form-section" id="task-parent-title"></div>
<div id="task-parent-title" class="form-section task-parent-title"></div>
<div class="form-section">
<h2 id="task-title"></h2>
</div>
......@@ -249,6 +249,10 @@
</div>
<div id="taskdiff" class="uidialog taskshow" aria-hidden="true">
<div class="form-section task-parent-title">
<span class="task-text-old"></span> &#8674;
<span class="task-text-new"></span> &raquo;
</div>
<h2 class="task-title">Task Title</h2>
<h2 class="task-title-new task-text-new"></h2>
<div class="form-section task-description">
......
......@@ -450,6 +450,16 @@ class tasklist extends rcube_plugin
$change['new']['classname'] = rcube_utils::file2class($change['new']['mimetype'], $change['new']['name']);
}
}
// resolve parent_id to the refered task title for display
if ($change['property'] == 'parent_id') {
$change['property'] = 'parent-title';
if (!empty($change['old']) && ($old_parent = $this->driver->get_task(array('id' => $change['old'], 'list' => $rec['list'])))) {
$change['old_'] = $old_parent['title'];
}
if (!empty($change['new']) && ($new_parent = $this->driver->get_task(array('id' => $change['new'], 'list' => $rec['list'])))) {
$change['new_'] = $new_parent['title'];
}
}
// compute a nice diff of description texts
if ($change['property'] == 'description') {
$change['diff_'] = libkolab::html_diff($change['old'], $change['new']);
......@@ -1272,12 +1282,17 @@ class tasklist extends rcube_plugin
private function task_walk_tree(&$rec)
{
$rec['_depth'] = 0;
$parent_titles = array();
$parent_id = $this->task_tree[$rec['id']];
while ($parent_id) {
$rec['_depth']++;
$rec['parent_title'] = $this->task_titles[$parent_id];
array_unshift($parent_titles, $this->task_titles[$parent_id]);
$parent_id = $this->task_tree[$parent_id];
}
if (count($parent_titles)) {
$rec['parent_title'] = join(' » ', array_filter($parent_titles));
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment