some fixes around videoconference avatars and adding an automatic alarm 5min before the conference

This commit is contained in:
Ralf Becker 2020-04-07 11:10:49 +02:00
parent 72116b9587
commit 1c135b2da3
6 changed files with 51 additions and 6 deletions

View File

@ -108,8 +108,8 @@ class Photo
return 'https://gravatar.com/'.md5(trim(strtolower($this->contact))); return 'https://gravatar.com/'.md5(trim(strtolower($this->contact)));
} }
return Api\Framework::getUrl(Api\Egw::link('/api/anon_lavatar.php', [ return Api\Framework::getUrl(Api\Egw::link('/api/anon_lavatar.php', [
'firstname' => $this->contact['firstname'], 'firstname' => $this->contact['n_given'],
'lastname' => $this->contact['lastname'], 'lastname' => $this->contact['n_family'],
'id' => $this->contact['id'], 'id' => $this->contact['id'],
])); ]));
} }

View File

@ -253,7 +253,7 @@ class calendar_boupdate extends calendar_bo
{ {
$event['##videoconference'] = EGroupware\Status\Videoconference\Call::genUniqueRoomID(); $event['##videoconference'] = EGroupware\Status\Videoconference\Call::genUniqueRoomID();
} }
elseif(empty($event['videoconference'])) elseif (isset($event['videoconference']) && !$event['videoconference'])
{ {
$event['##videoconference'] = ''; $event['##videoconference'] = '';
} }

View File

@ -248,6 +248,18 @@ class calendar_uiforms extends calendar_ui
'id' => 1, 'id' => 1,
); );
} }
// add automatic alarm 5min before videoconference for all participants
if (!empty($_GET['videoconference']))
{
$offset = -5 * 60;
$alarms[1+count($alarms)] = array(
'offset' => $offset,
'time' => $start - $offset,
'all' => true,
'owner' => $owner,
'id' => 2,
);
}
return array( return array(
'participant_types' => $participant_types, 'participant_types' => $participant_types,

View File

@ -3349,6 +3349,20 @@ var CalendarApp = /** @class */ (function (_super) {
} }
return CalendarApp.DAYWISE_CACHE_ID + '::' + date + (_owner ? '-' + _owner : ''); return CalendarApp.DAYWISE_CACHE_ID + '::' + date + (_owner ? '-' + _owner : '');
}; };
/**
* Videoconference checkbox checked
*/
CalendarApp.prototype.videoconferenceOnChange = function () {
var widget = this.et2.getWidgetById('videoconference');
if (widget && widget.get_value()) {
// notify all participants
this.et2.getWidgetById('participants[notify_externals]').set_value('yes');
// add alarm for all participants 5min before videoconference
this.et2.getWidgetById('new_alarm[options]').set_value('300');
this.et2.getWidgetById('new_alarm[owner]').set_value('0'); // all participants
this.et2.getWidgetById('button[add_alarm]').click();
}
};
/** /**
* These are the keys we keep to set & remember the status, others are discarded * These are the keys we keep to set & remember the status, others are discarded
*/ */

View File

@ -4142,6 +4142,25 @@ class CalendarApp extends EgwApp
} }
return CalendarApp.DAYWISE_CACHE_ID+'::'+date+(_owner ? '-' + _owner : ''); return CalendarApp.DAYWISE_CACHE_ID+'::'+date+(_owner ? '-' + _owner : '');
} }
/**
* Videoconference checkbox checked
*/
public videoconferenceOnChange()
{
let widget = this.et2.getWidgetById('videoconference');
if (widget && widget.get_value())
{
// notify all participants
this.et2.getWidgetById('participants[notify_externals]').set_value('yes');
// add alarm for all participants 5min before videoconference
this.et2.getWidgetById('new_alarm[options]').set_value('300');
this.et2.getWidgetById('new_alarm[owner]').set_value('0'); // all participants
this.et2.getWidgetById('button[add_alarm]').click();
}
}
} }
app.classes.calendar = CalendarApp; app.classes.calendar = CalendarApp;

View File

@ -231,7 +231,7 @@
<label for="location" value="Location"/> <label for="location" value="Location"/>
<hbox span="2"> <hbox span="2">
<textbox id="location" maxlength="255" class="et2_fullWidth"/> <textbox id="location" maxlength="255" class="et2_fullWidth"/>
<checkbox label="Videoconference" id="videoconference" onchange="if (this.checked) document.getElementById('calendar-edit_notify_externals').value='yes';"/> <checkbox label="Videoconference" id="videoconference" onchange="app.calendar.videoconferenceOnChange"/>
</hbox> </hbox>
<description/> <description/>
<taglist-cat id="category" height="190" empty_label="Categories" multiple="toggle" class="et2_fullWidth" rows="1" /> <taglist-cat id="category" height="190" empty_label="Categories" multiple="toggle" class="et2_fullWidth" rows="1" />