Only load default identity on main calendar screen
This commit is contained in:
parent
b242b551ba
commit
d181ea9a17
2 changed files with 7 additions and 10 deletions
|
@ -466,13 +466,6 @@ class calendar extends rcube_plugin
|
|||
case "new":
|
||||
// create UID for new event
|
||||
$event['uid'] = $this->generate_uid();
|
||||
|
||||
// set current user as organizer
|
||||
if (FALSE && !$event['attendees']) {
|
||||
$identity = $this->rc->user->get_identity();
|
||||
$event['attendees'][] = array('role' => 'ORGANIZER', 'name' => $identity['name'], 'email' => $identity['email']);
|
||||
}
|
||||
|
||||
$this->prepare_event($event, $action);
|
||||
if ($success = $this->driver->new_event($event))
|
||||
$this->cleanup_event($event);
|
||||
|
@ -601,7 +594,7 @@ class calendar extends rcube_plugin
|
|||
$end = get_input_value('end', RCUBE_INPUT_GET);
|
||||
if (!$start) $start = mktime(0, 0, 0, 1, date('n'), date('Y')-1);
|
||||
if (!$end) $end = mktime(0, 0, 0, 31, 12, date('Y')+10);
|
||||
$calendar_name = get_input_value('source', RCUBE_INPUT_GET);
|
||||
$calendar_name = get_input_value('source', RCUBE_INPUT_GET);
|
||||
$events = $this->driver->load_events($start, $end, null, $calendar_name, 0);
|
||||
|
||||
header("Content-Type: text/calendar");
|
||||
|
@ -668,8 +661,10 @@ class calendar extends rcube_plugin
|
|||
$settings['hidden_calendars'] = array_filter(explode(',', $this->rc->config->get('hidden_calendars', '')));
|
||||
|
||||
// get user identity to create default attendee
|
||||
$identity = $this->rc->user->get_identity();
|
||||
$settings['event_owner'] = array('name' => $identity['name'], 'email' => $identity['email']);
|
||||
if ($this->ui->screen == 'calendar') {
|
||||
$identity = $this->rc->user->get_identity();
|
||||
$settings['event_owner'] = array('name' => $identity['name'], 'email' => $identity['email']);
|
||||
}
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
|
|
@ -26,11 +26,13 @@ class calendar_ui
|
|||
{
|
||||
private $rc;
|
||||
private $calendar;
|
||||
public $screen;
|
||||
|
||||
function __construct($calendar)
|
||||
{
|
||||
$this->calendar = $calendar;
|
||||
$this->rc = $calendar->rc;
|
||||
$this->screen = $this->rc->task == 'calendar' ? ($this->rc->action ? $this->rc->action: 'calendar') : 'other';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue