Commit 2e13e2a8 authored by jaapjansma's avatar jaapjansma

added end date to create event action

parent 2f2e16d4
...@@ -51,7 +51,8 @@ class CreateOrUpdateEvent extends AbstractAction { ...@@ -51,7 +51,8 @@ class CreateOrUpdateEvent extends AbstractAction {
new OptionGroupSpecification('event_type', 'event_type', E::ts('Event Type'), TRUE), new OptionGroupSpecification('event_type', 'event_type', E::ts('Event Type'), TRUE),
new Specification('title', 'String', E::ts('Title'), true, null, null, null, FALSE), new Specification('title', 'String', E::ts('Title'), true, null, null, null, FALSE),
new Specification('description', 'String', E::ts('Description'), false, null, null, null, FALSE), new Specification('description', 'String', E::ts('Description'), false, null, null, null, FALSE),
new Specification('start_date', 'Timestamp', E::ts('start_date'), true, null, null, null, FALSE), new Specification('start_date', 'Timestamp', E::ts('Start date'), true, null, null, null, FALSE),
new Specification('end_date', 'Timestamp', E::ts('End date'), false, null, null, null, FALSE),
)); ));
$customGroups = civicrm_api3('CustomGroup', 'get', array('extends' => 'Event', 'is_active' => 1, 'options' => array('limit' => 0))); $customGroups = civicrm_api3('CustomGroup', 'get', array('extends' => 'Event', 'is_active' => 1, 'options' => array('limit' => 0)));
...@@ -101,6 +102,9 @@ class CreateOrUpdateEvent extends AbstractAction { ...@@ -101,6 +102,9 @@ class CreateOrUpdateEvent extends AbstractAction {
$apiParams['description'] = $parameters->getParameter('description'); $apiParams['description'] = $parameters->getParameter('description');
} }
$apiParams['start_date'] = $parameters->getParameter('start_date'); $apiParams['start_date'] = $parameters->getParameter('start_date');
if ($parameters->doesParameterExists('end_date')) {
$apiParams['end_date'] = $parameters->getParameter('end_date');
}
$apiParams['event_type_id'] = $parameters->getParameter('event_type'); $apiParams['event_type_id'] = $parameters->getParameter('event_type');
foreach($this->getParameterSpecification() as $spec) { foreach($this->getParameterSpecification() as $spec) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment