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 90af21d055
commit 7d3196a1bf
5 changed files with 37 additions and 6 deletions

View File

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

View File

@ -250,7 +250,7 @@ class calendar_boupdate extends calendar_bo
{
$event['##videoconference'] = EGroupware\Status\Videoconference\Call::genUniqueRoomID();
}
elseif(empty($event['videoconference']))
elseif (isset($event['videoconference']) && !$event['videoconference'])
{
$event['##videoconference'] = '';
}
@ -964,7 +964,7 @@ class calendar_boupdate extends calendar_bo
continue; // dont notify rejected participants or groups
}
if($userid != $GLOBALS['egw_info']['user']['account_id'] ||
if ($userid != $GLOBALS['egw_info']['user']['account_id'] ||
($userid == $GLOBALS['egw_info']['user']['account_id'] &&
$user_prefs['calendar']['receive_own_updates']==1) ||
$msg_type == MSG_ALARM)

View File

@ -241,13 +241,25 @@ class calendar_uiforms extends calendar_ui
$offset = 60 * $this->cal_prefs[$alarm_pref];
$alarms[1] = array(
'default' => 1,
'offset' => $offset ,
'offset' => $offset,
'time' => $start - $offset,
'all' => false,
'owner' => $owner,
'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(
'participant_types' => $participant_types,

View File

@ -4180,6 +4180,25 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
}
}
}
},
/**
* Videoconference checkbox checked
*/
videoconferenceOnChange: function()
{
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();
}
}
});}).call(this);

View File

@ -233,7 +233,7 @@
<label for="location" value="Location"/>
<hbox span="2">
<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>
<description/>
<taglist-cat id="category" height="190" empty_label="Categories" multiple="toggle" class="et2_fullWidth" rows="1" />