Group event participants by type in event tooltip

This commit is contained in:
nathangray 2016-07-27 17:04:02 -06:00
parent 863242689f
commit 489cf12310
2 changed files with 21 additions and 2 deletions

View File

@ -753,7 +753,17 @@ class calendar_ui
// set id for grid
$event['row_id'] = $event['id'].($event['recur_type'] ? ':'.Api\DateTime::to($event['recur_date'] ? $event['recur_date'] : $event['start'],'ts') : '');
$event['parts'] = implode(",\n",$this->bo->participants($event,false));
// Set up participant section of tooltip
$participants = $this->bo->participants($event,false);
$event['parts'] = implode("\n",$participants);
$event['participant_types'] = array();
foreach($participants as $uid => $text)
{
$user_type = $user_id = null;
calendar_so::split_user($uid, $user_type, $user_id);
$type_name = lang($this->bo->resources[$user_type]['app']);
$event['participant_types'][$type_name ? $type_name : ''][] = $text;
}
$event['date'] = $this->bo->date2string($event['start']);
// Change dates

View File

@ -493,6 +493,15 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
}
cat.destroy();
}
var participants = '';
for(var type_name in this.options.value.participant_types)
{
if(type_name)
{
participants += '</p><p><span class="calendar_calEventLabel">'+type_name+'</span>:<br />';
}
participants += this.options.value.participant_types[type_name].join("<br />");
}
return '<div class="calendar_calEventTooltip ' + this._status_class() +' '+ this.options.class +
'" style="border-color: '+border+'; background-color: '+bg_color+';">'+
@ -508,7 +517,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
(this.options.value.location ? '<p><span class="calendar_calEventLabel">'+this.egw().lang('Location') + '</span>:' + this.options.value.location+'</p>' : '')+
(cat_label ? '<p><span class="calendar_calEventLabel">'+this.egw().lang('Category') + '</span>:' + cat_label +'</p>' : '')+
'<p><span class="calendar_calEventLabel">'+this.egw().lang('Participants')+'</span>:<br />'+
(this.options.value.parts ? this.options.value.parts.replace("\n","<br />"):'')+'</p>'+
participants + '</p>'+
'</div>'+
'</div>';
},