diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 0d84033922..686d53ec04 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -111,7 +111,7 @@ class calendar_uiforms extends calendar_ui } $owner = $this->user; } - //echo "
this->owner=$this->owner, _GET[owner]=$_GET[owner], user=$this->user => owner=$owner, extra_participants=".implode(',',$extra_participants)."
\n"; + //error_log("this->owner=$this->owner, _GET[owner]=$_GET[owner], user=$this->user => owner=$owner, extra_participants=".implode(',',$extra_participants).")"); // by default include the owner as participant (the user can remove him) $extra_participants[] = $owner; diff --git a/calendar/js/et2_widget_daycol.js b/calendar/js/et2_widget_daycol.js index ca0b534f8b..b48b5e649b 100644 --- a/calendar/js/et2_widget_daycol.js +++ b/calendar/js/et2_widget_daycol.js @@ -775,11 +775,16 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM], else if ($j(_ev.target).hasClass('calendar_calAddEvent')) { // Default handler to open a new event at the selected time - this.egw().open(null, 'calendar', 'add', { + var options = { date: _ev.target.dataset.date || this.options.date, hour: _ev.target.dataset.hour || this._parent.options.day_start, minute: _ev.target.dataset.minute || 0 - } , '_blank'); + }; + if (this.options.owner != app.calendar.state.owner) + { + options.owner = this.options.owner; + } + this.egw().open(null, 'calendar', 'add', options, '_blank'); return false; } else if (this.header.has(_ev.target).length || this.header.is(_ev.target)) diff --git a/calendar/js/et2_widget_planner.js b/calendar/js/et2_widget_planner.js index bab05c248e..149ef7db03 100644 --- a/calendar/js/et2_widget_planner.js +++ b/calendar/js/et2_widget_planner.js @@ -382,9 +382,9 @@ var et2_calendar_planner = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResize egw.accountData(user,'account_fullname',true,function(result) { for(var id in result) { - if(already_added.indexOf(id) < 0) + if(already_added.indexOf(''+id) < 0) { - this.push({id: id, label: result[id], data: {participants:id,owner:''}}); + this.push({id: id, label: result[id], data: {participants:id,owner:id}}); already_added.push(id); } } @@ -393,11 +393,11 @@ var et2_calendar_planner = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResize else // users { user = parseInt(user) - for(var j = 0; j < accounts.length && already_added.indexOf(user) < 0; j++) + for(var j = 0; j < accounts.length && already_added.indexOf(''+user) < 0; j++) { if(accounts[j].value === user) { - labels.push({id: user, label: accounts[j].label, data: {participants:user,owner:''}}); + labels.push({id: user, label: accounts[j].label, data: {participants:user,owner:user}}); already_added.push(user); break; } diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index ad15604b0d..026e50c203 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -1427,11 +1427,16 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz else if (_ev.target.dataset.date) { // Default handler to open a new event at the selected time - this.egw().open(null, 'calendar', 'add', { + var options = { date: _ev.target.dataset.date || this.day_list[0], hour: _ev.target.dataset.hour || this.options.day_start, minute: _ev.target.dataset.minute || 0 - } , '_blank'); + }; + if (this.options.owner != app.calendar.state.owner) + { + options.owner = this.options.owner; + } + this.egw().open(null, 'calendar', 'add', options , '_blank'); return false; } },