|
|
|
|
@ -70,7 +70,7 @@ Calendar={ |
|
|
|
|
$('#event').dialog('destroy').remove(); |
|
|
|
|
}else{ |
|
|
|
|
Calendar.UI.loading(true); |
|
|
|
|
$('#dialog_holder').load(OC.filePath('calendar', 'ajax', 'neweventform.php'), {start:start, end:end, allday:allday?1:0}, Calendar.UI.startEventDialog); |
|
|
|
|
$('#dialog_holder').load(OC.filePath('calendar', 'ajax/event', 'new.form.php'), {start:start, end:end, allday:allday?1:0}, Calendar.UI.startEventDialog); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
editEvent:function(calEvent, jsEvent, view){ |
|
|
|
|
@ -80,7 +80,7 @@ Calendar={ |
|
|
|
|
$('#event').dialog('destroy').remove(); |
|
|
|
|
}else{ |
|
|
|
|
Calendar.UI.loading(true); |
|
|
|
|
$('#dialog_holder').load(OC.filePath('calendar', 'ajax', 'editeventform.php') + '?id=' + id, Calendar.UI.startEventDialog); |
|
|
|
|
$('#dialog_holder').load(OC.filePath('calendar', 'ajax/event', 'edit.form.php') + '?id=' + id, Calendar.UI.startEventDialog); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
submitDeleteEventForm:function(url){ |
|
|
|
|
@ -142,7 +142,7 @@ Calendar={ |
|
|
|
|
moveEvent:function(event, dayDelta, minuteDelta, allDay, revertFunc){ |
|
|
|
|
$('.tipsy').remove(); |
|
|
|
|
Calendar.UI.loading(true); |
|
|
|
|
$.post(OC.filePath('calendar', 'ajax', 'moveevent.php'), { id: event.id, dayDelta: dayDelta, minuteDelta: minuteDelta, allDay: allDay?1:0, lastmodified: event.lastmodified}, |
|
|
|
|
$.post(OC.filePath('calendar', 'ajax/event', 'move.php'), { id: event.id, dayDelta: dayDelta, minuteDelta: minuteDelta, allDay: allDay?1:0, lastmodified: event.lastmodified}, |
|
|
|
|
function(data) { |
|
|
|
|
Calendar.UI.loading(false); |
|
|
|
|
if (data.status == 'success'){ |
|
|
|
|
@ -157,7 +157,7 @@ Calendar={ |
|
|
|
|
resizeEvent:function(event, dayDelta, minuteDelta, revertFunc){ |
|
|
|
|
$('.tipsy').remove(); |
|
|
|
|
Calendar.UI.loading(true); |
|
|
|
|
$.post(OC.filePath('calendar', 'ajax', 'resizeevent.php'), { id: event.id, dayDelta: dayDelta, minuteDelta: minuteDelta, lastmodified: event.lastmodified}, |
|
|
|
|
$.post(OC.filePath('calendar', 'ajax/event', 'resize.php'), { id: event.id, dayDelta: dayDelta, minuteDelta: minuteDelta, lastmodified: event.lastmodified}, |
|
|
|
|
function(data) { |
|
|
|
|
Calendar.UI.loading(false); |
|
|
|
|
if (data.status == 'success'){ |
|
|
|
|
@ -374,7 +374,7 @@ Calendar={ |
|
|
|
|
$('#choosecalendar_dialog').dialog('moveToTop'); |
|
|
|
|
}else{ |
|
|
|
|
Calendar.UI.loading(true); |
|
|
|
|
$('#dialog_holder').load(OC.filePath('calendar', 'ajax', 'choosecalendar.php'), function(){ |
|
|
|
|
$('#dialog_holder').load(OC.filePath('calendar', 'ajax/calendar', 'overview.php'), function(){ |
|
|
|
|
$('#choosecalendar_dialog').dialog({ |
|
|
|
|
width : 600, |
|
|
|
|
close : function(event, ui) { |
|
|
|
|
@ -388,7 +388,7 @@ Calendar={ |
|
|
|
|
activation:function(checkbox, calendarid) |
|
|
|
|
{ |
|
|
|
|
Calendar.UI.loading(true); |
|
|
|
|
$.post(OC.filePath('calendar', 'ajax', 'activation.php'), { calendarid: calendarid, active: checkbox.checked?1:0 }, |
|
|
|
|
$.post(OC.filePath('calendar', 'ajax/calendar', 'activation.php'), { calendarid: calendarid, active: checkbox.checked?1:0 }, |
|
|
|
|
function(data) { |
|
|
|
|
Calendar.UI.loading(false); |
|
|
|
|
if (data.status == 'success'){ |
|
|
|
|
@ -403,13 +403,13 @@ Calendar={ |
|
|
|
|
}, |
|
|
|
|
newCalendar:function(object){ |
|
|
|
|
var tr = $(document.createElement('tr')) |
|
|
|
|
.load(OC.filePath('calendar', 'ajax', 'newcalendar.php'), |
|
|
|
|
.load(OC.filePath('calendar', 'ajax/calendar', 'new.form.php'), |
|
|
|
|
function(){Calendar.UI.Calendar.colorPicker(this)}); |
|
|
|
|
$(object).closest('tr').after(tr).hide(); |
|
|
|
|
}, |
|
|
|
|
edit:function(object, calendarid){ |
|
|
|
|
var tr = $(document.createElement('tr')) |
|
|
|
|
.load(OC.filePath('calendar', 'ajax', 'editcalendar.php') + "?calendarid="+calendarid, |
|
|
|
|
.load(OC.filePath('calendar', 'ajax/calendar', 'edit.form.php') + "?calendarid="+calendarid, |
|
|
|
|
function(){Calendar.UI.Calendar.colorPicker(this)}); |
|
|
|
|
$(object).closest('tr').after(tr).hide(); |
|
|
|
|
}, |
|
|
|
|
@ -418,7 +418,7 @@ Calendar={ |
|
|
|
|
if(check == false){ |
|
|
|
|
return false; |
|
|
|
|
}else{ |
|
|
|
|
$.post(OC.filePath('calendar', 'ajax', 'deletecalendar.php'), { calendarid: calid}, |
|
|
|
|
$.post(OC.filePath('calendar', 'ajax/calendar', 'delete.php'), { calendarid: calid}, |
|
|
|
|
function(data) { |
|
|
|
|
if (data.status == 'success'){ |
|
|
|
|
var url = 'ajax/events.php?calendar_id='+calid; |
|
|
|
|
@ -443,9 +443,9 @@ Calendar={ |
|
|
|
|
|
|
|
|
|
var url; |
|
|
|
|
if (calendarid == 'new'){ |
|
|
|
|
url = OC.filePath('calendar', 'ajax', 'createcalendar.php'); |
|
|
|
|
url = OC.filePath('calendar', 'ajax/calendar', 'new.php'); |
|
|
|
|
}else{ |
|
|
|
|
url = OC.filePath('calendar', 'ajax', 'updatecalendar.php'); |
|
|
|
|
url = OC.filePath('calendar', 'ajax/calendar', 'update.php'); |
|
|
|
|
} |
|
|
|
|
$.post(url, { id: calendarid, name: displayname, active: active, description: description, color: calendarcolor }, |
|
|
|
|
function(data){ |
|
|
|
|
@ -500,7 +500,7 @@ Calendar={ |
|
|
|
|
dropdown:function(userid, calid){ |
|
|
|
|
$('.calendar_share_dropdown').remove(); |
|
|
|
|
$('<div class="calendar_share_dropdown"></div>').appendTo('#'+userid+'_'+calid); |
|
|
|
|
$.get(OC.filePath('calendar', 'ajax', 'share.dropdown.php') + '?calid=' + calid, function(data){ |
|
|
|
|
$.get(OC.filePath('calendar', 'ajax/share', 'dropdown.php') + '?calid=' + calid, function(data){ |
|
|
|
|
$('#'+userid+'_'+calid+' > .calendar_share_dropdown').html(data); |
|
|
|
|
$('#'+userid+'_'+calid+' > .calendar_share_dropdown').show('blind'); |
|
|
|
|
$('#share_user').chosen(); |
|
|
|
|
@ -510,7 +510,7 @@ Calendar={ |
|
|
|
|
Calendar.UI.Share.idtype = 'calendar'; |
|
|
|
|
}, |
|
|
|
|
share:function(id, idtype, sharewith, sharetype){ |
|
|
|
|
$.getJSON(OC.filePath('calendar', 'ajax', 'share.php'),{id:id, idtype:idtype, sharewith:sharewith, sharetype:sharetype}, function(data){ |
|
|
|
|
$.getJSON(OC.filePath('calendar', 'ajax/share', 'share.php'),{id:id, idtype:idtype, sharewith:sharewith, sharetype:sharetype}, function(data){ |
|
|
|
|
if(sharetype == 'public'){ |
|
|
|
|
$('#public_token').val(OC.linkTo('calendar', 'share.php?t=' + data.message)); |
|
|
|
|
$('#public_token').css('display', 'block'); |
|
|
|
|
@ -518,7 +518,7 @@ Calendar={ |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
unshare:function(id, idtype, sharewith, sharetype){ |
|
|
|
|
$.getJSON(OC.filePath('calendar', 'ajax', 'unshare.php'),{id:id, idtype:idtype, sharewith:sharewith, sharetype:sharetype}, function(){ |
|
|
|
|
$.getJSON(OC.filePath('calendar', 'ajax/share', 'unshare.php'),{id:id, idtype:idtype, sharewith:sharewith, sharetype:sharetype}, function(){ |
|
|
|
|
if(sharetype == 'public'){ |
|
|
|
|
$('#public_token').val(''); |
|
|
|
|
$('#public_token').css('display', 'none'); |
|
|
|
|
@ -526,7 +526,7 @@ Calendar={ |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
changepermission:function(id, idtype, sharewith, sharetype, permission){ |
|
|
|
|
$.getJSON(OC.filePath('calendar', 'ajax', 'changepermission.php'),{id:id, idtype:idtype, sharewith: sharewith, sharetype:sharetype, permission: (permission?1:0)}); |
|
|
|
|
$.getJSON(OC.filePath('calendar', 'ajax/share', 'changepermission.php'),{id:id, idtype:idtype, sharewith: sharewith, sharetype:sharetype, permission: (permission?1:0)}); |
|
|
|
|
}, |
|
|
|
|
init:function(){ |
|
|
|
|
$('.calendar_share_dropdown').live('mouseleave', function(){ |
|
|
|
|
|