From a9856e6550e27bb0673332adc444402e5c322e0e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 4 Apr 2011 22:16:38 -0400 Subject: [PATCH] Direct events to users or groups --- plugins/Event/eventform.php | 7 +++++++ plugins/Event/newevent.php | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/Event/eventform.php b/plugins/Event/eventform.php index 31fecb1278..dfdb65a30d 100644 --- a/plugins/Event/eventform.php +++ b/plugins/Event/eventform.php @@ -147,6 +147,13 @@ class EventForm extends Form _m('Description of the event.')); $this->unli(); + $this->li(); + $toWidget = new ToSelector($this->out, + common_current_user(), + null); + $toWidget->show(); + $this->unli(); + $this->out->elementEnd('ul'); $this->out->elementEnd('fieldset'); } diff --git a/plugins/Event/newevent.php b/plugins/Event/newevent.php index 082f12bb4b..93baa37b6b 100644 --- a/plugins/Event/newevent.php +++ b/plugins/Event/newevent.php @@ -190,6 +190,12 @@ class NeweventAction extends Action 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(); $saved = Happening::saveNew($profile, @@ -198,7 +204,8 @@ class NeweventAction extends Action $this->title, $this->location, $this->description, - $this->url); + $this->url, + $options); $event = Happening::fromNotice($saved);