Fix clicking inside a single other user's calendar did not invite that user when new event preference was 'Just me'

This commit is contained in:
nathangray 2016-09-27 10:21:25 -06:00
parent 76c83eb2a9
commit 16d7b6d5ae
3 changed files with 7 additions and 5 deletions

View File

@ -77,7 +77,9 @@ class calendar_uiforms extends calendar_ui
*/ */
function &default_add_event() function &default_add_event()
{ {
$extra_participants = $_GET['participants'] ? explode(',',$_GET['participants']) : array(); $extra_participants = $_GET['participants'] ?
(!is_array($_GET['participants']) ? explode(',',$_GET['participants']) : $_GET['participants']) :
array();
// if participant is a contact, add its link title as title // if participant is a contact, add its link title as title
foreach($extra_participants as $uid) foreach($extra_participants as $uid)
@ -98,7 +100,7 @@ class calendar_uiforms extends calendar_ui
} }
if(is_array($owner)) if(is_array($owner))
{ {
if($this->cal_prefs['default_participant']) if($this->cal_prefs['default_participant'] || count($participants) === 0 && count($owner) === 1)
{ {
$extra_participants += $owner; $extra_participants += $owner;
} }

View File

@ -1077,7 +1077,7 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte
hour: _ev.target.dataset.hour || this._parent.options.day_start, hour: _ev.target.dataset.hour || this._parent.options.day_start,
minute: _ev.target.dataset.minute || 0 minute: _ev.target.dataset.minute || 0
}; };
if (this.options.owner != app.calendar.state.owner) if (this.options.owner.toString() !== app.calendar.state.owner.toString())
{ {
options.owner = this.options.owner; options.owner = this.options.owner;
} }
@ -1096,7 +1096,7 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte
end: end, end: end,
non_blocking: true non_blocking: true
} }
if (this.options.owner != app.calendar.state.owner) if (this.options.owner.toString() !== app.calendar.state.owner.toString())
{ {
options.owner = this.options.owner; options.owner = this.options.owner;
} }

View File

@ -1861,7 +1861,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
hour: target.dataset.hour || this._parent.options.day_start, hour: target.dataset.hour || this._parent.options.day_start,
minute: target.dataset.minute || 0 minute: target.dataset.minute || 0
}; };
if (this.options.owner != app.calendar.state.owner) if (this.options.owner.toString() !== app.calendar.state.owner.toString())
{ {
options.owner = this.options.owner; options.owner = this.options.owner;
} }