From cea13ac10598078a6489650bf69c6efc45231e03 Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Wed, 9 May 2012 19:09:24 +0200 Subject: fixes for group event bugs --- views/default/event_calendar/container.php | 6 +++++- views/default/event_calendar/groupprofile_calendar.php | 4 +--- views/default/forms/event_calendar/edit.php | 13 ++++++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/views/default/event_calendar/container.php b/views/default/event_calendar/container.php index fdd7da2c6..cb5c8620c 100644 --- a/views/default/event_calendar/container.php +++ b/views/default/event_calendar/container.php @@ -1,8 +1,12 @@ elgg_echo('event_calendar:site_calendar')); +$containers = array(); +if (($site_calendar != 'no') && ($admin || !$site_calendar || ($site_calendar == 'loggedin'))) { + $containers[0] = elgg_echo('event_calendar:site_calendar'); +} $user = elgg_get_logged_in_user_entity(); $groups = $user->getGroups('',0,0); foreach ($groups as $group) { diff --git a/views/default/event_calendar/groupprofile_calendar.php b/views/default/event_calendar/groupprofile_calendar.php index 7ee09104f..c71780be8 100644 --- a/views/default/event_calendar/groupprofile_calendar.php +++ b/views/default/event_calendar/groupprofile_calendar.php @@ -26,10 +26,8 @@ if (event_calendar_activated_for_group($page_owner_entity)) { if (is_array($events) && sizeof($events) > 0) { foreach($events as $event) { - echo elgg_view("object/event_calendar",array('entity' => $event)); + echo elgg_view("object/event_calendar",array('entity' => $event['event'])); } } } - -?> \ No newline at end of file diff --git a/views/default/forms/event_calendar/edit.php b/views/default/forms/event_calendar/edit.php index d1c7967c3..278fdddce 100644 --- a/views/default/forms/event_calendar/edit.php +++ b/views/default/forms/event_calendar/edit.php @@ -140,7 +140,6 @@ $body = '
'; $body .= elgg_view('input/hidden',array('name'=>'event_action', 'value'=>$event_action)); $body .= elgg_view('input/hidden',array('name'=>'event_guid', 'value'=>$event_guid)); -//$body .= elgg_view('input/hidden',array('name'=>'group_guid', 'value'=>$vars['group_guid'])); $body .= '
'; @@ -164,10 +163,14 @@ $body .= elgg_view("input/tags",array('name' => 'tags','class'=>'event-calendar- $body .= '

'; $body .= '

'.$prefix['event_tags'].elgg_echo('event_calendar:event_tags_description').'

'; -$body .= '

'; -$body .= elgg_view('event_calendar/container',array('container_guid'=>$vars['group_guid'])); -$body .= '

'; -$body .= '

'.$prefix['calendar'].elgg_echo('event_calendar:calendar_description').'

'; +if ($event || !$vars['group_guid']) { + $body .= '

'; + $body .= elgg_view('event_calendar/container',array('container_guid'=>$vars['group_guid'])); + $body .= '

'; + $body .= '

'.$prefix['calendar'].elgg_echo('event_calendar:calendar_description').'

'; +} else { + $body .= elgg_view('input/hidden',array('name'=>'group_guid', 'value'=>$vars['group_guid'])); +} if($event_calendar_bbb_server_url) { $body .= '

'; -- cgit v1.2.3