diff --git a/calendar/inc/class.calendar_hooks.inc.php b/calendar/inc/class.calendar_hooks.inc.php
index a6afcd3929b..14226ac574c 100644
--- a/calendar/inc/class.calendar_hooks.inc.php
+++ b/calendar/inc/class.calendar_hooks.inc.php
@@ -431,6 +431,13 @@ static function settings($hook_data)
'xmlrpc' => True,
'admin' => False,
),
+ 'participant_names' => array(
+ 'type' => 'check',
+ 'label' => 'Show participant names on event',
+ 'name' => 'participant_names',
+ 'help' => 'Controls whether names of participants are shown alongside the title of an appointment.',
+ 'default' => false
+ ),
'2.5.section' => array(
'type' => 'section',
'title' => lang('Configuration settings'),
diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php
index 50576ea5fd4..afc75d65954 100644
--- a/calendar/inc/class.calendar_ui.inc.php
+++ b/calendar/inc/class.calendar_ui.inc.php
@@ -782,6 +782,9 @@ public function to_client(&$event)
$participants = $this->bo->participants($event,false);
$event['parts'] = implode("\n",$participants);
$event['participant_types'] = array();
+ // semicolon-separated string of participants that may (optionally) be shown alongside title
+ $participantNames = "";
+
foreach($participants as $uid => $text)
{
$user_type = $user_id = null;
@@ -797,7 +800,14 @@ public function to_client(&$event)
'account_id'
));
}
+ $participantNames .= ($this->bo->participant_name($user_id) . "; ");
+ }
+ // add the names of all participants as semicolon-separated string
+ if($GLOBALS['egw_info']['user']['preferences']['calendar']['participant_names'])
+ {
+ $event['participant_names'] = substr($participantNames, 0, -2);
}
+
$event['date'] = $this->bo->date2string($event['start']);
// Change dates
diff --git a/calendar/js/et2_widget_event.js b/calendar/js/et2_widget_event.js
index e3ec1182616..e095f9b3afe 100644
--- a/calendar/js/et2_widget_event.js
+++ b/calendar/js/et2_widget_event.js
@@ -326,8 +326,8 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
var title = !event.is_private ? egw.htmlspecialchars(event['title']) : egw.lang('private');
this.title
- .html(''+this._get_timespan(event) + '
')
- .append(''+title+'')
+ .html('' + this._get_timespan(event) + '
')
+ .append('' + this._getTitle(event) + '')
// Colors - don't make them transparent if there is no color
if(jQuery.Color("rgba(0,0,0,0)").toRgbaString() != jQuery.Color(this.div,'background-color').toRgbaString())
@@ -342,7 +342,7 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
// Body
if(event.whole_day_on_top)
{
- this.body.html(title);
+ this.body.html(this._getTitle(event));
}
else
{
@@ -358,8 +358,8 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
).trim();
this.body
- .html(''+title+'')
- .append(''+start_time + '');
+ .html('' + this._getTitle(event) + '')
+ .append('' + start_time + '');
if(this.options.value.description.trim())
{
this.body
@@ -713,6 +713,54 @@ var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.exten
return timespan;
},
+ /**
+ * Creates the title-string for an event
+ * @param {Object} event the current event.
+ * @return {string} the resulting title.
+ */
+ _getTitle: function(event) {
+ let title = "";
+ if(!event.is_private)
+ {
+ title = egw.htmlspecialchars(event['title']);
+ title += this._getParticipants(event);
+ }
+ else
+ {
+ title = egw.lang('private');
+ }
+ return title;
+ },
+
+ /**
+ * Retrieves participant names from an event
+ * @param {Object} event the current event
+ * @return {string} the participants as span-objects
+ */
+ _getParticipants: function(event) {
+ let participants = "";
+ if(this._hasParticipantNames(event))
+ {
+ return ' // ' + event["participant_names"] + ""
+ }
+ return participants;
+ },
+
+ /**
+ * Tries to detect provided names of participants for an event.
+ * Names will only be shown when provided with the event.
+ *
+ * @param {Object} event the current event
+ * @return boolean whether the event contains participant-names or not
+ */
+ _hasParticipantNames: function(event)
+ {
+ return event["participant_names"] !== undefined
+ && event["participant_names"] !== null;
+ },
+
+
+
/**
* Make sure event data has all proper values, and format them as expected
* @param {Object} event
diff --git a/calendar/lang/egw_de.lang b/calendar/lang/egw_de.lang
index 61e71b56825..edad80b4c65 100644
--- a/calendar/lang/egw_de.lang
+++ b/calendar/lang/egw_de.lang
@@ -109,6 +109,7 @@ close the window calendar de Schließt das Fenster
compose a mail to all participants after the event is saved calendar de Schreibe eine E-Mail an alle Teilnehmer, nachdem der Termin gespeichert wurde.
configuration settings calendar de Einstellungen der Konfiguration
conflict calendar de Konflikt
+controls whether names of participants are shown alongside the title of an appointment. calendar de Steuert, ob die Namen von Teilnehmern auf einem Termin (neben dem Titel) angezeigt werden.
copy of: calendar de Kopie von:
copy this event calendar de Kopiert diesen Termin
copy your changes to the clipboard, %1reload the entry%2 and merge them. calendar de Kopieren Sie ihre Änderungen in die Zwischenablage, %1laden den Eintrag neu%2 und fügen diese wieder ein.
@@ -531,6 +532,7 @@ show only invitations, not yet accepted or rejected calendar de Zeige nur Einlad
show only rejected events calendar de Zeige nur abgesagte Termine
show only tentative accepted events calendar de Zeige nur vorläufig zugesagte Termine
show only the date, not the year admin de Zeige nur das Datum nicht das Jahr
+show participant names on event calendar de Zeige Teilnehmer auf einem Termin an
show this month calendar de Diesen Monat anzeigen
show this week calendar de Diese Woche anzeigen
show year and age calendar de Zeige Jahr und Alter
diff --git a/calendar/lang/egw_en.lang b/calendar/lang/egw_en.lang
index 34dd720aeab..18297081636 100644
--- a/calendar/lang/egw_en.lang
+++ b/calendar/lang/egw_en.lang
@@ -109,6 +109,7 @@ close the window calendar en Close the window
compose a mail to all participants after the event is saved calendar en Compose a mail to all participants after the event is saved.
configuration settings calendar en Configuration settings
conflict calendar en Conflict
+controls whether names of participants are shown alongside the title of an appointment. calendar en Controls whether names of participants are shown alongside the title of an appointment.
copy of: calendar en Copy of:
copy this event calendar en Copy this event
copy your changes to the clipboard, %1reload the entry%2 and merge them. calendar en Copy your changes to the clipboard, %1reload the entry%2 and merge them.
@@ -531,6 +532,7 @@ show only invitations, not yet accepted or rejected calendar en Show only invita
show only rejected events calendar en Show only rejected events
show only tentative accepted events calendar en Show only tentative accepted events
show only the date, not the year admin en Show only the date, not the year
+show participant names on event calendar en Show participant names on event
show this month calendar en Show this month
show this week calendar en Show this week
show year and age calendar en Show year and age