<?php if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } // @todo convert to template $object_id = intval(w2PgetParam($_GET, 'event_id', 0)); $object = new CEvent(); $object->setId($object_id); $canAddEdit = $object->canAddEdit(); $canAuthor = $object->canCreate(); $canEdit = $object->canEdit(); if (!$canAddEdit) { $AppUI->redirect(ACCESS_DENIED); } global $AppUI, $cal_sdf; $AppUI->getTheme()->loadCalendarJS(); // get the passed timestamp (today if none) $date = w2PgetParam($_GET, 'date', null); // get the passed timestamp (today if none) $event_project = (int) w2PgetParam($_GET, 'project_id', 0); $obj = $AppUI->restoreObject(); if ($obj) { $object = $obj; $object_id = $object->getId(); } else { $object->load($object_id); } // load the record data if (!$object && $object_id > 0) { $AppUI->setMsg('Event');