summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-10-21 12:26:30 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-10-31 11:51:00 (GMT)
commit9fc827c2c3ca7322ee4f8d72dce6f85db4a81b2c (patch)
treedef7e5477605feb27902997041178c976d00d551
parentaf0f782563464c80c960952879cd02b340bb4df0 (diff)
downloadroundcubemail-plugins-kolab-9fc827c2c3ca7322ee4f8d72dce6f85db4a81b2c.tar.gz
Inherit tags from parent tasks for filter matching (#2373)
-rw-r--r--plugins/tasklist/tasklist.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/plugins/tasklist/tasklist.js b/plugins/tasklist/tasklist.js
index 2089c70..e52174b 100644
--- a/plugins/tasklist/tasklist.js
+++ b/plugins/tasklist/tasklist.js
@@ -1377,8 +1377,9 @@ function rcube_tasklist_ui(settings)
if (match && tagsfilter.length) {
match = rec.tags && rec.tags.length;
+ var alltags = get_inherited_tags(rec).concat(rec.tags || []);
for (var i=0; match && i < tagsfilter.length; i++) {
- if ($.inArray(tagsfilter[i], rec.tags) < 0)
+ if ($.inArray(tagsfilter[i], alltags) < 0)
match = false;
}
}
@@ -1408,6 +1409,23 @@ function rcube_tasklist_ui(settings)
/**
*
*/
+ function get_inherited_tags(rec)
+ {
+ var parent_id, itags = [];
+
+ if ((parent_id = rec.parent_id)) {
+ while (parent_id && listdata[parent_id]) {
+ itags = itags.concat(listdata[parent_id].tags || []);
+ parent_id = listdata[parent_id].parent_id;
+ }
+ }
+
+ return itags;
+ }
+
+ /**
+ *
+ */
function list_edit_dialog(id)
{
var list = me.tasklists[id],