diff options
Diffstat (limited to 'apps/calendar')
-rw-r--r-- | apps/calendar/ajax/calendar/activation.php (renamed from apps/calendar/ajax/activation.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/calendar/delete.php (renamed from apps/calendar/ajax/deletecalendar.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/calendar/edit.form.php (renamed from apps/calendar/ajax/editcalendar.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/calendar/edit.php | 20 | ||||
-rw-r--r-- | apps/calendar/ajax/calendar/new.form.php (renamed from apps/calendar/ajax/newcalendar.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/calendar/new.php (renamed from apps/calendar/ajax/createcalendar.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/calendar/overview.php (renamed from apps/calendar/ajax/choosecalendar.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/calendar/updatecalendar.php (renamed from apps/calendar/ajax/updatecalendar.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/changeview.php | 8 | ||||
-rw-r--r-- | apps/calendar/ajax/event/delete.php (renamed from apps/calendar/ajax/deleteevent.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/event/edit.form.php (renamed from apps/calendar/ajax/editeventform.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/event/edit.php (renamed from apps/calendar/ajax/editevent.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/event/move.php (renamed from apps/calendar/ajax/moveevent.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/event/new.form.php (renamed from apps/calendar/ajax/neweventform.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/event/new.php (renamed from apps/calendar/ajax/newevent.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/event/resize.php (renamed from apps/calendar/ajax/resizeevent.php) | 2 | ||||
-rwxr-xr-x | apps/calendar/ajax/events.php | 6 | ||||
-rw-r--r-- | apps/calendar/ajax/import/dialog.php (renamed from apps/calendar/ajax/importdialog.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/import/import.php | 120 | ||||
-rw-r--r-- | apps/calendar/ajax/settings/gettimezonedetection.php (renamed from apps/calendar/ajax/gettimezonedetection.php) | 2 | ||||
-rwxr-xr-x | apps/calendar/ajax/settings/guesstimezone.php (renamed from apps/calendar/ajax/guesstimezone.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/settings/settimeformat.php (renamed from apps/calendar/ajax/settimeformat.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/settings/settimezone.php (renamed from apps/calendar/ajax/settimezone.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/settings/timeformat.php (renamed from apps/calendar/ajax/timeformat.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/settings/timezonedetection.php (renamed from apps/calendar/ajax/timezonedetection.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/share/changepermission.php (renamed from apps/calendar/ajax/changepermission.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/share/dropdown.php (renamed from apps/calendar/ajax/share.dropdown.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/share/share.php (renamed from apps/calendar/ajax/share.php) | 2 | ||||
-rw-r--r-- | apps/calendar/ajax/share/unshare.php (renamed from apps/calendar/ajax/unshare.php) | 2 | ||||
-rw-r--r-- | apps/calendar/index.php | 3 | ||||
-rw-r--r-- | apps/calendar/js/calendar.js | 30 | ||||
-rwxr-xr-x | apps/calendar/js/geo.js | 2 | ||||
-rw-r--r-- | apps/calendar/js/loader.js | 6 | ||||
-rw-r--r-- | apps/calendar/js/settings.js | 10 | ||||
-rw-r--r-- | apps/calendar/templates/part.editevent.php | 4 | ||||
-rw-r--r-- | apps/calendar/templates/part.newevent.php | 2 |
36 files changed, 201 insertions, 60 deletions
diff --git a/apps/calendar/ajax/activation.php b/apps/calendar/ajax/calendar/activation.php index ada2e44547b..7677d85aff3 100644 --- a/apps/calendar/ajax/activation.php +++ b/apps/calendar/ajax/calendar/activation.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once ("../../../lib/base.php"); +require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); $calendarid = $_POST['calendarid']; diff --git a/apps/calendar/ajax/deletecalendar.php b/apps/calendar/ajax/calendar/delete.php index 901cbbfcb08..a2f5311731c 100644 --- a/apps/calendar/ajax/deletecalendar.php +++ b/apps/calendar/ajax/calendar/delete.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/editcalendar.php b/apps/calendar/ajax/calendar/edit.form.php index 7aeb5bbe305..8922b3eba4e 100644 --- a/apps/calendar/ajax/editcalendar.php +++ b/apps/calendar/ajax/calendar/edit.form.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/calendar/edit.php b/apps/calendar/ajax/calendar/edit.php new file mode 100644 index 00000000000..8922b3eba4e --- /dev/null +++ b/apps/calendar/ajax/calendar/edit.php @@ -0,0 +1,20 @@ +<?php +/** + * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +require_once('../../../../lib/base.php'); +OC_JSON::checkLoggedIn(); +OC_JSON::checkAppEnabled('calendar'); + +$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions(); +$calendar = OC_Calendar_App::getCalendar($_GET['calendarid']); +$tmpl = new OC_Template("calendar", "part.editcalendar"); +$tmpl->assign('new', false); +$tmpl->assign('calendarcolor_options', $calendarcolor_options); +$tmpl->assign('calendar', $calendar); +$tmpl->printPage(); +?> diff --git a/apps/calendar/ajax/newcalendar.php b/apps/calendar/ajax/calendar/new.form.php index af3ba4fbbea..6e7423cbe92 100644 --- a/apps/calendar/ajax/newcalendar.php +++ b/apps/calendar/ajax/calendar/new.form.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); $l10n = new OC_L10N('calendar'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/createcalendar.php b/apps/calendar/ajax/calendar/new.php index 8d7b12f9b89..228e6247724 100644 --- a/apps/calendar/ajax/createcalendar.php +++ b/apps/calendar/ajax/calendar/new.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/calendar/ajax/choosecalendar.php b/apps/calendar/ajax/calendar/overview.php index 9281c8edbdc..2f73f5d0710 100644 --- a/apps/calendar/ajax/choosecalendar.php +++ b/apps/calendar/ajax/calendar/overview.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); $l10n = new OC_L10N('calendar'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/updatecalendar.php b/apps/calendar/ajax/calendar/updatecalendar.php index 5add6d92bfa..f400c8c14b4 100644 --- a/apps/calendar/ajax/updatecalendar.php +++ b/apps/calendar/ajax/calendar/updatecalendar.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/calendar/ajax/changeview.php b/apps/calendar/ajax/changeview.php index df3e2827b7e..034c7129cab 100644 --- a/apps/calendar/ajax/changeview.php +++ b/apps/calendar/ajax/changeview.php @@ -9,16 +9,16 @@ require_once ('../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); -$currentview = $_GET['v']; -switch($currentview){ +$view = $_GET['v']; +switch($view){ case 'agendaWeek': case 'month'; case 'list': break; default: - OC_JSON::error(); + OC_JSON::error(array('message'=>'unexspected parameter: ' . $view)); exit; } -OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'currentview', $currentview); +OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'currentview', $view); OC_JSON::success(); ?>
\ No newline at end of file diff --git a/apps/calendar/ajax/deleteevent.php b/apps/calendar/ajax/event/delete.php index b25a5af1a29..862dec6bf5b 100644 --- a/apps/calendar/ajax/deleteevent.php +++ b/apps/calendar/ajax/event/delete.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); $l10n = new OC_L10N('calendar'); diff --git a/apps/calendar/ajax/editeventform.php b/apps/calendar/ajax/event/edit.form.php index 9ae3ffa8d94..837edbbbf05 100644 --- a/apps/calendar/ajax/editeventform.php +++ b/apps/calendar/ajax/event/edit.form.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); if(!OC_USER::isLoggedIn()) { die('<script type="text/javascript">document.location = oc_webroot;</script>'); diff --git a/apps/calendar/ajax/editevent.php b/apps/calendar/ajax/event/edit.php index 5a487da1758..64daffddef0 100644 --- a/apps/calendar/ajax/editevent.php +++ b/apps/calendar/ajax/event/edit.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/moveevent.php b/apps/calendar/ajax/event/move.php index f2256d4eee6..8150fdbaa32 100644 --- a/apps/calendar/ajax/moveevent.php +++ b/apps/calendar/ajax/event/move.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); $id = $_POST['id']; diff --git a/apps/calendar/ajax/neweventform.php b/apps/calendar/ajax/event/new.form.php index 3870c879b0e..c19928a727e 100644 --- a/apps/calendar/ajax/neweventform.php +++ b/apps/calendar/ajax/event/new.form.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); if(!OC_USER::isLoggedIn()) { die('<script type="text/javascript">document.location = oc_webroot;</script>'); diff --git a/apps/calendar/ajax/newevent.php b/apps/calendar/ajax/event/new.php index c7c4d29943a..59fda79da73 100644 --- a/apps/calendar/ajax/newevent.php +++ b/apps/calendar/ajax/event/new.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); $l10n = new OC_L10N('calendar'); diff --git a/apps/calendar/ajax/resizeevent.php b/apps/calendar/ajax/event/resize.php index 68347906529..aa2d420e77d 100644 --- a/apps/calendar/ajax/resizeevent.php +++ b/apps/calendar/ajax/event/resize.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); $id = $_POST['id']; diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php index 96ee6775f7f..1747b2ac1a8 100755 --- a/apps/calendar/ajax/events.php +++ b/apps/calendar/ajax/events.php @@ -13,8 +13,8 @@ OC_JSON::checkAppEnabled('calendar'); $start = DateTime::createFromFormat('U', $_GET['start']); $end = DateTime::createFromFormat('U', $_GET['end']); -if($_GET['calendar_id'] == 'shared'){ - $calendars = OC_Calendar_Share::allSharedwithuser(OC_USER::getUser(), OC_Calendar_Share::CALENDAR, 1); +if($_GET['calendar_id'] == 'shared_rw' || $_GET['calendar_id'] == 'shared_r'){ + $calendars = OC_Calendar_Share::allSharedwithuser(OC_USER::getUser(), OC_Calendar_Share::CALENDAR, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r'); $events = array(); foreach($calendars as $calendar){ $calendarevents = OC_Calendar_Object::allInPeriod($calendar['calendarid'], $start, $end); @@ -80,4 +80,4 @@ foreach($events as $event){ } } OC_JSON::encodedPrint($return); -?>
\ No newline at end of file +?> diff --git a/apps/calendar/ajax/importdialog.php b/apps/calendar/ajax/import/dialog.php index f6b8453fc22..2e002092150 100644 --- a/apps/calendar/ajax/importdialog.php +++ b/apps/calendar/ajax/import/dialog.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_Util::checkAppEnabled('calendar'); $l10n = new OC_L10N('calendar'); diff --git a/apps/calendar/ajax/import/import.php b/apps/calendar/ajax/import/import.php new file mode 100644 index 00000000000..96d7af48341 --- /dev/null +++ b/apps/calendar/ajax/import/import.php @@ -0,0 +1,120 @@ +<?php +/** + * Copyright (c) 2012 Georg Ehrke <ownclouddev at georgswebsite dot de> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ +//check for calendar rights or create new one +ob_start(); +require_once('../../../../lib/base.php'); +OC_JSON::checkLoggedIn(); +OC_Util::checkAppEnabled('calendar'); +$nl = "\n"; +$progressfile = OC::$SERVERROOT . '/apps/calendar/import_tmp/' . md5(session_id()) . '.txt'; +if(is_writable('import_tmp/')){ + $progressfopen = fopen($progressfile, 'w'); + fwrite($progressfopen, '10'); + fclose($progressfopen); +} +$file = OC_Filesystem::file_get_contents($_POST['path'] . '/' . $_POST['file']); +if($_POST['method'] == 'new'){ + $id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname']); + OC_Calendar_Calendar::setCalendarActive($id, 1); +}else{ + $calendar = OC_Calendar_App::getCalendar($_POST['id']); + if($calendar['userid'] != OC_USER::getUser()){ + OC_JSON::error(); + exit(); + } + $id = $_POST['id']; +} +//analyse the calendar file +if(is_writable('import_tmp/')){ + $progressfopen = fopen($progressfile, 'w'); + fwrite($progressfopen, '20'); + fclose($progressfopen); +} +$searchfor = array('VEVENT', 'VTODO', 'VJOURNAL'); +$parts = $searchfor; +$filearr = explode($nl, $file); +$inelement = false; +$parts = array(); +$i = 0; +foreach($filearr as $line){ + foreach($searchfor as $search){ + if(substr_count($line, $search) == 1){ + list($attr, $val) = explode(':', $line); + if($attr == 'BEGIN'){ + $parts[]['begin'] = $i; + $inelement = true; + } + if($attr == 'END'){ + $parts[count($parts) - 1]['end'] = $i; + $inelement = false; + } + } + } + $i++; +} +//import the calendar +if(is_writable('import_tmp/')){ + $progressfopen = fopen($progressfile, 'w'); + fwrite($progressfopen, '40'); + fclose($progressfopen); +} +$start = ''; +for ($i = 0; $i < $parts[0]['begin']; $i++) { + if($i == 0){ + $start = $filearr[0]; + }else{ + $start .= $nl . $filearr[$i]; + } +} +$end = ''; +for($i = $parts[count($parts) - 1]['end'] + 1;$i <= count($filearr) - 1; $i++){ + if($i == $parts[count($parts) - 1]['end'] + 1){ + $end = $filearr[$parts[count($parts) - 1]['end'] + 1]; + }else{ + $end .= $nl . $filearr[$i]; + } +} +if(is_writable('import_tmp/')){ + $progressfopen = fopen($progressfile, 'w'); + fwrite($progressfopen, '50'); + fclose($progressfopen); +} +$importready = array(); +foreach($parts as $part){ + for($i = $part['begin']; $i <= $part['end'];$i++){ + if($i == $part['begin']){ + $content = $filearr[$i]; + }else{ + $content .= $nl . $filearr[$i]; + } + } + $importready[] = $start . $nl . $content . $nl . $end; +} +if(is_writable('import_tmp/')){ + $progressfopen = fopen($progressfile, 'w'); + fwrite($progressfopen, '70'); + fclose($progressfopen); +} +if(count($parts) == 1){ + OC_Calendar_Object::add($id, $file); +}else{ + foreach($importready as $import){ + OC_Calendar_Object::add($id, $import); + } +} +//done the import +if(is_writable('import_tmp/')){ + $progressfopen = fopen($progressfile, 'w'); + fwrite($progressfopen, '100'); + fclose($progressfopen); +} +sleep(3); +if(is_writable('import_tmp/')){ + unlink($progressfile); +} +OC_JSON::success();
\ No newline at end of file diff --git a/apps/calendar/ajax/gettimezonedetection.php b/apps/calendar/ajax/settings/gettimezonedetection.php index ae58370712d..11255fe8ef3 100644 --- a/apps/calendar/ajax/gettimezonedetection.php +++ b/apps/calendar/ajax/settings/gettimezonedetection.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once ("../../../lib/base.php"); +require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); OC_JSON::success(array('detection' => OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezonedetection')));
\ No newline at end of file diff --git a/apps/calendar/ajax/guesstimezone.php b/apps/calendar/ajax/settings/guesstimezone.php index 41aea26985f..cfa92e1aee8 100755 --- a/apps/calendar/ajax/guesstimezone.php +++ b/apps/calendar/ajax/settings/guesstimezone.php @@ -18,7 +18,7 @@ function make_array_out_of_xml ($xml){ } return $returnarray; } -require_once ("../../../lib/base.php"); +require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); $l = new OC_L10N('calendar'); diff --git a/apps/calendar/ajax/settimeformat.php b/apps/calendar/ajax/settings/settimeformat.php index 7805120ba5e..8f65447065c 100644 --- a/apps/calendar/ajax/settimeformat.php +++ b/apps/calendar/ajax/settings/settimeformat.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); if(isset($_POST["timeformat"])){ OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]); diff --git a/apps/calendar/ajax/settimezone.php b/apps/calendar/ajax/settings/settimezone.php index c726a11471d..c639753fe2f 100644 --- a/apps/calendar/ajax/settimezone.php +++ b/apps/calendar/ajax/settings/settimezone.php @@ -7,7 +7,7 @@ */ // Init owncloud -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); $l=new OC_L10N('calendar'); diff --git a/apps/calendar/ajax/timeformat.php b/apps/calendar/ajax/settings/timeformat.php index 3533adcf8e0..e0dbe8d3cd7 100644 --- a/apps/calendar/ajax/timeformat.php +++ b/apps/calendar/ajax/settings/timeformat.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); $timeformat = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'timeformat', "24"); OC_JSON::encodedPrint(array("timeformat" => $timeformat)); diff --git a/apps/calendar/ajax/timezonedetection.php b/apps/calendar/ajax/settings/timezonedetection.php index 77e4c4f6ebe..f67bab901e7 100644 --- a/apps/calendar/ajax/timezonedetection.php +++ b/apps/calendar/ajax/settings/timezonedetection.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once ("../../../lib/base.php"); +require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); if($_POST['timezonedetection'] == 'on'){ diff --git a/apps/calendar/ajax/changepermission.php b/apps/calendar/ajax/share/changepermission.php index caee894521c..d91f87b613f 100644 --- a/apps/calendar/ajax/changepermission.php +++ b/apps/calendar/ajax/share/changepermission.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); $id = strip_tags($_GET['id']); $idtype = strip_tags($_GET['idtype']); $permission = (int) strip_tags($_GET['permission']); diff --git a/apps/calendar/ajax/share.dropdown.php b/apps/calendar/ajax/share/dropdown.php index 7e78521a76b..eb396d38fd9 100644 --- a/apps/calendar/ajax/share.dropdown.php +++ b/apps/calendar/ajax/share/dropdown.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); $user = OC_USER::getUser(); $calid = $_GET['calid']; $calendar = OC_Calendar_Calendar::find($calid); diff --git a/apps/calendar/ajax/share.php b/apps/calendar/ajax/share/share.php index 1b75c1731b9..d892727701a 100644 --- a/apps/calendar/ajax/share.php +++ b/apps/calendar/ajax/share/share.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); $id = strip_tags($_GET['id']); $idtype = strip_tags($_GET['idtype']); switch($idtype){ diff --git a/apps/calendar/ajax/unshare.php b/apps/calendar/ajax/share/unshare.php index 4b325b3da31..25a0ef48fcf 100644 --- a/apps/calendar/ajax/unshare.php +++ b/apps/calendar/ajax/share/unshare.php @@ -5,7 +5,7 @@ * later. * See the COPYING-README file. */ -require_once('../../../lib/base.php'); +require_once('../../../../lib/base.php'); $id = strip_tags($_GET['id']); $idtype = strip_tags($_GET['idtype']); switch($idtype){ diff --git a/apps/calendar/index.php b/apps/calendar/index.php index 3a7d09c98a8..e3f108afc0e 100644 --- a/apps/calendar/index.php +++ b/apps/calendar/index.php @@ -19,7 +19,8 @@ $eventSources = array(); foreach($calendars as $calendar){ $eventSources[] = OC_Calendar_Calendar::getEventSourceInfo($calendar); } -$eventSources[] = array('url' => 'ajax/events.php?calendar_id=shared', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable'=>'false'); +$eventSources[] = array('url' => 'ajax/events.php?calendar_id=shared_rw', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable'=>'true'); +$eventSources[] = array('url' => 'ajax/events.php?calendar_id=shared_r', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable' => 'false'); //Fix currentview for fullcalendar if(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month') == "oneweekview"){ OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", "agendaWeek"); diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js index 1c14a321abd..cd4a82a71b3 100644 --- a/apps/calendar/js/calendar.js +++ b/apps/calendar/js/calendar.js @@ -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(){ diff --git a/apps/calendar/js/geo.js b/apps/calendar/js/geo.js index ae6a971e938..c9cc5dd0955 100755 --- a/apps/calendar/js/geo.js +++ b/apps/calendar/js/geo.js @@ -6,7 +6,7 @@ */ if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { - $.getJSON(OC.filePath('calendar', 'ajax', 'guesstimezone.php?lat=' + position.coords.latitude + '&long=' + position.coords.longitude + ''), + $.getJSON(OC.filePath('calendar', 'ajax/settings', 'guesstimezone.php?lat=' + position.coords.latitude + '&long=' + position.coords.longitude + ''), function(data){ if (data.status == 'success' && typeof(data.message) != 'undefined'){ $('#notification').html(data.message); diff --git a/apps/calendar/js/loader.js b/apps/calendar/js/loader.js index 4e483f9864e..54003879759 100644 --- a/apps/calendar/js/loader.js +++ b/apps/calendar/js/loader.js @@ -8,7 +8,7 @@ Calendar_Import={ importdialog: function(filename){ var path = $('#dir').val(); $('body').append('<div id="calendar_import"></div>'); - $('#calendar_import').load(OC.filePath('calendar', 'ajax', 'importdialog.php'), {filename:filename, path:path}, function(){Calendar_Import.initdialog(filename);}); + $('#calendar_import').load(OC.filePath('calendar', 'ajax/import', 'dialog.php'), {filename:filename, path:path}, function(){Calendar_Import.initdialog(filename);}); }, initdialog: function(filename){ $('#calendar_import_dialog').dialog({ @@ -68,7 +68,7 @@ Calendar_Import={ if(percent < 100){ window.setTimeout('Calendar_Import.getimportstatus(\'' + progressfile + '\')', 500); }else{ - $('#import_done').css('display', 'block');
+ $('#import_done').css('display', 'block'); } }); } @@ -78,4 +78,4 @@ $(document).ready(function(){ FileActions.register('text/calendar','importcal', '', Calendar_Import.importdialog); FileActions.setDefault('text/calendar','importcal'); }; -});
\ No newline at end of file +}); diff --git a/apps/calendar/js/settings.js b/apps/calendar/js/settings.js index 73300885565..fcbfc423db3 100644 --- a/apps/calendar/js/settings.js +++ b/apps/calendar/js/settings.js @@ -3,7 +3,7 @@ $(document).ready(function(){ OC.msg.startSaving('#calendar .msg') // Serialize the data var post = $( '#timezone' ).serialize(); - $.post( OC.filePath('calendar', 'ajax', 'settimezone.php'), post, function(data){ + $.post( OC.filePath('calendar', 'ajax/settings', 'settimezone.php'), post, function(data){ //OC.msg.finishedSaving('#calendar .msg', data); }); return false; @@ -11,7 +11,7 @@ $(document).ready(function(){ $('#timezone').chosen(); $('#timeformat').change( function(){ var data = $('#timeformat').serialize(); - $.post( OC.filePath('calendar', 'ajax', 'settimeformat.php'), data, function(data){ + $.post( OC.filePath('calendar', 'ajax/settings', 'settimeformat.php'), data, function(data){ if(data == 'error'){ console.log('saving timeformat failed'); } @@ -19,15 +19,15 @@ $(document).ready(function(){ }); $('#timezonedetection').change( function(){ var post = $('#timezonedetection').serialize(); - $.post( OC.filePath('calendar', 'ajax', 'timezonedetection.php'), post, function(data){ + $.post( OC.filePath('calendar', 'ajax/settings', 'timezonedetection.php'), post, function(data){ }); }); - $.getJSON(OC.filePath('calendar', 'ajax', 'timeformat.php'), function(jsondata, status) { + $.getJSON(OC.filePath('calendar', 'ajax/settings', 'timeformat.php'), function(jsondata, status) { $('#' + jsondata.timeformat).attr('selected',true); $('#timeformat').chosen(); }); - $.getJSON(OC.filePath('calendar', 'ajax', 'gettimezonedetection.php'), function(jsondata, status){ + $.getJSON(OC.filePath('calendar', 'ajax/settings', 'gettimezonedetection.php'), function(jsondata, status){ if(jsondata.detection == 'true'){ $('#timezonedetection').attr('checked', 'checked'); } diff --git a/apps/calendar/templates/part.editevent.php b/apps/calendar/templates/part.editevent.php index b3acfc4a072..6e319e1b4e0 100644 --- a/apps/calendar/templates/part.editevent.php +++ b/apps/calendar/templates/part.editevent.php @@ -5,8 +5,8 @@ <?php echo $this->inc("part.eventform"); ?> <div style="width: 100%;text-align: center;color: #FF1D1D;" id="errorbox"></div> <span id="actions"> - <input type="button" class="submit" style="float: left;" value="<?php echo $l->t("Submit");?>" onclick="Calendar.UI.validateEventForm('ajax/editevent.php');"> - <input type="button" class="submit" style="float: left;" name="delete" value="<?php echo $l->t("Delete");?>" onclick="Calendar.UI.submitDeleteEventForm('ajax/deleteevent.php');"> + <input type="button" class="submit" style="float: left;" value="<?php echo $l->t("Submit");?>" onclick="Calendar.UI.validateEventForm('ajax/event/edit.php');"> + <input type="button" class="submit" style="float: left;" name="delete" value="<?php echo $l->t("Delete");?>" onclick="Calendar.UI.submitDeleteEventForm('ajax/event/delete.php');"> <input type="button" class="submit" style="float: right;" name="export" value="<?php echo $l->t("Export");?>" onclick="window.location='export.php?eventid=<?php echo $_['id'] ?>';"> </span> </form> diff --git a/apps/calendar/templates/part.newevent.php b/apps/calendar/templates/part.newevent.php index b1e2a5eab84..11416260344 100644 --- a/apps/calendar/templates/part.newevent.php +++ b/apps/calendar/templates/part.newevent.php @@ -3,7 +3,7 @@ <?php echo $this->inc("part.eventform"); ?> <div style="width: 100%;text-align: center;color: #FF1D1D;" id="errorbox"></div> <span id="actions"> - <input type="button" class="submit" style="float: left;" value="<?php echo $l->t("Submit");?>" onclick="Calendar.UI.validateEventForm('ajax/newevent.php');"> + <input type="button" class="submit" style="float: left;" value="<?php echo $l->t("Submit");?>" onclick="Calendar.UI.validateEventForm('ajax/event/new.php');"> </span> </form> </div> |