From 697444965d1ebc85eafe01f1d91f92163c60eb2a Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 10 Nov 2015 00:56:31 +0000 Subject: [PATCH] Calendar planner: - Fix planner category filter - Planner by user now lists group invitations in each user's row --- calendar/js/app.js | 2 +- calendar/js/et2_widget_planner.js | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/calendar/js/app.js b/calendar/js/app.js index f7aaa307b4..d74a92a8a5 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -3093,7 +3093,7 @@ jQuery.extend(app.classes.calendar,{ }, etemplates: ['calendar.planner'], group_by: function(state) { - return state.cat_id? state.cat_id : (state.sortby ? state.sortby : 0); + return state.sortby ? state.sortby : 0; }, start_date: function(state) { var d = app.calendar.View.start_date.call(this, state); diff --git a/calendar/js/et2_widget_planner.js b/calendar/js/et2_widget_planner.js index 0e228717e1..47ba5ca6a7 100644 --- a/calendar/js/et2_widget_planner.js +++ b/calendar/js/et2_widget_planner.js @@ -416,9 +416,8 @@ var et2_calendar_planner = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResize default: status_to_show = ['U','A','T','D','G']; break; } - for(var user in event.participants) - { - var participant = event.participants[user]; + var participants = event.participants; + var add_row = function(user, participant) { var label_index = false; for(var i = 0; i < labels.length; i++) { @@ -438,6 +437,21 @@ var et2_calendar_planner = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResize rows[label_index].push(event); } } + for(var user in participants) + { + var participant = participants[user]; + if (parseInt(user) < 0) // groups + { + egw.accountData(user,'account_fullname',true,function(result) { + for(var id in result) + { + if(!participants[id]) add_row(id,participant); + } + },labels); + continue; + } + add_row(user, participant); + } }, // Draw a single row draw_row: function(sort_key, label, events) {