aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/event_calendar/edit.php4
-rw-r--r--models/model.php4
-rw-r--r--start.php12
3 files changed, 17 insertions, 3 deletions
diff --git a/actions/event_calendar/edit.php b/actions/event_calendar/edit.php
index 0cc956d73..aef1a59cc 100644
--- a/actions/event_calendar/edit.php
+++ b/actions/event_calendar/edit.php
@@ -34,6 +34,10 @@ if ($event) {
add_to_river('river/object/event_calendar/create','create',$user_guid,$event->guid);
system_message(elgg_echo('event_calendar:add_event_response'));
}
+
+ if ($event->schedule_type == 'poll') {
+ forward('event_poll/add/'.$event->guid);
+ }
forward($event->getURL());
} else {
diff --git a/models/model.php b/models/model.php
index b29ad2ad7..6fe54ab3d 100644
--- a/models/model.php
+++ b/models/model.php
@@ -55,7 +55,7 @@ function event_calendar_set_event_from_form($event_guid,$group_guid) {
$required_fields[] = 'spots';
}
} else {
- $required_fields = array('title','start_date');
+ $required_fields = array('title');
}
if ($event_guid) {
@@ -2118,4 +2118,4 @@ function event_calendar_flatten_event_structure($events) {
}
}
return $flattened;
-} \ No newline at end of file
+}
diff --git a/start.php b/start.php
index 523987154..86a94fbd9 100644
--- a/start.php
+++ b/start.php
@@ -64,7 +64,7 @@ function event_calendar_init() {
elgg_extend_view('css/elgg', 'event_calendar/css');
$event_calendar_listing_format = elgg_get_plugin_setting('listing_format', 'event_calendar');
- if ($event_calendar_listing_format == 'full') {
+ if (elgg_plugin_exists('event_poll') || ($event_calendar_listing_format == 'full')) {
elgg_extend_view('css/elgg', 'fullcalendar/css');
$plugin_js = elgg_get_simplecache_url('js', 'event_calendar/fullcalendar');
elgg_register_js('elgg.full_calendar', $plugin_js);
@@ -287,6 +287,16 @@ function event_calendar_entity_menu_setup($hook, $type, $return, $params) {
if ($handler != 'event_calendar') {
return $return;
}
+ if (elgg_plugin_exists('event_poll') && $entity->canEdit() && $entity->schedule_type == 'poll') {
+ $options = array(
+ 'name' => 'schedule',
+ 'text' => elgg_echo('event_poll:schedule_button'),
+ 'title' => elgg_echo('event_poll:schedule_button'),
+ 'href' => 'event_poll/schedule/'.$entity->guid,
+ 'priority' => 150,
+ );
+ $return[] = ElggMenuItem::factory($options);
+ }
$user_guid = elgg_get_logged_in_user_guid();
if ($user_guid) {
$calendar_status = event_calendar_personal_can_manage($entity,$user_guid);