aboutsummaryrefslogtreecommitdiff
path: root/views/default/event_calendar/full_calendar_view.php
diff options
context:
space:
mode:
authorKevin Jardine <kevinjardine@yahoo.com>2012-03-19 17:09:30 +0100
committerKevin Jardine <kevinjardine@yahoo.com>2012-03-19 17:09:30 +0100
commit2d19bfa232be5eff43bb6c1d1eef12e681552956 (patch)
treed956a896521dfa64f70bc79686d28892ccc0e90e /views/default/event_calendar/full_calendar_view.php
parent978d6aa6283933c805622d4d24fa6068833f7817 (diff)
downloadelgg-2d19bfa232be5eff43bb6c1d1eef12e681552956.tar.gz
elgg-2d19bfa232be5eff43bb6c1d1eef12e681552956.tar.bz2
full calendar click to view, time system revamp
Diffstat (limited to 'views/default/event_calendar/full_calendar_view.php')
-rw-r--r--views/default/event_calendar/full_calendar_view.php22
1 files changed, 14 insertions, 8 deletions
diff --git a/views/default/event_calendar/full_calendar_view.php b/views/default/event_calendar/full_calendar_view.php
index d4e85724e..58aefe741 100644
--- a/views/default/event_calendar/full_calendar_view.php
+++ b/views/default/event_calendar/full_calendar_view.php
@@ -9,7 +9,9 @@ $times_supported = elgg_get_plugin_setting('times','event_calendar') != 'no';
foreach($events as $e) {
$event_item = array(
'guid' => $e->guid,
+ //'title' => '<a href="'.$e->url.'">'.$e->title.'</a>',
'title' => $e->title,
+ 'url' => $e->getURL(),
'start_date' => $e->start_date,
'end_date' => $e->real_end_time,
);
@@ -28,13 +30,14 @@ $json_events_string = json_encode($event_array);
?>
<script>
-handleEventDrop = function(event,dayDelta,minuteDelta,allDay,revertFunc) {
+handleEventClick = function(event) {
+ if (event.url) {
+ window.location.href = event.url;
+ return false;
+ }
+};
- alert(
- event.title + "(" + event.guid + ") was moved " +
- dayDelta + " days and " +
- minuteDelta + " minutes."
- );
+handleEventDrop = function(event,dayDelta,minuteDelta,allDay,revertFunc) {
if (!confirm("Are you sure about this change?")) {
revertFunc();
@@ -53,7 +56,8 @@ handleEventDrop = function(event,dayDelta,minuteDelta,allDay,revertFunc) {
}
);
}
-}
+};
+
$(document).ready(function() {
var events = <?php echo $json_events_string; ?>;
var cal_events = [];
@@ -61,6 +65,7 @@ $(document).ready(function() {
cal_events.push({
guid: events[i].guid,
title : events[i].title,
+ url: events[i].url,
start : new Date(1000*events[i].start_date),
end : new Date(1000*events[i].end_date),
allDay: events[i].allDay
@@ -74,8 +79,9 @@ $(document).ready(function() {
right: 'month,agendaWeek,agendaDay'
},
editable: true,
- slotMinutes: 5,
+ slotMinutes: 15,
eventDrop: handleEventDrop,
+ eventClick: handleEventClick,
events: cal_events
});
});