Direct events to users or groups

This commit is contained in:
Evan Prodromou 2011-04-04 22:16:38 -04:00
parent 4fea746913
commit a9856e6550
2 changed files with 15 additions and 1 deletions

View File

@ -147,6 +147,13 @@ class EventForm extends Form
_m('Description of the event.')); _m('Description of the event.'));
$this->unli(); $this->unli();
$this->li();
$toWidget = new ToSelector($this->out,
common_current_user(),
null);
$toWidget->show();
$this->unli();
$this->out->elementEnd('ul'); $this->out->elementEnd('ul');
$this->out->elementEnd('fieldset'); $this->out->elementEnd('fieldset');
} }

View File

@ -190,6 +190,12 @@ class NeweventAction extends Action
throw new ClientException(_m('Event must have an end time.')); throw new ClientException(_m('Event must have an end time.'));
} }
$options = array();
// Does the heavy-lifting for getting "To:" information
ToSelector::fillOptions($this, $options);
$profile = $this->user->getProfile(); $profile = $this->user->getProfile();
$saved = Happening::saveNew($profile, $saved = Happening::saveNew($profile,
@ -198,7 +204,8 @@ class NeweventAction extends Action
$this->title, $this->title,
$this->location, $this->location,
$this->description, $this->description,
$this->url); $this->url,
$options);
$event = Happening::fromNotice($saved); $event = Happening::fromNotice($saved);