Skip to content

Commit

Permalink
Fix adding resources from basic view.
Browse files Browse the repository at this point in the history
Looks like the API has changed once, but the basic view hasn't been updated for that.
  • Loading branch information
yunosh committed Mar 7, 2016
1 parent 2099d1c commit ff433d0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions kronolith/attendees.php
Expand Up @@ -45,11 +45,14 @@
/* Get the requested resource */
$resource = Kronolith::getDriver('Resource')->getResource($newResource);

/* Do our best to see what the response will be. Note that this response
* is only guarenteed once the event is saved. */
$date = new Horde_Date(Horde_Util::getFormData('startdate'));
$end = new Horde_Date(Horde_Util::getFormData('enddate'));
$response = $resource->getResponse(array('start' => $date, 'end' => $end));
/* Do our best to see what the response will be. Note that this
* response is only guarenteed once the event is saved. */
$event = Kronolith::getDriver()->getEvent();
$event->start = new Horde_Date(Horde_Util::getFormData('startdate'));
$event->end = new Horde_Date(Horde_Util::getFormData('enddate'));
$event->start->setTimezone(date_default_timezone_get());
$event->end->setTimezone(date_default_timezone_get());
$response = $resource->getResponse($event);
$resources[$resource->getId()] = array(
'attendance' => Kronolith::PART_REQUIRED,
'response' => $response,
Expand Down

0 comments on commit ff433d0

Please sign in to comment.