Changeset View
Changeset View
Standalone View
Standalone View
plugins/calendar/calendar.php
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | public function startup($args) | ||||
$this->register_action('itip-status', [$this, 'event_itip_status']); | $this->register_action('itip-status', [$this, 'event_itip_status']); | ||||
$this->register_action('itip-remove', [$this, 'event_itip_remove']); | $this->register_action('itip-remove', [$this, 'event_itip_remove']); | ||||
$this->register_action('itip-decline-reply', [$this, 'mail_itip_decline_reply']); | $this->register_action('itip-decline-reply', [$this, 'mail_itip_decline_reply']); | ||||
$this->register_action('itip-delegate', [$this, 'mail_itip_delegate']); | $this->register_action('itip-delegate', [$this, 'mail_itip_delegate']); | ||||
$this->register_action('resources-list', [$this, 'resources_list']); | $this->register_action('resources-list', [$this, 'resources_list']); | ||||
$this->register_action('resources-owner', [$this, 'resources_owner']); | $this->register_action('resources-owner', [$this, 'resources_owner']); | ||||
$this->register_action('resources-calendar', [$this, 'resources_calendar']); | $this->register_action('resources-calendar', [$this, 'resources_calendar']); | ||||
$this->register_action('resources-autocomplete', [$this, 'resources_autocomplete']); | $this->register_action('resources-autocomplete', [$this, 'resources_autocomplete']); | ||||
$this->register_action('talk-room-create', [$this, 'talk_room_create']); | |||||
$this->add_hook('refresh', [$this, 'refresh']); | $this->add_hook('refresh', [$this, 'refresh']); | ||||
// remove undo information... | // remove undo information... | ||||
if (!empty($_SESSION['calendar_event_undo'])) { | if (!empty($_SESSION['calendar_event_undo'])) { | ||||
$undo = $_SESSION['calendar_event_undo']; | $undo = $_SESSION['calendar_event_undo']; | ||||
// ...after timeout | // ...after timeout | ||||
$undo_time = $this->rc->config->get('undo_timeout', 0); | $undo_time = $this->rc->config->get('undo_timeout', 0); | ||||
if ($undo['ts'] < time() - $undo_time) { | if ($undo['ts'] < time() - $undo_time) { | ||||
▲ Show 20 Lines • Show All 3,689 Lines • ▼ Show 20 Lines | public function mail_message_compose($args) | ||||
$args['param']['subject'] = $event['title']; | $args['param']['subject'] = $event['title']; | ||||
} | } | ||||
} | } | ||||
return $args; | return $args; | ||||
} | } | ||||
/** | /** | ||||
* Create a Nextcould Talk room | |||||
*/ | |||||
public function talk_room_create() | |||||
{ | |||||
require_once __DIR__ . '/lib/calendar_nextcloud_api.php'; | |||||
$api = new calendar_nextcloud_api(); | |||||
$name = (string) rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST); | |||||
$room_url = $api->talk_room_create($name); | |||||
if ($room_url) { | |||||
$this->rc->output->command('plugin.talk_room_created', ['url' => $room_url]); | |||||
} | |||||
else { | |||||
$this->rc->output->command('display_message', $this->gettext('talkroomcreateerror'), 'error'); | |||||
} | |||||
} | |||||
/** | |||||
* Get a list of email addresses of the current user (from login and identities) | * Get a list of email addresses of the current user (from login and identities) | ||||
*/ | */ | ||||
public function get_user_emails() | public function get_user_emails() | ||||
{ | { | ||||
return $this->lib->get_user_emails(); | return $this->lib->get_user_emails(); | ||||
} | } | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |