2011-08-11 13:22:07 +04:00
|
|
|
<?php
|
|
|
|
/*************************************************
|
|
|
|
* ownCloud - Calendar Plugin *
|
|
|
|
* *
|
|
|
|
* (c) Copyright 2011 Georg Ehrke *
|
|
|
|
* author: Georg Ehrke *
|
|
|
|
* email: ownclouddev at georgswebsite dot de *
|
|
|
|
* homepage: ownclouddev.georgswebsite.de *
|
|
|
|
* manual: ownclouddev.georgswebsite.de/manual *
|
2011-08-19 22:33:48 +04:00
|
|
|
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
|
2011-08-11 13:22:07 +04:00
|
|
|
* *
|
|
|
|
* If you are not able to view the License, *
|
|
|
|
* <http://www.gnu.org/licenses/> *
|
|
|
|
* <http://ownclouddev.georgswebsite.de/license/> *
|
|
|
|
* please write to the Free Software Foundation. *
|
|
|
|
* Address: *
|
|
|
|
* 59 Temple Place, Suite 330, Boston, *
|
|
|
|
* MA 02111-1307 USA *
|
|
|
|
*************************************************/
|
2011-08-19 22:33:48 +04:00
|
|
|
require_once('../../../lib/base.php');
|
2011-09-15 01:29:35 +04:00
|
|
|
|
2011-08-19 22:33:48 +04:00
|
|
|
$l10n = new OC_L10N('calendar');
|
2011-09-15 01:29:35 +04:00
|
|
|
|
2011-08-11 13:22:07 +04:00
|
|
|
if(!OC_USER::isLoggedIn()) {
|
2011-09-15 01:29:35 +04:00
|
|
|
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
2011-08-11 13:22:07 +04:00
|
|
|
}
|
2011-09-15 01:29:35 +04:00
|
|
|
|
2011-09-23 00:22:52 +04:00
|
|
|
$calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
|
|
|
|
$category_options = OC_Calendar_Object::getCategoryOptions($l10n);
|
2011-09-15 23:20:42 +04:00
|
|
|
$repeat_options = OC_Calendar_Object::getRepeatOptions($l10n);
|
2011-09-15 01:29:35 +04:00
|
|
|
$startday = substr($_GET['d'], 0, 2);
|
|
|
|
$startmonth = substr($_GET['d'], 2, 2);
|
|
|
|
$startyear = substr($_GET['d'], 4, 4);
|
|
|
|
$starttime = $_GET['t'];
|
|
|
|
$allday = $starttime == 'allday';
|
|
|
|
if($starttime != 'undefined' && !is_nan($starttime) && !$allday){
|
|
|
|
$startminutes = '00';
|
|
|
|
}elseif($allday){
|
|
|
|
$starttime = '0';
|
|
|
|
$startminutes = '00';
|
|
|
|
}else{
|
|
|
|
$starttime = date('H');
|
|
|
|
$startminutes = date('i');
|
|
|
|
}
|
|
|
|
|
|
|
|
$endday = $startday;
|
|
|
|
$endmonth = $startmonth;
|
|
|
|
$endyear = $startyear;
|
|
|
|
$endtime = $starttime;
|
|
|
|
$endminutes = $startminutes;
|
|
|
|
if($endtime == 23) {
|
|
|
|
$endday++;
|
|
|
|
$endtime = 0;
|
|
|
|
} else {
|
|
|
|
$endtime++;
|
|
|
|
}
|
|
|
|
|
|
|
|
$tmpl = new OC_Template('calendar', 'part.newevent');
|
2011-09-23 00:22:52 +04:00
|
|
|
$tmpl->assign('calendar_options', $calendar_options);
|
|
|
|
$tmpl->assign('category_options', $category_options);
|
2011-09-15 01:29:35 +04:00
|
|
|
$tmpl->assign('startdate', $startday . '-' . $startmonth . '-' . $startyear);
|
|
|
|
$tmpl->assign('starttime', ($starttime <= 9 ? '0' : '') . $starttime . ':' . $startminutes);
|
|
|
|
$tmpl->assign('enddate', $endday . '-' . $endmonth . '-' . $endyear);
|
|
|
|
$tmpl->assign('endtime', ($endtime <= 9 ? '0' : '') . $endtime . ':' . $endminutes);
|
|
|
|
$tmpl->assign('allday', $allday);
|
|
|
|
$tmpl->printpage();
|
|
|
|
?>
|