summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-03-25 15:26:13 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-03-25 15:26:13 (GMT)
commitc33c964bcd723bb39cc8f0c32f50a841bb094a89 (patch)
treefba0f190e504a2db8867d3a59dbc02664eaa91d3
parent7fec791449579350ee3ed6b5b0747edee546e147 (diff)
downloadroundcubemail-plugins-kolab-c33c964bcd723bb39cc8f0c32f50a841bb094a89.tar.gz
Show changes of parent-child relations in diff view (#3271) + show complete path of parent task titles in task details
-rw-r--r--plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php1
-rw-r--r--plugins/tasklist/skins/larry/tasklist.css2
-rw-r--r--plugins/tasklist/skins/larry/templates/mainview.html6
-rw-r--r--plugins/tasklist/tasklist.php17
4 files changed, 23 insertions, 3 deletions
diff --git a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
index 4a192c6..8ba59de 100644
--- a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
+++ b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
@@ -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',
);
diff --git a/plugins/tasklist/skins/larry/tasklist.css b/plugins/tasklist/skins/larry/tasklist.css
index a39c1f2..33987f2 100644
--- a/plugins/tasklist/skins/larry/tasklist.css
+++ b/plugins/tasklist/skins/larry/tasklist.css
@@ -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;
}
diff --git a/plugins/tasklist/skins/larry/templates/mainview.html b/plugins/tasklist/skins/larry/templates/mainview.html
index dd38409..3a3a227 100644
--- a/plugins/tasklist/skins/larry/templates/mainview.html
+++ b/plugins/tasklist/skins/larry/templates/mainview.html
@@ -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">
diff --git a/plugins/tasklist/tasklist.php b/plugins/tasklist/tasklist.php
index b4cdfa2..869a192 100644
--- a/plugins/tasklist/tasklist.php
+++ b/plugins/tasklist/tasklist.php
@@ -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));
+ }
}
/**