<?php /* $Id$ $URL$ */ if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } global $AppUI, $cal_sdf; $AppUI->loadCalendarJS(); $event_id = intval(w2PgetParam($_GET, 'event_id', 0)); $is_clash = isset($_SESSION['event_is_clash']) ? $_SESSION['event_is_clash'] : false; $obj = new CEvent(); $obj->event_id = $event_id; $canAddEdit = $obj->canAddEdit(); $canAuthor = $obj->canCreate(); $canEdit = $obj->canEdit(); if (!$canAddEdit) { $AppUI->redirect(ACCESS_DENIED); } // get the passed timestamp (today if none) $date = w2PgetParam($_GET, 'date', null); // get the passed timestamp (today if none) $event_project = (int) w2PgetParam($_GET, 'event_project', 0); // load the record data if ($is_clash) { $obj->bind($_SESSION['add_event_post']); } else { if (!$obj->load($event_id) && $event_id) { $AppUI->setMsg('Event'); $AppUI->setMsg('invalidID', UI_MSG_ERROR, true); $AppUI->redirect(); }
<?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');