diff options
-rw-r--r-- | languages/en.php | 3 | ||||
-rw-r--r-- | models/model.php | 6 | ||||
-rw-r--r-- | views/default/event_calendar/full_calendar_view.php | 21 |
3 files changed, 24 insertions, 6 deletions
diff --git a/languages/en.php b/languages/en.php index 782cd7a72..3d8c94e3f 100644 --- a/languages/en.php +++ b/languages/en.php @@ -50,7 +50,7 @@ 'event_calendar:month_label' => "Month", 'event_calendar:group' => "Group calendar", 'event_calendar:new' => "Add event", - 'event_calendar:submit' => "Submit", + 'event_calendar:submit' => "Save and Continue", 'event_calendar:cancel' => "Cancel", 'event_calendar:widget_title' => "Event calendar", 'event_calendar:widget:description' => "Displays your events.", @@ -310,6 +310,7 @@ You can manage calendar requests for this event here: 'event_calendar:settings:reminders:title' => "Allow sending reminders", 'event_calendar:reminder:subject' => "Reminder for event: %s", 'event_calendar:poll_suffix' => "(poll)", + 'event_calendar:cannot_drag_polls' => "Cannot change event polls.", 'event_calendar:reminder:body' => "The event %s diff --git a/models/model.php b/models/model.php index d25c8dca3..aea6bca2f 100644 --- a/models/model.php +++ b/models/model.php @@ -2144,7 +2144,6 @@ function event_calendar_get_page_content_fullcalendar_events($start_date,$end_da 'id' => $event->guid, 'guid' => $event->guid, 'title' => $event->title, - 'url' => elgg_get_site_url().'event_calendar/view_light_box/'.$event->guid, 'start' => date('c',$ed['start_time']), 'end' => date('c',$ed['end_time']), ); @@ -2157,6 +2156,11 @@ function event_calendar_get_page_content_fullcalendar_events($start_date,$end_da if ($polls_supported && isset($e['is_event_poll']) && $e['is_event_poll']) { $event_item['className'] = 'event-poll-class'; $event_item['title'] .= ' '.elgg_echo('event_calendar:poll_suffix'); + $event_item['is_event_poll'] = TRUE; + $event_item['url'] = elgg_get_site_url().'event_poll/vote/'.$event->guid; + } else { + $event_item['is_event_poll'] = FALSE; + $event_item['url'] = elgg_get_site_url().'event_calendar/view_light_box/'.$event->guid; } $event_array[] = $event_item; diff --git a/views/default/event_calendar/full_calendar_view.php b/views/default/event_calendar/full_calendar_view.php index d86a3ac27..bba3a66db 100644 --- a/views/default/event_calendar/full_calendar_view.php +++ b/views/default/event_calendar/full_calendar_view.php @@ -9,8 +9,12 @@ elgg_load_css('lightbox'); handleEventClick = function(event) { if (event.url) { - //window.location.href = event.url; - $.fancybox({'href':event.url}); + if (event.is_event_poll) { + window.location.href = event.url; + } else { + //window.location.href = event.url; + $.fancybox({'href':event.url}); + } return false; } }; @@ -38,8 +42,10 @@ handleDayClick = function(date,allDay,jsEvent,view) { } handleEventDrop = function(event,dayDelta,minuteDelta,allDay,revertFunc) { - - if (!confirm("<?php echo elgg_echo('event_calendar:are_you_sure'); ?>")) { + if (event.is_event_poll) { + alert("<?php echo elgg_echo('event_calendar:cannot_drag_polls'); ?>"); + revertFunc(); + } else if (!confirm("<?php echo elgg_echo('event_calendar:are_you_sure'); ?>")) { revertFunc(); } else { elgg.action('event_calendar/modify_full_calendar', @@ -67,6 +73,12 @@ getISODate = function(d) { return year +"-"+month+"-"+day; } +handleEventRender = function(event, element, view) { + if (event.is_event_poll) { + element.draggable = false; + } +} + handleGetEvents = function(start, end, callback) { var start_date = getISODate(start); var end_date = getISODate(end); @@ -105,6 +117,7 @@ $(document).ready(function() { ignoreTimezone: true, editable: true, slotMinutes: 15, + eventRender: handleEventRender, eventDrop: handleEventDrop, eventClick: handleEventClick, dayClick: handleDayClick, |