Cancelling RSVPs now seems to work.

This commit is contained in:
Mikael Nordfeldth
2016-01-20 16:10:10 +01:00
parent 9accd953e4
commit 21cc737f5c
7 changed files with 50 additions and 249 deletions

View File

@@ -78,9 +78,10 @@ class EventPlugin extends ActivityVerbHandlerPlugin
$m->connect('main/event/new',
array('action' => 'newevent'));
$m->connect('main/event/rsvp',
array('action' => 'newrsvp'));
$m->connect('main/event/rsvp/cancel',
array('action' => 'cancelrsvp'));
array('action' => 'rsvp'));
$m->connect('main/event/rsvp/:rsvp', // this will probably change to include event notice id
array('action' => 'rsvp'),
array('rsvp' => '[a-z]+'));
$m->connect('event/:id',
array('action' => 'showevent'),
array('id' => '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'));
@@ -433,14 +434,7 @@ class EventPlugin extends ActivityVerbHandlerPlugin
$out->elementEnd('div');
if ($scoped instanceof Profile) {
$rsvp = $event->getRSVP($scoped);
if (empty($rsvp)) {
$form = new RSVPForm($out, array('event'=>$event));
} else {
$form = new CancelRSVPForm($out, array('rsvp'=>$rsvp));
}
$form = new RSVPForm($out, array('event'=>$event, 'scoped'=>$scoped));
$form->show();
}
$out->elementEnd('div');