$end->min = $end->sec = 59;
Kronolith::addEvents($events, $event, $start, $end, true, true);
$result = new stdClass;
- $result->cal = $event->getCalendarType() . '|' . $event->getCalendar();
+ $result->cal = $event->calendarType . '|' . $event->calendar;
$result->view = Horde_Util::getFormData('view');
$result->sig = $start->dateString() . $end->dateString();
if (count($events)) {
$notification->push(_("You do not have permission to delete this event."), 'horde.warning');
break;
}
- $deleted = $kronolith_driver->deleteEvent($event->getId());
+ $deleted = $kronolith_driver->deleteEvent($event->id);
if ($deleted instanceof PEAR_Error) {
$notification->push($deleted, 'horde.error');
break;
case 'edit':
// Edit the specified attendee.
+ $actionValue = Horde_String::lower($actionValue);
if (isset($attendees[$actionValue])) {
if (empty($attendees[$actionValue]['name'])) {
$editAttendee = $actionValue;
case 'remove':
// Remove the specified attendee.
+ $actionValue = Horde_String::lower($actionValue);
if (isset($attendees[$actionValue])) {
unset($attendees[$actionValue]);
$_SESSION['kronolith']['attendees'] = $attendees;
case 'changeatt':
// Change the attendance status of an attendee
list($partval, $partname) = explode(' ', $actionValue, 2);
+ $partname = Horde_String::lower($partname);
if (isset($attendees[$partname])) {
$attendees[$partname]['attendance'] = $partval;
$_SESSION['kronolith']['attendees'] = $attendees;
case 'changeResourceAtt':
// Change attendance status of a resource
list($partval, $partname) = explode(' ', $actionValue, 2);
+ $partname = Horde_String::lower($partname);
if (isset($resources[$partname])) {
$resources[$partname]['attendance'] = $partval;
$_SESSION['kronolith']['resources'] = $resources;
case 'changeresp':
// Change the response status of an attendee
list($partval, $partname) = explode(' ', $actionValue, 2);
+ $partname = Horde_String::lower($partname);
if (isset($attendees[$partname])) {
$attendees[$partname]['response'] = $partval;
$_SESSION['kronolith']['attendees'] = $attendees;
case 'clear':
// Remove all the attendees and resources.
- $attendees = array();
- $resources = array();
- $_SESSION['kronolith']['attendees'] = $attendees;
- $_SESSION['kronolith']['resources'] = $resources;
+ $_SESSION['kronolith']['attendees'] = $_SESSION['kronolith']['resources'] = array();
break;
}
$calendars = array($calendars);
}
foreach ($calendars as $cal) {
- if ($kronolith_driver->getCalendar() != $cal) {
+ if ($kronolith_driver->calendar != $cal) {
$kronolith_driver->open($cal);
}
$events[$cal] = $kronolith_driver->listEvents($start, $end);
$calNames = array();
foreach ($events as $cal => $calevents) {
- if ($kronolith_driver->getCalendar() != $cal) {
+ if ($kronolith_driver->calendar != $cal) {
$kronolith_driver->open($cal);
}
exit;
}
if ($driver != 'Resource') {
- $share = &$kronolith_shares->getShare($event->getCalendar());
- if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE, $event->getCreatorID())) {
+ $share = &$kronolith_shares->getShare($event->calendar);
+ if (!$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE, $event->creator)) {
$notification->push(_("You do not have permission to delete this event."), 'horde.warning');
} else {
$have_perms = true;
'mday' => Horde_Util::getFormData('mday', date('j')) - 1,
'year' => Horde_Util::getFormData('year', date('Y'))));
if ($event->end->compareDate($recurEnd) > 0) {
- $result = $kronolith_driver->deleteEvent($event->getId());
+ $result = $kronolith_driver->deleteEvent($event->id);
if (is_a($result, 'PEAR_Error')) {
$notification->push($result, 'horde.error');
}
if (!$event->recurs() ||
Horde_Util::getFormData('all') ||
!$event->recurrence->hasActiveRecurrence()) {
- $result = $kronolith_driver->deleteEvent($event->getId());
+ $result = $kronolith_driver->deleteEvent($event->id);
if (is_a($result, 'PEAR_Error')) {
$notification->push($result, 'horde.error');
}
{
$res = $event->save();
$tagger = Kronolith::getTagger();
- $tagger->replaceTags($event->getUID(), Horde_Util::getFormData('tags'));
+ $tagger->replaceTags($event->uid, Horde_Util::getFormData('tags'));
if (is_a($res, 'PEAR_Error')) {
$GLOBALS['notification']->push(sprintf(_("There was an error editing the event: %s"), $res->getMessage()), 'horde.error');
} elseif (Horde_Util::getFormData('sendupdates', false)) {
/* Set recurrence end. */
$exception->mday--;
if ($event->end->compareDate($exception) > 0) {
- $result = $kronolith_driver->deleteEvent($event->getId());
+ $result = $kronolith_driver->deleteEvent($event->id);
if (is_a($result, 'PEAR_Error')) {
$notification->push($result, 'horde.error');
}
break;
}
- $event->setUID(null);
+ $event->uid = null;
_save($event);
$event = null;
} elseif (Horde_Util::getFormData('saveAsNew') ||
&& !$sourceShare->hasPermission(Horde_Auth::getAuth(), Horde_Perms::DELETE)) {
$notification->push(_("You do not have permission to move this event."), 'horde.warning');
} elseif ($user != Horde_Auth::getAuth() &&
- !$share->hasPermission(Horde_Auth::getAuth(), Kronolith::PERMS_DELEGATE, $event->getCreatorID())) {
+ !$share->hasPermission(Horde_Auth::getAuth(), Kronolith::PERMS_DELEGATE, $event->creator)) {
$notification->push(sprintf(_("You do not have permission to delegate events to %s."), Kronolith::getUserName($user)), 'horde.warning');
} elseif ($user == Horde_Auth::getAuth() &&
- !$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT, $event->getCreatorID())) {
+ !$share->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT, $event->creator)) {
$notification->push(_("You do not have permission to edit this event."), 'horde.warning');
} else {
$event->readForm();
break;
case 'EditEvent':
- if ($view->event->isPrivate() &&
- $view->event->getCreatorId() != Horde_Auth::getAuth()) {
+ if ($view->event->private &&
+ $view->event->creator != Horde_Auth::getAuth()) {
$url = $url = Horde_Util::getFormData('url');
if (!empty($url)) {
$url = new Horde_Url($url, true);
foreach ($day_events as $id => $event) {
/* Modification date. */
$modified = $history->getActionTimestamp('kronolith:' . $calendar . ':'
- . $event->getUID(), 'modify');
+ . $event->uid, 'modify');
if (!$modified) {
$modified = $history->getActionTimestamp('kronolith:' . $calendar . ':'
- . $event->getUID(), 'add');
+ . $event->uid, 'add');
}
$modified = new Horde_Date($modified);
/* Description. */
- $desc = @htmlspecialchars($event->getDescription(), ENT_COMPAT, Horde_Nls::getCharset());
+ $desc = @htmlspecialchars($event->description, ENT_COMPAT, Horde_Nls::getCharset());
if (strlen($desc)) {
$desc .= '<br /><br />';
}
}
/* Attendees. */
$attendees = array();
- foreach ($event->getAttendees() as $attendee => $status) {
+ foreach ($event->attendees as $attendee => $status) {
$attendees[] = empty($status['name']) ? $attendee : Horde_Mime_Address::trimAddress($status['name'] . (strpos($attendee, '@') === false ? '' : ' <' . $attendee . '>'));
}
if (count($attendees)) {
$desc .= '<br />' . _("Who:") . ' ' . @htmlspecialchars(implode(', ', $attendees), ENT_COMPAT, Horde_Nls::getCharset());
}
- if (strlen($event->getLocation())) {
- $desc .= '<br />' . _("Where:") . ' ' . @htmlspecialchars($event->getLocation(), ENT_COMPAT, Horde_Nls::getCharset());
+ if (strlen($event->location)) {
+ $desc .= '<br />' . _("Where:") . ' ' . @htmlspecialchars($event->location, ENT_COMPAT, Horde_Nls::getCharset());
}
- $desc .= '<br />' . _("Event Status:") . ' ' . Kronolith::statusToString($event->getStatus());
+ $desc .= '<br />' . _("Event Status:") . ' ' . Kronolith::statusToString($event->status);
$entries[$id]['title'] = @htmlspecialchars($event->getTitle(), ENT_COMPAT, Horde_Nls::getCharset());
$entries[$id]['desc'] = @htmlspecialchars($desc, ENT_COMPAT, Horde_Nls::getCharset());
$results = array();
foreach ($events as $dayevents) {
foreach ($dayevents as $event) {
- $key = 'kronolith/' . $path . '/' . $event->getId();
+ $key = 'kronolith/' . $path . '/' . $event->id;
if (in_array('name', $properties)) {
$results[$key]['name'] = $event->getTitle();
}
$results[$key]['contentlength'] = 1;
}
if (in_array('modified', $properties)) {
- $results[$key]['modified'] = $this->modified($event->getUID());
+ $results[$key]['modified'] = $this->modified($event->uid);
}
if (in_array('created', $properties)) {
- $results[$key]['created'] = $this->getActionTimestamp($event->getUID(), 'add');
+ $results[$key]['created'] = $this->getActionTimestamp($event->uid, 'add');
}
}
}
}
$result = array(
- 'data' => $this->export($event->getUID(), 'text/calendar'),
+ 'data' => $this->export($event->uid, 'text/calendar'),
'mimetype' => 'text/calendar');
- $modified = $this->modified($event->getUID());
+ $modified = $this->modified($event->uid);
if (!empty($modified)) {
$result['mtime'] = $modified;
}
if (is_a($content, 'Horde_iCalendar_vevent')) {
$event = $kronolith_driver->getEvent();
$event->fromiCalendar($content);
- $event->setCalendar($calendar);
- $uid = $event->getUID();
+ $event->calendar = $calendar;
+ $uid = $event->uid;
// Remove from uids_remove list so we won't delete in the
// end.
if (isset($uids_remove[$uid])) {
}
// Don't change creator/owner.
- $event->setCreatorId($existing_event->getCreatorId());
+ $event->creator = $existing_event->creator;
}
// Save entry.
if (is_a($saved, 'PEAR_Error')) {
return $saved;
}
- $ids[] = $event->getUID();
+ $ids[] = $event->uid;
}
}
break;
$uids = array();
foreach ($events as $dayevents) {
foreach ($dayevents as $event) {
- $uids[] = $event->getUID();
+ $uids[] = $event->uid;
}
}
if (is_a($content, 'Horde_iCalendar_vevent')) {
$event = $kronolith_driver->getEvent();
$event->fromiCalendar($content);
- $event->setCalendar($calendar);
+ $event->calendar = $calendar;
// Check if the entry already exists in the data source, first
// by UID.
- $uid = $event->getUID();
+ $uid = $event->uid;
$existing_event = $kronolith_driver->getByUID($uid, array($calendar));
if (!is_a($existing_event, 'PEAR_Error')) {
return PEAR::raiseError(_("Already Exists"),
$match->title == $event->title &&
$match->location == $event->location &&
$match->hasPermission(Horde_Perms::EDIT)) {
- return PEAR::raiseError(_("Already Exists"), 'horde.message', null, null, $match->getUID());
+ return PEAR::raiseError(_("Already Exists"), 'horde.message', null, null, $match->uid);
}
}
}
if (is_a($eventId, 'PEAR_Error')) {
return $eventId;
}
- $ids[] = $event->getUID();
+ $ids[] = $event->uid;
}
}
if (count($ids) == 0) {
return $event;
}
- return $event->getUID();
+ return $event->uid;
}
/**
case 'text/x-vcalendar':
$version = '1.0';
case 'text/calendar':
- $share = $kronolith_shares->getShare($event->getCalendar());
+ $share = $kronolith_shares->getShare($event->calendar);
$iCal = new Horde_iCalendar($version);
$iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), Horde_Nls::getCharset(), 'utf-8'));
if (empty($event)) {
$ownerCalendars = Kronolith::listCalendars(true, Horde_Perms::DELETE);
foreach ($events as $ev) {
- if (Horde_Auth::isAdmin() || isset($ownerCalendars[$ev->getCalendar()])) {
+ if (Horde_Auth::isAdmin() || isset($ownerCalendars[$ev->calendar])) {
$event = $ev;
break;
}
if (empty($event)) {
$deletableCalendars = Kronolith::listCalendars(false, Horde_Perms::DELETE);
foreach ($events as $ev) {
- if (isset($deletableCalendars[$ev->getCalendar()])) {
- $kronolith_driver->open($ev->getCalendar());
+ if (isset($deletableCalendars[$ev->calendar])) {
+ $kronolith_driver->open($ev->calendar);
$event = $ev;
break;
}
return PEAR::raiseError(_("Permission Denied"));
}
- return $kronolith_driver->deleteEvent($event->getId());
+ return $kronolith_driver->deleteEvent($event->id);
}
/**
}
if (!$event->hasPermission(Horde_Perms::EDIT) ||
- ($event->isPrivate() && $event->getCreatorId() != Horde_Auth::getAuth())) {
+ ($event->private && $event->creator != Horde_Auth::getAuth())) {
return PEAR::raiseError(_("Permission Denied"));
}
$event->fromiCalendar($component);
// Ensure we keep the original UID, even when content does not
// contain one and fromiCalendar creates a new one.
- $event->setUID($uid);
+ $event->uid = $uid;
$eventId = $event->save();
return is_a($eventId, 'PEAR_Error') ? $eventId : true;
$ownerCalendars = Kronolith::listCalendars(true, Horde_Perms::EDIT);
$event = null;
foreach ($events as $ev) {
- if (isset($ownerCalendars[$ev->getCalendar()])) {
+ if (isset($ownerCalendars[$ev->calendar])) {
$event = $ev;
break;
}
if (empty($event)) {
$editableCalendars = Kronolith::listCalendars(false, Horde_Perms::EDIT);
foreach ($events as $ev) {
- if (isset($editableCalendars[$ev->getCalendar()])) {
+ if (isset($editableCalendars[$ev->calendar])) {
$event = $ev;
break;
}
}
if (empty($event) ||
- ($event->isPrivate() && $event->getCreatorId() != Horde_Auth::getAuth())) {
+ ($event->private && $event->creator != Horde_Auth::getAuth())) {
return PEAR::raiseError(_("Permission Denied"));
}
$day_events .= $event->start->strftime($prefs->getValue('twentyFour') ? '%R' : '%I:%M%p') . '-' . $event->end->strftime($prefs->getValue('twentyFour') ? '%R' : '%I:%M%p');
}
$day_events .= ':'
- . (($event->getLocation()) ? ' (' . $event->getLocation() . ')' : '')
+ . (($event->location) ? ' (' . $event->location . ')' : '')
. ' ' . $event->getTitle() . "\n";
}
$cell = Horde::linkTooltip($url, _("View Day"), '', '', '', $day_events) . $date_ob->mday . '</a>';
$html .= '<td class="text" nowrap="nowrap" valign="top">';
if ($event->start->compareDate($now) < 0 &&
$event->end->compareDate($now) > 0) {
- $html .= '<strong>' . $event->getLocation() . '</strong>';
+ $html .= '<strong>' . $event->location . '</strong>';
} else {
- $html .= $event->getLocation();
+ $html .= $event->location;
}
if ($event->start->compareDate($now) < 0 &&
$event->end->compareDate($now) > 0) {
$html .= '<td class="text" nowrap="nowrap" valign="top">';
if ($event->start->compareDate($startDate) < 0 &&
$event->end->compareDate($startDate) > 0) {
- $html .= '<strong>' . $event->getLocation() . '</strong>';
+ $html .= '<strong>' . $event->location . '</strong>';
} else {
- $html .= $event->getLocation();
+ $html .= $event->location;
}
if ($event->start->compareDate($startDate) < 0 &&
$event->end->compareDate($startDate) > 0) {
}
$text = $event->getTitle();
- if ($location = $event->getLocation()) {
- $text .= ' (' . $location . ')';
+ if ($event->location) {
+ $text .= ' (' . $event->location . ')';
}
$html .= $time;
if ($event_active) {
}
foreach ($alarms as $calId => $calAlarms) {
foreach ($calAlarms as $event) {
- if ($horde_alarm && $horde_alarm->isSnoozed($event->getUID(), Horde_Auth::getAuth())) {
+ if ($horde_alarm && $horde_alarm->isSnoozed($event->uid, Horde_Auth::getAuth())) {
continue;
}
$alarmCount++;
- $tree->addNode($parent . $calId . $event->getId(),
+ $tree->addNode($parent . $calId . $event->id,
$parent,
$event->getTitle(),
$indent + 1,
*
* @var string
*/
- protected $_calendar;
+ public $calendar;
/**
* An error message to throw when something is wrong.
public function open($calendar)
{
- $this->_calendar = $calendar;
- }
-
- /**
- * Returns the currently open calendar.
- *
- * @return string The current calendar name.
- */
- public function getCalendar()
- {
- return $this->_calendar;
+ $this->calendar = $calendar;
}
/**
(empty($query->title) ||
stristr($event->getTitle(), $query->title)) &&
(empty($query->location) ||
- stristr($event->getLocation(), $query->location)) &&
+ stristr($event->location, $query->location)) &&
(empty($query->description) ||
- stristr($event->getDescription(), $query->description)) &&
- (empty($query->creatorID) ||
- stristr($event->getCreatorID(), $query->creatorID)) &&
+ stristr($event->description, $query->description)) &&
+ (empty($query->creator) ||
+ stristr($event->creator, $query->creator)) &&
(!isset($query->status) ||
- $event->getStatus() == $query->status)) {
+ $event->status == $query->status)) {
Kronolith::addEvents($results, $event, $event->start, $event->end, false, $json, false);
}
}
$results = array();
for ($year = $startDate->year; $year <= $endDate->year; $year++) {
- $dh = Date_Holidays::factory($this->_calendar, $year, $this->_params['language']);
+ $dh = Date_Holidays::factory($this->calendar, $year, $this->_params['language']);
if (Date_Holidays::isError($dh)) {
Horde::logMessage(sprintf('Factory was unable to produce driver object for driver %s in year %s with locale %s',
- $this->_calendar, $year, $this->_params['language']),
+ $this->calendar, $year, $this->_params['language']),
__FILE__, __LINE__, PEAR_LOG_ERR);
continue;
}
list($id, $date) = explode('-', $eventId, 2);
$year = substr($date, 0, 4);
- $dh = Date_Holidays::factory($this->_calendar, $year, $this->_params['language']);
+ $dh = Date_Holidays::factory($this->calendar, $year, $this->_params['language']);
if (Date_Holidays::isError($dh)) {
Horde::logMessage(sprintf('Factory was unable to produce driver object for driver %s in year %s with locale %s',
- $this->_calendar, $year, $this->_params['language']),
+ $this->calendar, $year, $this->_params['language']),
__FILE__, __LINE__, PEAR_LOG_ERR);
return false;
}
public function open($calendar)
{
parent::open($calendar);
- list($this->api,) = explode('/', $this->_calendar, 2);
+ list($this->api,) = explode('/', $this->calendar, 2);
}
public function listAlarms($date, $fullevent = false)
$showRecurrence = false, $hasAlarm = false,
$json = false)
{
- list($this->api, $category) = explode('/', $this->_calendar, 2);
+ list($this->api, $category) = explode('/', $this->calendar, 2);
if (!$this->_params['registry']->hasMethod($this->api . '/listTimeObjects')) {
return array();
}
$event = new Kronolith_Event_Ical($this);
$event->status = Kronolith::STATUS_FREE;
$event->fromiCalendar($component);
- $event->setCalendar($this->_calendar);
+ $event->calendar = $this->calendar;
// Force string so JSON encoding is consistent across drivers.
- $event->eventID = 'ical' . $i;
+ $event->id = 'ical' . $i;
/* Catch RECURRENCE-ID attributes which mark single recurrence
* instances. */
$results = array();
foreach ($events as $key => $event) {
if ($event->recurs() &&
- isset($exceptions[$event->getUID()][$event->getSequence()])) {
- $timestamp = $exceptions[$event->getUID()][$event->getSequence()];
+ isset($exceptions[$event->uid][$event->sequence])) {
+ $timestamp = $exceptions[$event->uid][$event->sequence];
$events[$key]->recurrence->addException(date('Y', $timestamp), date('m', $timestamp), date('d', $timestamp));
}
Kronolith::addEvents($results, $event, $startDate, $endDate,
$event = new Kronolith_Event_Ical($this);
$event->status = Kronolith::STATUS_FREE;
$event->fromiCalendar($components[$eventId]);
- $event->setCalendar($this->_calendar);
- $event->eventID = 'ical' . $eventId;
+ $event->calendar = $this->calendar;
+ $event->id = 'ical' . $eventId;
return $event;
}
*/
public function getRemoteCalendar($cache = true)
{
- $url = trim($this->_calendar);
+ $url = trim($this->calendar);
/* Treat webcal:// URLs as http://. */
if (substr($url, 0, 9) == 'webcal://') {
*/
public function open($calendar)
{
- if ($this->_calendar != $calendar) {
- $this->_calendar = $calendar;
+ if ($this->calendar != $calendar) {
+ $this->calendar = $calendar;
$this->reset();
}
}
// Connect to the Kolab backend
- $result = $this->_kolab->open($this->_calendar, 1);
+ $result = $this->_kolab->open($this->calendar, 1);
if (is_a($result, 'PEAR_Error')) {
return $result;
}
if (!$event->recurs()) {
$start = new Horde_Date($event->start);
- $start->min -= $event->getAlarm();
+ $start->min -= $event->alarm;
if ($start->compareDateTime($date) <= 0 &&
$date->compareDateTime($event->end) <= -1) {
$events[] = $fullevent ? $event : $eventId;
continue;
}
$start = new Horde_Date($next);
- $start->min -= $event->getAlarm();
+ $start->min -= $event->alarm;
$end = new Horde_Date(array('year' => $next->year,
'month' => $next->month,
'mday' => $next->mday,
public function exists($uid, $calendar_id = null)
{
// Log error if someone uses this function in an unsupported way
- if ($calendar_id != $this->_calendar) {
- Horde::logMessage(sprintf("Kolab::exists called for calendar %s. Currently active is %s.", $calendar_id, $this->_calendar), __FILE__, __LINE__, PEAR_LOG_ERR);
- return PEAR::raiseError(sprintf("Kolab::exists called for calendar %s. Currently active is %s.", $calendar_id, $this->_calendar));
+ if ($calendar_id != $this->calendar) {
+ Horde::logMessage(sprintf("Kolab::exists called for calendar %s. Currently active is %s.", $calendar_id, $this->calendar), __FILE__, __LINE__, PEAR_LOG_ERR);
+ return PEAR::raiseError(sprintf("Kolab::exists called for calendar %s. Currently active is %s.", $calendar_id, $this->calendar));
}
$result = $this->synchronize();
$events = array();
foreach($this->_events_cache as $event) {
- if ($hasAlarm && !$event->getAlarm()) {
+ if ($hasAlarm && !$event->alarm) {
continue;
}
return $result;
}
- $uid = $event->getUID();
+ $uid = $event->uid;
if ($uid == null) {
- $event->setUID($this->_store->generateUID());
+ $event->uid = $this->_store->generateUID();
}
$attributes = $event->toDriver();
$edit = false;
$stored_uid = null;
- if ($event->isStored() || $event->exists()) {
+ if ($event->stored || $event->exists()) {
$stored_uid = $attributes['uid'];
$action = array('action' => 'modify');
$edit = true;
/* Deal with tags */
$tagger = Kronolith::getTagger();
if (!empty($edit)) {
- $tagger->replaceTags($event->getUID(), $event->tags, 'event');
+ $tagger->replaceTags($event->uid, $event->tags, 'event');
} else {
- $tagger->tag($event->getUID(), $event->tags, 'event');
+ $tagger->tag($event->uid, $event->tags, 'event');
}
/* Notify about the changed event. */
/* Log the creation/modification of this item in the history log. */
$history = Horde_History::singleton();
- $history->log('kronolith:' . $event->getCalendar() . ':' . $event->getUID(), $action, true);
+ $history->log('kronolith:' . $event->calendar . ':' . $event->uid, $action, true);
// refresh IMAP cache
$this->synchronize(true);
if (is_callable('Kolab', 'triggerFreeBusyUpdate')) {
- Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($event->getCalendar()));
+ Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($event->calendar));
}
- return $event->getUID();
+ return $event->uid;
}
/**
}
if (is_callable('Kolab', 'triggerFreeBusyUpdate')) {
- Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($this->_calendar));
+ Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($this->calendar));
Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($newCalendar));
}
/* Log the moving of this item in the history log. */
- $uid = $event->getUID();
+ $uid = $event->uid;
$history = Horde_History::singleton();
- $history->log('kronolith:' . $event->getCalendar() . ':' . $uid, array('action' => 'delete'), true);
+ $history->log('kronolith:' . $event->calendar . ':' . $uid, array('action' => 'delete'), true);
$history->log('kronolith:' . $newCalendar . ':' . $uid, array('action' => 'add'), true);
return $result;
/* Log the deletion of this item in the history log. */
$history = Horde_History::singleton();
- $history->log('kronolith:' . $event->getCalendar() . ':' . $event->getUID(), array('action' => 'delete'), true);
+ $history->log('kronolith:' . $event->calendar . ':' . $event->uid, array('action' => 'delete'), true);
if (is_callable('Kolab', 'triggerFreeBusyUpdate')) {
- Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($event->getCalendar()));
+ Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($event->calendar));
}
unset($this->_events_cache[$eventId]);
* it is attached to. Not sure if there is a better way to do this...
*/
$delete_event = $this->getEvent($event);
- $uid = $delete_event->getUID();
+ $uid = $delete_event->uid;
$driver = Kronolith::getDriver();
$events = $driver->getByUID($uid, null, true);
foreach ($events as $e) {
$resources = $e->getResources();
if (count($resources)) {
// found the right entry
- $r = $this->getResource($this->getResourceIdByCalendar($delete_event->getCalendar()));
+ $r = $this->getResource($this->getResourceIdByCalendar($delete_event->calendar));
$e->removeResource($r);
$e->save();
}
foreach ($dayevents as $event) {
if (!$event->recurs()) {
$start = new Horde_Date($event->start);
- $start->min -= $event->getAlarm();
+ $start->min -= $event->alarm;
if ($start->compareDateTime($date) <= 0 &&
$date->compareDateTime($event->end) <= -1) {
- $events[] = $fullevent ? $event : $event->getId();
+ $events[] = $fullevent ? $event : $event->id;
}
} else {
if ($next = $event->recurrence->nextRecurrence($date)) {
continue;
}
$start = new Horde_Date($next);
- $start->min -= $event->getAlarm();
+ $start->min -= $event->alarm;
$diff = Date_Calc::dateDiff($event->start->mday,
$event->start->month,
$event->start->year,
$event->end = $end;
$events[] = $event;
} else {
- $events[] = $event->getId();
+ $events[] = $event->id;
}
}
}
$cond .= $binds;
}
}
- if (!empty($query->creatorID)) {
- $binds = Horde_SQL::buildClause($this->_db, 'event_creator_id', '=', $query->creatorID, true);
+ if (!empty($query->creator)) {
+ $binds = Horde_SQL::buildClause($this->_db, 'event_creator_id', '=', $query->creator, true);
if (is_array($binds)) {
$cond .= $binds[0] . ' AND ';
$values = array_merge($values, $binds[1]);
' event_exceptions, event_creator_id, event_resources' .
' FROM ' . $this->_params['table'] .
' WHERE calendar_id = ?';
- $values = array($this->_calendar);
+ $values = array($this->calendar);
if ($conditions) {
$q .= ' AND ' . $conditions;
/* We have all the information we need to create an event object
* for this event, so go ahead and cache it. */
- $this->_cache[$this->_calendar][$row['event_id']] = new $this->_eventClass($this, $row);
+ $this->_cache[$this->calendar][$row['event_id']] = new $this->_eventClass($this, $row);
if ($row['event_recurtype'] == Horde_Date_Recurrence::RECUR_NONE) {
$events[$row['event_uid']] = $row['event_id'];
} else {
$this->_params['table']);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::_countEvents(): user = "%s"; query = "%s"; values = "%s"',
- Horde_Auth::getAuth(), $query, $this->_calendar),
+ Horde_Auth::getAuth(), $query, $this->calendar),
__FILE__, __LINE__, PEAR_LOG_DEBUG);
/* Run the query. */
- return $this->_db->getOne($query, array($this->_calendar));
+ return $this->_db->getOne($query, array($this->calendar));
}
public function getEvent($eventId = null)
return new $this->_eventClass($this);
}
- if (isset($this->_cache[$this->_calendar][$eventId])) {
- return $this->_cache[$this->_calendar][$eventId];
+ if (isset($this->_cache[$this->calendar][$eventId])) {
+ return $this->_cache[$this->calendar][$eventId];
}
$query = 'SELECT event_id, event_uid, event_description,' .
' event_alarm, event_alarm_methods, event_modified,' .
' event_exceptions, event_creator_id, event_resources' .
' FROM ' . $this->_params['table'] . ' WHERE event_id = ? AND calendar_id = ?';
- $values = array($eventId, $this->_calendar);
+ $values = array($eventId, $this->calendar);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::getEvent(): user = "%s"; query = "%s"; values = "%s"',
}
if ($event) {
- $this->_cache[$this->_calendar][$eventId] = new $this->_eventClass($this, $event);
- return $this->_cache[$this->_calendar][$eventId];
+ $this->_cache[$this->calendar][$eventId] = new $this->_eventClass($this, $event);
+ return $this->_cache[$this->calendar][$eventId];
} else {
return PEAR::raiseError(_("Event not found"));
}
$eventArray = array();
foreach ($events as $event) {
$this->open($event['calendar_id']);
- $this->_cache[$this->_calendar][$event['event_id']] = new $this->_eventClass($this, $event);
- $eventArray[] = $this->_cache[$this->_calendar][$event['event_id']];
+ $this->_cache[$this->calendar][$event['event_id']] = new $this->_eventClass($this, $event);
+ $eventArray[] = $this->_cache[$this->calendar][$event['event_id']];
}
if ($getAll) {
$ownerCalendars = Kronolith::listCalendars(true, Horde_Perms::READ);
$event = null;
foreach ($eventArray as $ev) {
- if (isset($ownerCalendars[$ev->getCalendar()])) {
+ if (isset($ownerCalendars[$ev->calendar])) {
$event = $ev;
break;
}
if (empty($event)) {
$readableCalendars = Kronolith::listCalendars(false, Horde_Perms::READ);
foreach ($eventArray as $ev) {
- if (isset($readableCalendars[$ev->getCalendar()])) {
+ if (isset($readableCalendars[$ev->calendar])) {
$event = $ev;
break;
}
*/
public function saveEvent($event)
{
- if ($event->isStored() || $event->exists()) {
+ if ($event->stored || $event->exists()) {
$values = array();
$query = 'UPDATE ' . $this->_params['table'] . ' SET ';
}
$query = substr($query, 0, -1);
$query .= ' WHERE event_id = ?';
- $values[] = $event->getId();
+ $values[] = $event->id;
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::saveEvent(): user = "%s"; query = "%s"; values = "%s"',
}
/* Log the modification of this item in the history log. */
- if ($event->getUID()) {
+ if ($event->uid) {
$history = Horde_History::singleton();
- $history->log('kronolith:' . $this->_calendar . ':' . $event->getUID(), array('action' => 'modify'), true);
+ $history->log('kronolith:' . $this->calendar . ':' . $event->uid, array('action' => 'modify'), true);
}
/* Update tags */
$tagger = Kronolith::getTagger();
- $tagger->replaceTags($event->getUID(), $event->tags, 'event');
+ $tagger->replaceTags($event->uid, $event->tags, 'event');
/* Update Geolocation */
if ($gDriver = Kronolith::getGeoDriver()) {
try {
- $gDriver->setLocation($event->getId(), $event->geoLocation);
+ $gDriver->setLocation($event->id, $event->geoLocation);
} catch (Horde_Exception $e) {
Horde::logMessage($e->getMessage(), __FILE__, __LINE__, PEAR_LOG_ERR);
return new PEAR_Error($e->getMessage());
Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
}
- return $event->getId();
+ return $event->id;
} else {
- if ($event->getId()) {
- $id = $event->getId();
+ if ($event->id) {
+ $id = $event->id;
} else {
$id = hash('md5', uniqid(mt_rand(), true));
- $event->setId($id);
+ $event->id = $id;
}
- if ($event->getUID()) {
- $uid = $event->getUID();
+ if ($event->uid) {
+ $uid = $event->uid;
} else {
$uid = (string)new Horde_Support_Guid;
- $event->setUID($uid);
+ $event->uid = $uid;
}
$query = 'INSERT INTO ' . $this->_params['table'];
$cols_name .= ' calendar_id)';
$cols_values .= ' ?)';
- $values[] = $this->_calendar;
+ $values[] = $this->calendar;
$query .= $cols_name . $cols_values;
/* Log the creation of this item in the history log. */
$history = Horde_History::singleton();
- $history->log('kronolith:' . $this->_calendar . ':' . $uid, array('action' => 'add'), true);
+ $history->log('kronolith:' . $this->calendar . ':' . $uid, array('action' => 'add'), true);
/* Deal with any tags */
$tagger = Kronolith::getTagger();
- $tagger->tag($event->getUID(), $event->tags, 'event');
+ $tagger->tag($event->uid, $event->tags, 'event');
/* Notify users about the new event. */
$result = Kronolith::sendNotification($event, 'add');
}
$query = 'UPDATE ' . $this->_params['table'] . ' SET calendar_id = ? WHERE calendar_id = ? AND event_id = ?';
- $values = array($newCalendar, $this->_calendar, $eventId);
+ $values = array($newCalendar, $this->calendar, $eventId);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::move(): %s; values = "%s"',
}
/* Log the moving of this item in the history log. */
- $uid = $event->getUID();
+ $uid = $event->uid;
if ($uid) {
$history = Horde_History::singleton();
- $history->log('kronolith:' . $this->_calendar . ':' . $uid, array('action' => 'delete'), true);
+ $history->log('kronolith:' . $this->calendar . ':' . $uid, array('action' => 'delete'), true);
$history->log('kronolith:' . $newCalendar . ':' . $uid, array('action' => 'add'), true);
}
}
$query = 'DELETE FROM ' . $this->_params['table'] . ' WHERE event_id = ? AND calendar_id = ?';
- $values = array($eventId, $this->_calendar);
+ $values = array($eventId, $this->calendar);
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Kronolith_Driver_Sql::deleteEvent(): user = "%s"; query = "%s"; values = "%s"',
}
/* Log the deletion of this item in the history log. */
- if ($event->getUID()) {
+ if ($event->uid) {
$history = Horde_History::singleton();
- $history->log('kronolith:' . $this->_calendar . ':' . $event->getUID(), array('action' => 'delete'), true);
+ $history->log('kronolith:' . $this->calendar . ':' . $event->uid, array('action' => 'delete'), true);
}
/* Remove the event from any resources that are attached to it */
/* Remove any pending alarms. */
if (@include_once 'Horde/Alarm.php') {
$alarm = Horde_Alarm::factory();
- $alarm->delete($event->getUID());
+ $alarm->delete($event->uid);
}
/* Remove any tags */
$tagger = Kronolith::getTagger();
- $tagger->replaceTags($event->getUID(), array(), 'event');
+ $tagger->replaceTags($event->uid, array(), 'event');
/* Notify about the deleted event. */
if (!$silent) {
return $event;
}
- $this->deleteEvent($event->getId());
+ $this->deleteEvent($event->id);
}
}
*
* @var string
*/
- public $eventID = null;
+ protected $_id = null;
/**
* The UID for this event.
*
* @var string
*/
- protected $_uid = null;
+ public $uid = null;
/**
* The iCalendar SEQUENCE for this event.
*
* @var integer
*/
- protected $_sequence = null;
+ public $sequence = null;
/**
* The user id of the creator of the event.
*
* @var string
*/
- public $creatorID = null;
+ protected $_creator = null;
/**
* The title of this event.
*
+ * For displaying in the interface use getTitle() instead.
+ *
* @var string
*/
public $title = '';
*
* @var string
*/
- protected $_calendar;
+ public $calendar;
/**
* The type of the calender this event exists on.
*
* @var string
*/
- protected $_calendarType;
+ public $calendarType;
/**
* The HTML background color to be used for this event.
*/
public function __construct($driver, $eventObject = null)
{
- $this->_calendar = $driver->getCalendar();
+ $this->calendar = $driver->calendar;
// FIXME: Move color definitions anywhere else.
- if (!empty($this->_calendar) &&
- isset($GLOBALS['all_calendars'][$this->_calendar])) {
- $share = $GLOBALS['all_calendars'][$this->_calendar];
+ if (!empty($this->calendar) &&
+ isset($GLOBALS['all_calendars'][$this->calendar])) {
+ $share = $GLOBALS['all_calendars'][$this->calendar];
$backgroundColor = $share->get('color');
if (!empty($backgroundColor)) {
$this->_backgroundColor = $backgroundColor;
/* Get tags */
$this->fromDriver($eventObject);
$tagger = Kronolith::getTagger();
- $this->tags = $tagger->getTags($this->getUID(), 'event');
+ $this->tags = $tagger->getTags($this->uid, 'event');
/* Get geolocation data */
if ($gDriver = Kronolith::getGeoDriver()) {
- $this->geoLocation = $gDriver->getLocation($this->getId());
+ $this->geoLocation = $gDriver->getLocation($this->id);
+ }
+ }
+ }
+
+ /**
+ * Setter.
+ *
+ * Sets the 'id' and 'creator' properties.
+ *
+ * @param string $name Property name.
+ * @param mixed $value Property value.
+ */
+ public function __set($name, $value)
+ {
+ switch ($name) {
+ case 'id':
+ if (substr($value, 0, 10) == 'kronolith:') {
+ $value = substr($value, 10);
+ }
+ // Fall through.
+ case 'creator':
+ $this->{'_' . $name} = $value;
+ return;
+ }
+ $trace = debug_backtrace();
+ trigger_error('Undefined property via __set(): ' . $name
+ . ' in ' . $trace[0]['file']
+ . ' on line ' . $trace[0]['line'],
+ E_USER_NOTICE);
+ }
+
+ /**
+ * Getter.
+ *
+ * Returns the 'id' and 'creator' properties.
+ *
+ * @param string $name Property name.
+ *
+ * @return mixed Property value.
+ */
+ public function __get($name)
+ {
+ switch ($name) {
+ case 'creator':
+ if (empty($this->_creator)) {
+ $this->_creator = Horde_Auth::getAuth();
}
+ // Fall through.
+ case 'id':
+ return $this->{'_' . $name};
}
+ $trace = debug_backtrace();
+ trigger_error('Undefined property via __set(): ' . $name
+ . ' in ' . $trace[0]['file']
+ . ' on line ' . $trace[0]['line'],
+ E_USER_NOTICE);
+ return null;
}
/**
*/
public function getDriver()
{
- return Kronolith::getDriver(null, $this->_calendar);
+ return Kronolith::getDriver(null, $this->calendar);
}
/**
*/
public function getShare()
{
- if (isset($GLOBALS['all_calendars'][$this->getCalendar()])) {
- $share = $GLOBALS['all_calendars'][$this->getCalendar()];
+ if (isset($GLOBALS['all_calendars'][$this->calendar])) {
+ $share = $GLOBALS['all_calendars'][$this->calendar];
} else {
$share = PEAR::raiseError('Share not found');
}
}
return (!is_a($share = &$this->getShare(), 'PEAR_Error') &&
- $share->hasPermission($user, $permission, $this->getCreatorId()));
+ $share->hasPermission($user, $permission, $this->creator));
}
/**
*/
public function save()
{
- if (!$this->isInitialized()) {
+ if (!$this->initialized) {
return PEAR::raiseError('Event not yet initialized');
}
* someone is silly enough to add a resource to it's own event.*/
$resource = Kronolith::getDriver('Resource')->getResource($id);
$rcal = $resource->get('calendar');
- if ($rcal == $this->getCalendar()) {
+ if ($rcal == $this->calendar) {
continue;
}
}
$vEvent->setAttribute('DTSTAMP', $_SERVER['REQUEST_TIME']);
- $vEvent->setAttribute('UID', $this->_uid);
+ $vEvent->setAttribute('UID', $this->uid);
/* Get the event's history. */
$history = &Horde_History::singleton();
$created = $modified = null;
- $log = $history->getHistory('kronolith:' . $this->_calendar . ':' . $this->_uid);
+ $log = $history->getHistory('kronolith:' . $this->calendar . ':' . $this->uid);
if ($log && !is_a($log, 'PEAR_Error')) {
foreach ($log->getData() as $entry) {
switch ($entry['action']) {
}
$vEvent->setAttribute('SUMMARY', $v1 ? $this->getTitle() : Horde_String::convertCharset($this->getTitle(), Horde_Nls::getCharset(), 'utf-8'));
- $name = Kronolith::getUserName($this->getCreatorId());
+ $name = Kronolith::getUserName($this->creator);
if (!$v1) {
$name = Horde_String::convertCharset($name, Horde_Nls::getCharset(), 'utf-8');
}
$vEvent->setAttribute('ORGANIZER',
- 'mailto:' . Kronolith::getUserEmail($this->getCreatorId()),
+ 'mailto:' . Kronolith::getUserEmail($this->creator),
array('CN' => $name));
- if (!$this->isPrivate() || $this->getCreatorId() == Horde_Auth::getAuth()) {
+ if (!$this->private || $this->creator == Horde_Auth::getAuth()) {
if (!empty($this->description)) {
$vEvent->setAttribute('DESCRIPTION', $v1 ? $this->description : Horde_String::convertCharset($this->description, Horde_Nls::getCharset(), 'utf-8'));
}
$vEvent->setAttribute('URL', $this->url);
}
}
- $vEvent->setAttribute('CLASS', $this->isPrivate() ? 'PRIVATE' : 'PUBLIC');
+ $vEvent->setAttribute('CLASS', $this->private ? 'PRIVATE' : 'PUBLIC');
// Status.
- switch ($this->getStatus()) {
+ switch ($this->status) {
case Kronolith::STATUS_FREE:
// This is not an official iCalendar value, but we need it for
// synchronization.
}
// Attendees.
- foreach ($this->getAttendees() as $email => $status) {
+ foreach ($this->attendees as $email => $status) {
$params = array();
switch ($status['attendance']) {
case Kronolith::PART_REQUIRED:
// Unique ID.
$uid = $vEvent->getAttribute('UID');
if (!empty($uid) && !is_a($uid, 'PEAR_Error')) {
- $this->setUID($uid);
+ $this->uid = $uid;
}
// Sequence.
$seq = $vEvent->getAttribute('SEQUENCE');
if (is_int($seq)) {
- $this->_sequence = $seq;
+ $this->sequence = $seq;
}
// Title, tags and description.
$title = $vEvent->getAttribute('SUMMARY');
if (!is_array($title) && !is_a($title, 'PEAR_Error')) {
- $this->setTitle($title);
+ $this->title = $title;
}
// Tags
// Description
$desc = $vEvent->getAttribute('DESCRIPTION');
if (!is_array($desc) && !is_a($desc, 'PEAR_Error')) {
- $this->setDescription($desc);
+ $this->description = $desc;
}
// Remote Url
// Location
$location = $vEvent->getAttribute('LOCATION');
if (!is_array($location) && !is_a($location, 'PEAR_Error')) {
- $this->setLocation($location);
+ $this->location = $location;
}
// Class
$class = $vEvent->getAttribute('CLASS');
if (!is_array($class) && !is_a($class, 'PEAR_Error')) {
$class = Horde_String::upper($class);
- if ($class == 'PRIVATE' || $class == 'CONFIDENTIAL') {
- $this->setPrivate(true);
- } else {
- $this->setPrivate(false);
- }
+ $this->private = $class == 'PRIVATE' || $class == 'CONFIDENTIAL';
}
// Status.
$status = 'CANCELLED';
}
if (defined('Kronolith::STATUS_' . $status)) {
- $this->setStatus(constant('Kronolith::STATUS_' . $status));
+ $this->status = constant('Kronolith::STATUS_' . $status);
}
}
public function fromHash($hash)
{
// See if it's a new event.
- if ($this->getId() === null) {
- $this->setCreatorId(Horde_Auth::getAuth());
+ if ($this->id === null) {
+ $this->creator = Horde_Auth::getAuth();
}
if (!empty($hash['title'])) {
- $this->setTitle($hash['title']);
+ $this->title = $hash['title'];
} else {
return PEAR::raiseError(_("Events must have a title."));
}
if (!empty($hash['description'])) {
- $this->setDescription($hash['description']);
+ $this->description = $hash['description'];
}
if (!empty($hash['location'])) {
- $this->setLocation($hash['location']);
+ $this->location = $hash['location'];
}
if (!empty($hash['start_date'])) {
$date = explode('-', $hash['start_date']);
}
}
if (!empty($hash['alarm'])) {
- $this->setAlarm($hash['alarm']);
+ $this->alarm = (int)$hash['alarm'];
} elseif (!empty($hash['alarm_date']) &&
!empty($hash['alarm_time'])) {
$date = explode('-', $hash['alarm_date']);
'month' => $date[1],
'mday' => $date[2],
'year' => $date[0]));
- $this->setAlarm(($this->start->timestamp() - $alarm->timestamp()) / 60);
+ $this->alarm = ($this->start->timestamp() - $alarm->timestamp()) / 60;
}
}
if (!empty($hash['recur_type'])) {
*/
public function toAlarm($time, $user = null, $prefs = null)
{
- if (!$this->getAlarm()) {
+ if (!$this->alarm) {
return;
}
$methods = !empty($this->methods) ? $this->methods : @unserialize($prefs->getValue('event_alarms'));
$start = clone $this->start;
- $start->min -= $this->getAlarm();
+ $start->min -= $this->alarm;
if (isset($methods['notify'])) {
$methods['notify']['show'] = array(
'__app' => $GLOBALS['registry']->getApp(),
- 'event' => $this->getId(),
- 'calendar' => $this->getCalendar());
+ 'event' => $this->id,
+ 'calendar' => $this->calendar);
if (!empty($methods['notify']['sound'])) {
if ($methods['notify']['sound'] == 'on') {
// Handle boolean sound preferences.
}
if (isset($methods['popup'])) {
$methods['popup']['message'] = $this->getTitle($user);
- $description = $this->getDescription();
+ $description = $this->description;
if (!empty($description)) {
$methods['popup']['message'] .= "\n\n" . $description;
}
$this->location,
$this->start->strftime($prefs->getValue('date_format')),
$this->start->format($prefs->getValue('twentyFour') ? 'H:i' : 'h:ia'),
- $this->getDescription());
+ $this->description);
}
return array(
- 'id' => $this->getUID(),
+ 'id' => $this->uid,
'user' => $user,
'start' => $start->timestamp(),
'end' => $this->end->timestamp(),
'methods' => array_keys($methods),
'params' => $methods,
'title' => $this->getTitle($user),
- 'text' => $this->getDescription());
+ 'text' => $this->description);
}
/**
{
$json = new stdClass;
$json->t = $this->getTitle();
- $json->c = $this->getCalendar();
+ $json->c = $this->calendar;
$json->s = $this->start->toJson();
$json->e = $this->end->toJson();
$json->fi = $this->first;
}
if ($full) {
- $json->id = $this->getId();
- $json->ty = $this->_calendarType;
- $json->d = $this->getDescription();
- $json->l = $this->getLocation();
+ $json->id = $this->id;
+ $json->ty = $this->calendarType;
+ $json->d = $this->description;
+ $json->l = $this->location;
$json->u = $this->url;
$json->sd = $this->start->strftime('%x');
$json->st = $this->start->format($time_format);
}
/**
- * TODO
- */
- public function isInitialized()
- {
- return $this->initialized;
- }
-
- /**
- * TODO
- */
- public function isStored()
- {
- return $this->stored;
- }
-
- /**
* Checks if the current event is already present in the calendar.
*
* Does the check based on the uid.
*/
public function exists()
{
- if (!isset($this->_uid) || !isset($this->_calendar)) {
+ if (!isset($this->uid) || !isset($this->calendar)) {
return false;
}
- $eventID = $this->getDriver()->exists($this->_uid, $this->_calendar);
+ $eventID = $this->getDriver()->exists($this->uid, $this->calendar);
if (is_a($eventID, 'PEAR_Error') || !$eventID) {
return false;
} else {
- $this->eventID = $eventID;
+ $this->id = $eventID;
return true;
}
}
$formatted = $horde_date->strftime($GLOBALS['prefs']->getValue('date_format'));
return $formatted
. Horde::applicationUrl('edit.php')
- ->add(array('calendar' => $this->getCalendar(),
- 'eventID' => $this->eventID,
+ ->add(array('calendar' => $this->calendar,
+ 'eventID' => $this->id,
'del_exception' => $date,
'url' => Horde_Util::getFormData('url')))
->link(array('title' => sprintf(_("Delete exception on %s"), $formatted)))
return implode(', ', array_map(array($this, 'exceptionLink'), $this->recurrence->getExceptions()));
}
- public function getCalendar()
- {
- return $this->_calendar;
- }
-
- public function setCalendar($calendar)
- {
- $this->_calendar = $calendar;
- }
-
- public function getCalendarType()
- {
- return $this->_calendarType;
- }
-
- /**
- * Returns the locally unique identifier for this event.
- *
- * @return string The local identifier for this event.
- */
- public function getId()
- {
- return $this->eventID;
- }
-
- /**
- * Sets the locally unique identifier for this event.
- *
- * @param string $eventId The local identifier for this event.
- */
- public function setId($eventId)
- {
- if (substr($eventId, 0, 10) == 'kronolith:') {
- $eventId = substr($eventId, 10);
- }
- $this->eventID = $eventId;
- }
-
- /**
- * Returns the global UID for this event.
- *
- * @return string The global UID for this event.
- */
- public function getUID()
- {
- return $this->_uid;
- }
-
- /**
- * Sets the global UID for this event.
- *
- * @param string $uid The global UID for this event.
- */
- public function setUID($uid)
- {
- $this->_uid = $uid;
- }
-
- /**
- * Returns the iCalendar SEQUENCE for this event.
- *
- * @return integer The sequence for this event.
- */
- public function getSequence()
- {
- return $this->_sequence;
- }
-
- /**
- * Returns the id of the user who created the event.
- *
- * @return string The creator id
- */
- public function getCreatorId()
- {
- return !empty($this->creatorID) ? $this->creatorID : Horde_Auth::getAuth();
- }
-
- /**
- * Sets the id of the creator of the event.
- *
- * @param string $creatorID The user id for the user who created the event
- */
- public function setCreatorId($creatorID)
- {
- $this->creatorID = $creatorID;
- }
-
/**
* Returns the title of this event.
*
*/
public function getTitle($user = null)
{
- if (!$this->isInitialized()) {
+ if (!$this->initialized) {
return '';
}
$end = $this->end->format($twentyFour ? 'G:i' : 'g:ia');
// We explicitly allow admin access here for the alarms notifications.
- if (!Horde_Auth::isAdmin() && $this->isPrivate() &&
- $this->getCreatorId() != $user) {
+ if (!Horde_Auth::isAdmin() && $this->private &&
+ $this->creator != $user) {
return _("busy");
} elseif (Horde_Auth::isAdmin() || $this->hasPermission(Horde_Perms::READ, $user)) {
return strlen($this->title) ? $this->title : _("[Unnamed event]");
}
/**
- * Sets the title of this event.
- *
- * @param string The new title for this event.
- */
- public function setTitle($title)
- {
- $this->title = $title;
- }
-
- /**
- * Returns the description of this event.
- *
- * @return string The description of this event.
- */
- public function getDescription()
- {
- return $this->description;
- }
-
- /**
- * Sets the description of this event.
- *
- * @param string $description The new description for this event.
- */
- public function setDescription($description)
- {
- $this->description = $description;
- }
-
- /**
- * Returns the location this event occurs at.
- *
- * @return string The location of this event.
- */
- public function getLocation()
- {
- return $this->location;
- }
-
- /**
- * Sets the location this event occurs at.
- *
- * @param string $location The new location for this event.
- */
- public function setLocation($location)
- {
- $this->location = $location;
- }
-
- /**
- * Returns whether this event is private.
- *
- * @return boolean Whether this even is private.
- */
- public function isPrivate()
- {
- return $this->private;
- }
-
- /**
- * Sets the private flag of this event.
- *
- * @param boolean $private Whether this event should be marked private.
- */
- public function setPrivate($private)
- {
- $this->private = !empty($private);
- }
-
- /**
- * Returns the event status.
- *
- * @return integer The status of this event.
- */
- public function getStatus()
- {
- return $this->status;
- }
-
- /**
- * Checks whether the events status is the same as the specified value.
- *
- * @param integer $status The status value to check against.
- *
- * @return boolean True if the events status is the same as $status.
- */
- public function hasStatus($status)
- {
- return ($status == $this->status);
- }
-
- /**
- * Sets the status of this event.
- *
- * @param integer $status The new event status.
- */
- public function setStatus($status)
- {
- $this->status = $status;
- }
-
- /**
- * Returns the entire attendees array.
- *
- * @return array A copy of the attendees array.
- */
- public function getAttendees()
- {
- return $this->attendees;
- }
-
- /**
* Checks to see whether the specified attendee is associated with the
* current event.
*
}
/**
- * Sets the entire attendee array.
- *
- * @param array $attendees The new attendees array. This should be of the
- * correct format to avoid driver problems.
- */
- public function setAttendees($attendees)
- {
- $this->attendees = array_change_key_case($attendees);
- }
-
- /**
* Adds a new attendee to the current event.
*
* This will overwrite an existing attendee if one exists with the same
}
/**
- * Removes the specified attendee from the current event.
- *
- * @param string $email The email address of the attendee.
- */
- public function removeAttendee($email)
- {
- $email = Horde_String::lower($email);
- if (isset($this->attendees[$email])) {
- unset($this->attendees[$email]);
- }
- }
-
- /**
* Adds a single Kronolith_Resource to this event.
* No validation or acceptence/denial is done here...it should be done
* when saving the Event.
}
/**
- * Directly set/replace the _resources array. Called from Event::readForm
- * to bulk load the resources from $_SESSION
- *
- * @param $resources
- * @return unknown_type
- */
- public function setResources($resources)
- {
- $this->_resources = $resources;
- }
-
- /**
* Remove a Kronolith_Resource from this event
*
* @param Kronolith_Resource $resource The resource to remove
public function removeResource($resource)
{
if (isset($this->_resources[$resource->getId()])) {
- unset ($this->_resources[$resource->getId()]);
+ unset($this->_resources[$resource->getId()]);
}
}
return $this->_resources;
}
- /**
- * Checks to see whether the specified resource is associated with this
- * event.
- *
- * @param string $uid The resource uid.
- *
- * @return boolean True if the specified attendee is present for this
- * event.
- */
- public function hasResource($uid)
- {
- return isset($this->_resources[$uid]);
- }
-
public function isAllDay()
{
return $this->allday ||
$this->end->year > $this->start->year))));
}
- public function getAlarm()
- {
- return $this->alarm;
- }
-
- public function setAlarm($alarm)
- {
- $this->alarm = $alarm;
- }
-
public function readForm()
{
global $prefs, $cManager;
// Event owner.
$targetcalendar = Horde_Util::getFormData('targetcalendar');
if (strpos($targetcalendar, ':')) {
- list(, $creator) = explode(':', $targetcalendar, 2);
- } else {
- $creator = isset($this->eventID) ? $this->getCreatorId() : Horde_Auth::getAuth();
+ list(, $this->creator) = explode(':', $targetcalendar, 2);
+ } elseif (!isset($this->id)) {
+ $this->creator = Horde_Auth::getAuth();
}
- $this->setCreatorId($creator);
// Basic fields.
- $this->setTitle(Horde_Util::getFormData('title', $this->title));
- $this->setDescription(Horde_Util::getFormData('description', $this->description));
- $this->setLocation(Horde_Util::getFormData('location', $this->location));
- $this->setPrivate(Horde_Util::getFormData('private'));
+ $this->title = Horde_Util::getFormData('title', $this->title);
+ $this->description = Horde_Util::getFormData('description', $this->description);
+ $this->location = Horde_Util::getFormData('location', $this->location);
+ $this->private = (bool)Horde_Util::getFormData('private');
// URL.
$url = Horde_Util::getFormData('eventurl', $this->url);
$this->url = $url;
// Status.
- $this->setStatus(Horde_Util::getFormData('status', $this->status));
+ $this->status = Horde_Util::getFormData('status', $this->status);
// Attendees.
if (isset($_SESSION['kronolith']['attendees']) && is_array($_SESSION['kronolith']['attendees'])) {
- $this->setAttendees($_SESSION['kronolith']['attendees']);
+ $this->attendees = $_SESSION['kronolith']['attendees'];
}
if ($attendees = Horde_Util::getFormData('attendees')) {
$attendees = Kronolith::parseAttendees(trim($attendees));
if ($attendees) {
- $this->setAttendees($attendees);
+ $this->attendees = $attendees;
}
}
// Resources
if (isset($_SESSION['kronolith']['resources']) && is_array($_SESSION['kronolith']['resources'])) {
- $this->setResources($_SESSION['kronolith']['resources']);
+ $this->_resources = $_SESSION['kronolith']['resources'];
}
// strptime() is locale dependent, i.e. %p is not always matching
// Alarm.
if (!is_null($alarm = Horde_Util::getFormData('alarm'))) {
if ($alarm) {
- $this->setAlarm(Horde_Util::getFormData('alarm_value') * Horde_Util::getFormData('alarm_unit'));
+ $this->alarm = Horde_Util::getFormData('alarm_value') * Horde_Util::getFormData('alarm_unit');
// Notification.
if (Horde_Util::getFormData('alarm_change_method')) {
$types = Horde_Util::getFormData('event_alarms');
$this->methods = array();
}
} else {
- $this->setAlarm(0);
+ $this->alarm = 0;
$this->methods = array();
}
}
*/
public function getViewUrl($params = array(), $full = false)
{
- $params['eventID'] = $this->eventID;
- $params['calendar'] = $this->getCalendar();
- $params['type'] = $this->_calendarType;
+ $params['eventID'] = $this->id;
+ $params['calendar'] = $this->calendar;
+ $params['type'] = $this->calendarType;
return Horde::applicationUrl('event.php', $full)->add($params);
}
public function getEditUrl($params = array())
{
$params['view'] = 'EditEvent';
- $params['eventID'] = $this->eventID;
- $params['calendar'] = $this->getCalendar();
- $params['type'] = $this->_calendarType;
+ $params['eventID'] = $this->id;
+ $params['calendar'] = $this->calendar;
+ $params['type'] = $this->calendarType;
return Horde::applicationUrl('event.php')->add($params);
}
public function getDeleteUrl($params = array())
{
$params['view'] = 'DeleteEvent';
- $params['eventID'] = $this->eventID;
- $params['calendar'] = $this->getCalendar();
- $params['type'] = $this->_calendarType;
+ $params['eventID'] = $this->id;
+ $params['calendar'] = $this->calendar;
+ $params['type'] = $this->calendarType;
return Horde::applicationUrl('event.php')->add($params);
}
public function getExportUrl($params = array())
{
$params['view'] = 'ExportEvent';
- $params['eventID'] = $this->eventID;
- $params['calendar'] = $this->getCalendar();
- $params['type'] = $this->_calendarType;
+ $params['eventID'] = $this->id;
+ $params['calendar'] = $this->calendar;
+ $params['type'] = $this->calendarType;
return Horde::applicationUrl('event.php')->add($params);
}
$status .= Horde::fullSrcImg('recur-' . $icon_color . '.png', array('attr' => array('alt' => $title, 'title' => $title, 'class' => 'iconRecur')));
}
- if ($this->isPrivate()) {
+ if ($this->private) {
$title = _("Private event");
$status .= Horde::fullSrcImg('private-' . $icon_color . '.png', array('attr' => array('alt' => $title, 'title' => $title, 'class' => 'iconPrivate')));
}
$link .= ' ' . $status;
}
- if (!$this->isPrivate() ||
- $this->getCreatorId() == Horde_Auth::getAuth()) {
+ if (!$this->private ||
+ $this->creator == Horde_Auth::getAuth()) {
$link .= $this->getEditUrl(
array('datetime' => $datetime->strftime('%Y%m%d%H%M%S'),
'url' => $from_url))
public function getTooltip()
{
$tooltip = $this->getTimeRange()
- . "\n" . sprintf(_("Owner: %s"), ($this->getCreatorId() == Horde_Auth::getAuth() ?
- _("Me") : Kronolith::getUserName($this->getCreatorId())));
+ . "\n" . sprintf(_("Owner: %s"), ($this->creator == Horde_Auth::getAuth() ?
+ _("Me") : Kronolith::getUserName($this->creator)));
- if (!$this->isPrivate() || $this->getCreatorId() == Horde_Auth::getAuth()) {
+ if (!$this->private || $this->creator == Horde_Auth::getAuth()) {
if ($this->location) {
$tooltip .= "\n" . _("Location") . ': ' . $this->location;
}
*
* @var string
*/
- protected $_calendarType = 'holiday';
+ public $calendarType = 'holiday';
/**
* The status of this event.
{
$this->stored = true;
$this->initialized = true;
- $this->setTitle(Horde_String::convertCharset($dhEvent->getTitle(), 'UTF-8'));
+ $this->title = Horde_String::convertCharset($dhEvent->getTitle(), 'UTF-8');
$this->start = new Horde_Date($dhEvent->_date->getTime());
$this->end = new Horde_Date($this->start);
$this->end->mday++;
- $this->setId($dhEvent->getInternalName() . '-' . $this->start->dateString());
+ $this->id = $dhEvent->getInternalName() . '-' . $this->start->dateString();
}
/**
*
* @var string
*/
- protected $_calendarType = 'external';
+ public $calendarType = 'external';
/**
* The API (application) of this event.
{
$eventStart = new Horde_Date($event['start']);
$eventEnd = new Horde_Date($event['end']);
- $this->eventID = '_' . $this->_api . $event['id'];
+ $this->id = '_' . $this->_api . $event['id'];
$this->icon = !empty($event['icon']) ? $event['icon'] : null;
$this->title = $event['title'];
$this->description = isset($event['description']) ? $event['description'] : '';
*
* @var string
*/
- protected $_calendarType = 'remote';
+ public $calendarType = 'remote';
public function fromDriver($vEvent)
{
*
* @var string
*/
- protected $_calendarType = 'internal';
+ public $calendarType = 'internal';
/**
* Const'r
public function fromDriver($event)
{
- $this->eventID = $event['uid'];
- $this->setUID($this->eventID);
+ $this->id = $event['uid'];
+ $this->uid = $this->id;
if (isset($event['summary'])) {
$this->title = $event['summary'];
if (isset($event['sensitivity']) &&
($event['sensitivity'] == 'private' || $event['sensitivity'] == 'confidential')) {
- $this->setPrivate(true);
+ $this->private = true;
}
if (isset($event['organizer']['smtp-address'])) {
if (Kronolith::isUserEmail(Horde_Auth::getAuth(), $event['organizer']['smtp-address'])) {
- $this->creatorID = Horde_Auth::getAuth();
+ $this->creator = Horde_Auth::getAuth();
} else {
- $this->creatorID = $event['organizer']['smtp-address'];
+ $this->creator = $event['organizer']['smtp-address'];
}
}
public function toDriver()
{
$event = array();
- $event['uid'] = $this->getUID();
+ $event['uid'] = $this->uid;
$event['summary'] = $this->title;
$event['body'] = $this->description;
$event['location'] = $this->location;
-
- if ($this->isPrivate()) {
- $event['sensitivity'] = 'private';
- } else {
- $event['sensitivity'] = 'public';
- }
+ $event['sensitivity'] = $this->private ? 'private' : 'public';
// Only set organizer if this is a new event
if ($this->getID() == null) {
$organizer = array(
- 'display-name' => Kronolith::getUserName($this->getCreatorId()),
- 'smtp-address' => Kronolith::getUserEmail($this->getCreatorId())
+ 'display-name' => Kronolith::getUserName($this->creator),
+ 'smtp-address' => Kronolith::getUserEmail($this->creator)
);
$event['organizer'] = $organizer;
}
// Attendees
$event['attendee'] = array();
- $attendees = $this->getAttendees();
-
- foreach($attendees as $email => $attendee) {
+ foreach ($this->attendees as $email => $attendee) {
$new_attendee = array();
$new_attendee['display-name'] = $attendee['name'];
*
* @var string
*/
- protected $_calendarType = 'resource';
+ public $calendarType = 'resource';
/**
* @var array
$this->durMin = ($this->end->timestamp() - $this->start->timestamp()) / 60;
$this->title = $driver->convertFromDriver($SQLEvent['event_title']);
- $this->eventID = $SQLEvent['event_id'];
+ $this->id = $SQLEvent['event_id'];
$this->setUID($SQLEvent['event_uid']);
- $this->creatorID = $SQLEvent['event_creator_id'];
+ $this->creator = $SQLEvent['event_creator_id'];
if (!empty($SQLEvent['event_recurtype'])) {
$this->recurrence = new Horde_Date_Recurrence($this->start);
$driver = $this->getDriver();
/* Basic fields. */
- $this->_properties['event_creator_id'] = $driver->convertToDriver($this->getCreatorId());
+ $this->_properties['event_creator_id'] = $driver->convertToDriver($this->creator);
$this->_properties['event_title'] = $driver->convertToDriver($this->title);
- $this->_properties['event_description'] = $driver->convertToDriver($this->getDescription());
- $this->_properties['event_location'] = $driver->convertToDriver($this->getLocation());
- $this->_properties['event_private'] = (int)$this->isPrivate();
- $this->_properties['event_status'] = $this->getStatus();
- $this->_properties['event_attendees'] = serialize($driver->convertToDriver($this->getAttendees()));
+ $this->_properties['event_description'] = $driver->convertToDriver($this->description);
+ $this->_properties['event_location'] = $driver->convertToDriver($this->location);
+ $this->_properties['event_private'] = (int)$this->private;
+ $this->_properties['event_status'] = $this->status;
+ $this->_properties['event_attendees'] = serialize($driver->convertToDriver($this->attendees));
$this->_properties['event_resources'] = serialize($driver->convertToDriver($this->getResources()));
$this->_properties['event_modified'] = $_SERVER['REQUEST_TIME'];
}
/* Alarm. */
- $this->_properties['event_alarm'] = (int)$this->getAlarm();
+ $this->_properties['event_alarm'] = (int)$this->alarm;
/* Alarm Notification Methods. */
$this->_properties['event_alarm_methods'] = serialize($driver->convertToDriver($this->methods));
*/
public function getDriver()
{
- return Kronolith::getDriver('Resource', $this->_calendar);
+ return Kronolith::getDriver('Resource', $this->calendar);
}
/**
*
* @var string
*/
- protected $_calendarType = 'internal';
+ public $calendarType = 'internal';
/**
* @var array
$this->durMin = ($this->end->timestamp() - $this->start->timestamp()) / 60;
$this->title = $driver->convertFromDriver($SQLEvent['event_title']);
- $this->eventID = $SQLEvent['event_id'];
- $this->setUID($SQLEvent['event_uid']);
- $this->creatorID = $SQLEvent['event_creator_id'];
+ $this->id = $SQLEvent['event_id'];
+ $this->uid = $SQLEvent['event_uid'];
+ $this->creator = $SQLEvent['event_creator_id'];
if (!empty($SQLEvent['event_recurtype'])) {
$this->recurrence = new Horde_Date_Recurrence($this->start);
$driver = $this->getDriver();
/* Basic fields. */
- $this->_properties['event_creator_id'] = $driver->convertToDriver($this->getCreatorId());
+ $this->_properties['event_creator_id'] = $driver->convertToDriver($this->creator);
$this->_properties['event_title'] = $driver->convertToDriver($this->title);
- $this->_properties['event_description'] = $driver->convertToDriver($this->getDescription());
- $this->_properties['event_location'] = $driver->convertToDriver($this->getLocation());
+ $this->_properties['event_description'] = $driver->convertToDriver($this->description);
+ $this->_properties['event_location'] = $driver->convertToDriver($this->location);
$this->_properties['event_url'] = $this->url;
- $this->_properties['event_private'] = (int)$this->isPrivate();
- $this->_properties['event_status'] = $this->getStatus();
- $this->_properties['event_attendees'] = serialize($driver->convertToDriver($this->getAttendees()));
+ $this->_properties['event_private'] = (int)$this->private;
+ $this->_properties['event_status'] = $this->status;
+ $this->_properties['event_attendees'] = serialize($driver->convertToDriver($this->attendees));
$this->_properties['event_resources'] = serialize($driver->convertToDriver($this->getResources()));
$this->_properties['event_modified'] = $_SERVER['REQUEST_TIME'];
}
/* Alarm. */
- $this->_properties['event_alarm'] = (int)$this->getAlarm();
+ $this->_properties['event_alarm'] = (int)$this->alarm;
/* Alarm Notification Methods. */
$this->_properties['event_alarm_methods'] = serialize($driver->convertToDriver($this->methods));
/* Add all the busy periods. */
foreach ($busy as $events) {
foreach ($events as $event) {
- if ($event->hasStatus(Kronolith::STATUS_FREE)) {
+ if ($event->status == Kronolith::STATUS_FREE) {
continue;
}
- if ($event->hasStatus(Kronolith::STATUS_CANCELLED)) {
+ if ($event->status == Kronolith::STATUS_CANCELLED) {
continue;
}
if ($coverDates) {
self::addCoverDates($results, $event, $event->start, $event->end, $json);
} else {
- $results[$event->start->dateString()][$event->getId()] = $json ? $event->toJson() : $event;
+ $results[$event->start->dateString()][$event->id] = $json ? $event->toJson() : $event;
}
}
$addEvent = clone $event;
$addEvent->start = $next;
$addEvent->end = $nextEnd;
- $results[$addEvent->start->dateString()][$addEvent->getId()] = $json ? $addEvent->toJson() : $addEvent;
+ $results[$addEvent->start->dateString()][$addEvent->id] = $json ? $addEvent->toJson() : $addEvent;
}
}
}
} else {
if (!$coverDates) {
- $results[$event->start->dateString()][$event->getId()] = $json ? $event->toJson() : $event;
+ $results[$event->start->dateString()][$event->id] = $json ? $event->toJson() : $event;
} else {
/* Event only occurs once. */
$allDay = $event->isAllDay();
$addEvent->last = false;
}
- $results[$loopDate->dateString()][$addEvent->getId()] = $json ? $addEvent->toJson($allDay) : $addEvent;
+ $results[$loopDate->dateString()][$addEvent->id] = $json ? $addEvent->toJson($allDay) : $addEvent;
}
$loopDate = new Horde_Date(
if ($loopDate->compareDate($eventEnd) != 0) {
$addEvent->last = false;
}
- $results[$loopDate->dateString()][$addEvent->getId()] = $json ? $addEvent->toJson($allDay) : $addEvent;
+ $results[$loopDate->dateString()][$addEvent->id] = $json ? $addEvent->toJson($allDay) : $addEvent;
}
$loopDate->mday++;
}
$kronolith_driver = self::getDriver();
$calendars = self::listCalendars(true, Horde_Perms::ALL);
- $current_calendar = $kronolith_driver->getCalendar();
+ $current_calendar = $kronolith_driver->calendar;
$count = 0;
foreach (array_keys($calendars) as $calendar) {
$kronolith_driver = Kronolith::getDriver(null, $calendar);
$event = $kronolith_driver->getEvent();
$event->initialized = true;
- $event->setTitle($title);
- $event->setDescription($description);
+ $event->title = $title;
+ $event->description = $description;
$event->start = $d;
$event->end = $d->add(array('hour' => 1));
. $newAttendeeParsedPart->host;
// Avoid overwriting existing attendees with the default
// values.
- $attendees[$email] = array(
+ $attendees[Horde_String::lower($email)] = array(
'attendance' => Kronolith::PART_REQUIRED,
'response' => Kronolith::RESPONSE_NONE,
'name' => $name);
$attendees = array();
/* Attendees */
- if (isset($_SESSION['kronolith']['attendees']) ||
+ if (isset($_SESSION['kronolith']['attendees']) &&
is_array($_SESSION['kronolith']['attendees'])) {
$attendees = array();
}
/* Resources */
- if (isset($_SESSION['kronolith']['resources']) ||
+ if (isset($_SESSION['kronolith']['resources']) &&
is_array($_SESSION['kronolith']['resources'])) {
foreach ($_SESSION['kronolith']['resources'] as $resource) {
{
global $conf;
- $attendees = $event->getAttendees();
- if (!$attendees) {
+ if (!$event->attendees) {
return;
}
- $ident = Horde_Prefs_Identity::singleton('none', $event->getCreatorId());
+ $ident = Horde_Prefs_Identity::singleton('none', $event->creator);
$myemail = $ident->getValue('from_addr');
if (!$myemail) {
$myemail = explode('@', $myemail);
$from = Horde_Mime_Address::writeAddress($myemail[0], isset($myemail[1]) ? $myemail[1] : '', $ident->getValue('fullname'));
- $share = &$GLOBALS['kronolith_shares']->getShare($event->getCalendar());
+ $share = &$GLOBALS['kronolith_shares']->getShare($event->calendar);
- foreach ($attendees as $email => $status) {
+ foreach ($event->attendees as $email => $status) {
/* Don't bother sending an invitation/update if the recipient does
* not need to participate, or has declined participating, or
* doesn't have an email address. */
sprintf(_("on %s at %s"), $event->start->strftime('%x'), $event->start->strftime('%X')) .
")\n\n";
- if ($event->getLocation() != '') {
- $message .= sprintf(_("Location: %s"), $event->getLocation()) . "\n\n";
+ if (strlen($event->location)) {
+ $message .= sprintf(_("Location: %s"), $event->location) . "\n\n";
}
- if ($event->getAttendees()) {
+ if ($event->attendees) {
$attendee_list = array();
- foreach ($event->getAttendees() as $mail => $attendee) {
+ foreach ($event->attendees as $mail => $attendee) {
$attendee_list[] = empty($attendee['name']) ? $mail : Horde_Mime_Address::trimAddress($attendee['name'] . (strpos($mail, '@') === false ? '' : ' <' . $mail . '>'));
}
$message .= sprintf(_("Attendees: %s"), implode(', ', $attendee_list)) . "\n\n";
}
- if ($event->getDescription() != '') {
- $message .= _("The following is a more detailed description of the event:") . "\n\n" . $event->getDescription() . "\n\n";
+ if ($event->description != '') {
+ $message .= _("The following is a more detailed description of the event:") . "\n\n" . $event->description . "\n\n";
}
$message .= _("Attached is an iCalendar file with more information about the event. If your mail client supports iTip requests you can use this file to easily update your local copy of the event.");
if ($action == self::ITIP_REQUEST) {
$attend_link = Horde::applicationUrl('attend.php', true, -1)
- ->add(array('c' => $event->getCalendar(),
- 'e' => $event->getId(),
+ ->add(array('c' => $event->calendar,
+ 'e' => $event->id,
'u' => $email));
$message .= "\n\n" . sprintf(_("If your email client doesn't support iTip requests you can use one of the following links to accept or decline the event.\n\nTo accept the event:\n%s\n\nTo accept the event tentatively:\n%s\n\nTo decline the event:\n%s\n"), $attend_link->add('a', 'accept'), $attend_link->add('a', 'tentative'), $attend_link->add('a', 'decline'));
}
require_once 'Horde/Group.php';
$groups = &Group::singleton();
- $calendar = $event->getCalendar();
+ $calendar = $event->calendar;
$recipients = array();
$share = &$GLOBALS['kronolith_shares']->getShare($calendar);
if (is_a($share, 'PEAR_Error')) {
$share->get('name'),
$event->start->strftime($df),
$event->start->strftime($tf ? '%R' : '%I:%M%p'))
- . "\n\n" . $event->getDescription();
+ . "\n\n" . $event->description;
$mime_mail = new Horde_Mime_Mail(array('subject' => $subject . ' ' . $event->title,
'to' => implode(',', $df_recipients),
*/
public static function eventTabs($tabname, $event)
{
- if (!$event->isInitialized()) {
+ if (!$event->initialized) {
return;
}
'onclick' => 'return ShowTab(\'Event\');'));
/* We check for read permissions, because we can always save a copy if
* we can read the event. */
- if ((!$event->isPrivate() ||
- $event->getCreatorId() == Horde_Auth::getAuth()) &&
+ if ((!$event->private ||
+ $event->creator == Horde_Auth::getAuth()) &&
$event->hasPermission(Horde_Perms::READ)) {
$tabs->addTab(
$event->hasPermission(Horde_Perms::EDIT) ? _("_Edit") : _("Save As New"),
$query->end = $del_time;
$query->status = null;
$query->calendars = array_keys($calendars);
- $query->creatorID = Horde_Auth::getAuth();
+ $query->creator = Horde_Auth::getAuth();
/* Perform the search */
$events = Kronolith::search($query);
$count = 0;
foreach ($events as $event) {
if (!$event->recurs()) {
- if ($event->getCalendar() != $kronolith_driver->getCalendar()) {
- $kronolith_driver->open($event->getCalendar());
+ if ($event->calendar != $kronolith_driver->calendar) {
+ $kronolith_driver->open($event->calendar);
}
- $results = $kronolith_driver->deleteEvent($event->getId(), true);
+ $results = $kronolith_driver->deleteEvent($event->id, true);
++$count;
if (is_a($results, 'PEAR_Error')) {
Horde::logMessage($results, __FILE__, __LINE__, PEAR_LOG_ERR);
/* Check for conflicts, ignoring the conflict if it's for the
* same event that is passed. */
if (!is_array($event)) {
- $uid = $event->getUID();
+ $uid = $event->uid;
} else {
$uid = 0;
}
foreach ($busy as $events) {
foreach ($events as $e) {
- if (!($e->hasStatus(Kronolith::STATUS_CANCELLED) ||
- $e->hasStatus(Kronolith::STATUS_FREE)) &&
- $e->getUID() !== $uid) {
+ if (!($e->status == Kronolith::STATUS_CANCELLED ||
+ $e->status == Kronolith::STATUS_FREE) &&
+ $e->uid !== $uid) {
if (!($e->start->compareDateTime($end) >= 0) &&
!($e->end->compareDateTime($start) <= 0)) {
/* Check for conflicts, ignoring the conflict if it's for the
* same event that is passed. */
if (!is_array($event)) {
- $uid = $event->getUID();
+ $uid = $event->uid;
} else {
$uid = 0;
}
foreach ($busy as $events) {
foreach ($events as $e) {
- if (!($e->hasStatus(Kronolith::STATUS_CANCELLED) ||
- $e->hasStatus(Kronolith::STATUS_FREE)) &&
- $e->getUID() !== $uid) {
+ if (!($e->status == Kronolith::STATUS_CANCELLED ||
+ $e->status == Kronolith::STATUS_FREE) &&
+ $e->uid !== $uid) {
// Comparing to zero allows the events to start at the same
// the previous event ends.
$driver = $this->getDriver();
/* Make sure it's not already attached. */
- $uid = $event->getUID();
+ $uid = $event->uid;
$existing = $driver->getByUID($uid, array($this->get('calendar')));
if (!($existing instanceof PEAR_Error)) {
/* Already attached, just update */
} else {
/* Create a new event */
$e = $driver->getEvent();
- $e->setCalendar($this->get('calendar'));
+ $e->calendar = $this->get('calendar');
$e->fromiCalendar($event->toiCalendar(new Horde_iCalendar('2.0')));
$e->save();
}
public function removeEvent($event)
{
$driver = Kronolith::getDriver('Resource', $this->get('calendar'));
- $re = $driver->getByUID($event->getUID(), array($this->get('calendar')));
+ $re = $driver->getByUID($event->uid, array($this->get('calendar')));
// Event will only be in the calendar if it's been accepted. This error
// should never happen, but put it here as a safeguard for now.
if (!($re instanceof PEAR_Error)) {
. 'valign="top" colspan="' . $this->_span[$cid] . '">'
. $event->getLink($this, true, $this->link(0, true));
if ($showLocation) {
- $row .= '<div class="event-location">' . htmlspecialchars($event->getLocation()) . '</div>';
+ $row .= '<div class="event-location">' . htmlspecialchars($event->location) . '</div>';
}
$row .= '</td>';
}
$row .= '<div class="event-time">' . htmlspecialchars($event->getTimeRange()) . '</div>';
}
if ($showLocation) {
- $row .= '<div class="event-location">' . htmlspecialchars($event->getLocation()) . '</div>';
+ $row .= '<div class="event-location">' . htmlspecialchars($event->location) . '</div>';
}
$row .= '</td>';
}
// If we have side_by_side we only want to include the
// event in the proper calendar.
if ($this->_sidebyside) {
- $cid = $event->getCalendar();
+ $cid = $event->calendar;
} else {
$cid = 0;
}
// If we have side_by_side we only want to include the
// event in the proper calendar.
if ($this->_sidebyside) {
- $cid = $event->getCalendar();
+ $cid = $event->calendar;
} else {
$cid = 0;
}
}
if ($this->event->hasPermission(Horde_Perms::EDIT)) {
- $calendar_id = $this->event->getCalendar();
+ $calendar_id = $this->event->calendar;
} else {
$calendar_id = Kronolith::getDefaultCalendar(Horde_Perms::EDIT);
}
!is_a($share = &$this->event->getShare(), 'PEAR_Error')) {
$calendar_id .= ':' . $share->get('owner');
}
- $_SESSION['kronolith']['attendees'] = $this->event->getAttendees();
+ $_SESSION['kronolith']['attendees'] = $this->event->attendees;
$_SESSION['kronolith']['resources'] = $this->event->getResources();
if ($datetime = Horde_Util::getFormData('datetime')) {
$datetime = new Horde_Date($datetime);
$url = Horde_Util::getFormData('url');
$perms = Horde_Perms::EDIT;
- if ($this->event->getCreatorId() == Horde_Auth::getAuth()) {
+ if ($this->event->creator == Horde_Auth::getAuth()) {
$perms |= Kronolith::PERMS_DELEGATE;
}
$calendars = Kronolith::listCalendars(false, $perms);
if ($this->event->hasPermission(Horde_Perms::EDIT)) {
$buttons[] = '<input type="submit" class="button" name="save" value="' . _("Save Event") . '" />';
}
- if ($this->event->isInitialized()) {
+ if ($this->event->initialized) {
if (!$this->event->recurs() &&
(!empty($conf['hooks']['permsdenied']) ||
$GLOBALS['perms']->hasAppPermission('max_events') === true ||
// Tags
$tagger = Kronolith::getTagger();
- $tags = $tagger->getTags($event->getUID(), 'event');
+ $tags = $tagger->getTags($event->uid, 'event');
$tags = implode(',', array_values($tags));
echo '<div id="EditEvent"' . ($active ? '' : ' style="display:none"') . '>';
$createdby = '';
$modifiedby = '';
$userId = Horde_Auth::getAuth();
- if ($this->event->getUID()) {
+ if ($this->event->uid) {
/* Get the event's history. */
$history = &Horde_History::singleton();
- $log = $history->getHistory('kronolith:' . $this->event->getCalendar() . ':' .
- $this->event->getUID());
+ $log = $history->getHistory('kronolith:' . $this->event->calendar . ':' .
+ $this->event->uid);
if ($log && !is_a($log, 'PEAR_Error')) {
foreach ($log->getData() as $entry) {
switch ($entry['action']) {
}
}
- $creatorId = $this->event->getCreatorId();
- $description = $this->event->getDescription();
- $location = $this->event->getLocation();
+ $creatorId = $this->event->creator;
+ $description = $this->event->description;
+ $location = $this->event->location;
$eventurl = $this->event->url;
- $private = $this->event->isPrivate() && $creatorId != Horde_Auth::getAuth();
+ $private = $this->event->private && $creatorId != Horde_Auth::getAuth();
$owner = Kronolith::getUserName($creatorId);
- $status = Kronolith::statusToString($this->event->getStatus());
- $attendees = $this->event->getAttendees();
+ $status = Kronolith::statusToString($this->event->status);
+ $attendees = $this->event->attendees;
$resources = $this->event->getResources();
if ($datetime = Horde_Util::getFormData('datetime')) {
$datetime = new Horde_Date($datetime);
$iCal = new Horde_iCalendar('2.0');
- if ($event->getCalendarType() == 'internal') {
- $share = &$GLOBALS['kronolith_shares']->getShare($event->getCalendar());
+ if ($event->calendarType == 'internal') {
+ $share = &$GLOBALS['kronolith_shares']->getShare($event->calendar);
if (!is_a($share, 'PEAR_Error')) {
$iCal->setAttribute(
'X-WR-CALNAME',
$date_stamp = $date->dateString();
if (!empty($this->_events[$date_stamp])) {
foreach ($this->_events[$date_stamp] as $event) {
- if (!$sidebyside || $event->getCalendar() == $id) {
+ if (!$sidebyside || $event->calendar == $id) {
$html .= '<div class="month-eventbox"' . $event->getCSSColors() . '>'
. $event->getLink($date, true, $this_link);
if ($showTime) {
$html .= '<div class="event-time">' . htmlspecialchars($event->getTimeRange()) . '</div>';
}
if ($showLocation) {
- $html .= '<div class="event-location">' . htmlspecialchars($event->getLocation()) . '</div>';
+ $html .= '<div class="event-location">' . htmlspecialchars($event->location) . '</div>';
}
$html .= '</div>';
}
. 'valign="top">'
. $event->getLink($this->days[$j], true, $this->link(0, true));
if ($showLocation) {
- $row .= '<div class="event-location">' . htmlspecialchars($event->getLocation()) . '</div>';
+ $row .= '<div class="event-location">' . htmlspecialchars($event->location) . '</div>';
}
$row .= '</td>';
}
foreach ($this->days[$j]->_event_matrix[$cid][$i] as $key) {
$event = &$this->days[$j]->_events[$key];
- if ($include_all_events || $event->getCalendar() == $cid) {
+ if ($include_all_events || $event->calendar == $cid) {
// Since we've made sure that this event's
// overlap is a factor of the total span,
// we get this event's individual span by
$row .= '<div class="event-time">' . htmlspecialchars($event->getTimeRange()) . '</div>';
}
if ($showLocation) {
- $row .= '<div class="event-location">' . htmlspecialchars($event->getLocation()) . '</div>';
+ $row .= '<div class="event-location">' . htmlspecialchars($event->location) . '</div>';
}
$row .= '</td>';
}
* them. */
$day_events = '';
foreach ($this->_events[$date->dateString()] as $event) {
- if ($event->getStatus() == Kronolith::STATUS_CONFIRMED) {
- /* Set the background color to distinguish the day */
+ if ($event->status == Kronolith::STATUS_CONFIRMED) {
+ /* Set the background color to distinguish the
+ * day */
$style = 'year-event';
}
$day_events .= $event->start->strftime($prefs->getValue('twentyFour') ? '%R' : '%I:%M%p') . '-' . $event->end->strftime($prefs->getValue('twentyFour') ? '%R' : '%I:%M%p');
}
$day_events .= ':'
- . (($event->getLocation()) ? ' (' . $event->getLocation() . ')' : '')
+ . (($event->location) ? ' (' . $event->location . ')' : '')
. ' ' . $event->getTitle() . "\n";
}
/* Bold the cell if there are events. */
var_dump($a->getMessage());
} else {
$events = reset($a);
- var_dump($events[0]->getId());
+ var_dump($events[0]->id);
}
--EXPECT--
bool(true)
$object = new Kronolith_Event_Sql($driver);
$object->start = new Horde_Date('2007-03-15 13:10:20');
$object->end = new Horde_Date('2007-03-15 14:20:00');
-$object->setCreatorId('joe');
-$object->setUID('20070315143732.4wlenqz3edq8@horde.org');
-$object->setTitle('Hübscher Termin');
-$object->setDescription("Schöne Bescherung\nNew line");
-$object->setLocation('Allgäu');
-$object->setAlarm(10);
+$object->creator = 'joe';
+$object->uid = '20070315143732.4wlenqz3edq8@horde.org';
+$object->title = 'Hübscher Termin';
+$object->description = "Schöne Bescherung\nNew line";
+$object->location = 'Allgäu';
+$object->alarm = 10;
$object->tags = array('Schöngeistiges');
$object->recurrence = new Horde_Date_Recurrence($object->start);
$object->recurrence->setRecurType(Horde_Date_Recurrence::RECUR_DAILY);
$ical->addComponent($cal);
echo $ical->exportvCalendar() . "\n";
-$object->setPrivate(true);
-$object->setStatus(Kronolith::STATUS_TENTATIVE);
+$object->private = true;
+$object->status = Kronolith::STATUS_TENTATIVE;
$object->recurrence = new Horde_Date_Recurrence($object->start);
$object->recurrence->setRecurType(Horde_Date_Recurrence::RECUR_MONTHLY_DATE);
$object->recurrence->setRecurInterval(1);
$object->recurrence->addException(2007, 4, 15);
-$object->setAttendees(
+$object->attendees =
array('juergen@example.com' =>
array('attendance' => Kronolith::PART_REQUIRED,
'response' => Kronolith::RESPONSE_NONE,
'name' => 'Jack Doe'),
'jenny@example.com' =>
array('attendance' => Kronolith::PART_NONE,
- 'response' => Kronolith::RESPONSE_TENTATIVE)));
+ 'response' => Kronolith::RESPONSE_TENTATIVE));
$ical = new Horde_iCalendar('1.0');
$cal = $object->toiCalendar($ical);
DTEND:20070315T132000Z
DTSTAMP:%d%d%d%d%d%d%d%dT%d%d%d%d%d%dZ
UID:20070315143732.4wlenqz3edq8@horde.org
-SUMMARY:Private Event from 1:10pm to 2:20pm
+SUMMARY:busy
ORGANIZER;CN=joe:mailto:joe
CLASS:PRIVATE
STATUS:TENTATIVE
DTEND:20070315T132000Z
DTSTAMP:%d%d%d%d%d%d%d%dT%d%d%d%d%d%dZ
UID:20070315143732.4wlenqz3edq8@horde.org
-SUMMARY:Private Event from 1:10pm to 2:20pm
+SUMMARY:busy
ORGANIZER;CN=joe:mailto:joe
CLASS:PRIVATE
STATUS:TENTATIVE
}
$event = Kronolith::getDriver()->getEvent();
-$_SESSION['kronolith']['attendees'] = $event->getAttendees();
+$_SESSION['kronolith']['attendees'] = $event->attendees;
$_SESSION['kronolith']['resources'] = $event->getResources();
$date = Horde_Util::getFormData('datetime');
$title = Horde_Util::getFormData('pattern_title');
if (strlen($desc) || strlen($title)) {
$event = Kronolith::getDriver()->getEvent();
- $event->setDescription($desc);
- $event->setTitle($title);
+ $event->description = $desc;
+ $event->title = $title;
$event->status = null;
$time1 = $_SERVER['REQUEST_TIME'];
<input type="hidden" name="month" value="<?php if (isset($month)) echo htmlspecialchars($month) ?>" />
<input type="hidden" name="mday" value="<?php if (isset($day)) echo htmlspecialchars($day) ?>" />
<input type="hidden" name="url" value="<?php echo htmlspecialchars($url) ?>" />
-<input type="hidden" name="eventID" value="<?php echo htmlspecialchars($this->event->getId()) ?>" />
-<input type="hidden" name="calendar" value="<?php echo htmlspecialchars($this->event->getCalendar()) ?>" />
+<input type="hidden" name="eventID" value="<?php echo htmlspecialchars($this->event->id) ?>" />
+<input type="hidden" name="calendar" value="<?php echo htmlspecialchars($this->event->calendar) ?>" />
<table class="striped" cellspacing="0">
<tr><td class="warning"><?php echo _("This is a recurring event. Delete the current event only, this<br />occurrence and all future occurences, or all occurences?") ?></td></tr>
<input type="hidden" name="month" value="<?php if (isset($month)) echo htmlspecialchars($month) ?>" />
<input type="hidden" name="mday" value="<?php if (isset($day)) echo htmlspecialchars($day) ?>" />
<input type="hidden" name="url" value="<?php echo htmlspecialchars($url) ?>" />
-<input type="hidden" name="eventID" value="<?php echo htmlspecialchars($this->event->getId()) ?>" />
+<input type="hidden" name="eventID" value="<?php echo htmlspecialchars($this->event->id) ?>" />
<input type="hidden" name="calendar" value="<?php echo htmlspecialchars(Horde_Util::getFormData('calendar')) ?>" />
<div class="headerbox">
<?php $showCalSelect = (!$GLOBALS['prefs']->isLocked('default_share') && count($calendars) > 1 && empty($GLOBALS['show_resource_calendars'])); ?>
-<form action="<?php echo ($event->isInitialized() && $event->hasPermission(Horde_Perms::EDIT)) ? 'edit.php' : 'add.php' ?>" method="post" name="eventform" id="eventform">
+<form action="<?php echo ($event->initialized && $event->hasPermission(Horde_Perms::EDIT)) ? 'edit.php' : 'add.php' ?>" method="post" name="eventform" id="eventform">
<?php Horde_Util::pformInput() ?>
<input type="hidden" name="year" value="<?php if (isset($year)) echo htmlspecialchars($year) ?>" />
<input type="hidden" name="month" value="<?php if (isset($month)) echo htmlspecialchars($month) ?>" />
<?php if (isset($url)): ?>
<input type="hidden" name="url" value="<?php echo htmlspecialchars($url) ?>" />
<?php endif; ?>
-<?php if ($event->isInitialized() && $event->hasPermission(Horde_Perms::EDIT)): ?>
-<input type="hidden" name="eventID" value="<?php echo htmlspecialchars($event->getId()) ?>" />
-<input type="hidden" name="existingcalendar" value="<?php echo htmlspecialchars($event->getCalendar()) ?>" />
+<?php if ($event->initialized && $event->hasPermission(Horde_Perms::EDIT)): ?>
+<input type="hidden" name="eventID" value="<?php echo htmlspecialchars($event->id) ?>" />
+<input type="hidden" name="existingcalendar" value="<?php echo htmlspecialchars($event->calendar) ?>" />
<?php endif; ?>
<?php if (!$showCalSelect): ?>
<input type="hidden" name="targetcalendar" value="<?php echo htmlspecialchars($calendar_id) ?>" />
<?php endif; ?>
-<?php if (!$event->isInitialized()): ?>
+<?php if (!$event->initialized): ?>
<!-- header -->
<h1 class="header">
<?php echo _("Add Event") ?>
<td colspan="4">
<select id="targetcalendar" name="targetcalendar">
<?php
- $creator = $event->getCreatorId();
if (!empty($GLOBALS['display_resource_calendars'])) {
// We are editing/viewing resource calendars
foreach ($GLOBALS['display_resource_calendars'] as $cal) {
// Normal view
foreach ($calendars as $id => $cal) {
$delegates = array();
- if ($cal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT, $creator)) {
+ if ($cal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT, $event->creator)) {
$delegates[$id] = htmlspecialchars($cal->get('name'));
} else {
$delegates[$id . ':' . $cal->get('owner')] = htmlspecialchars($cal->get('name'). ' (' . sprintf(_("as %s"), Kronolith::getUserName($cal->get('owner'))) . ')');
<tr>
<td class="rightAlign"><strong><?php echo Horde::label('location', _("Lo_cation")) ?></strong></td>
<td colspan="4">
- <input type="text" name="location" id="location" value="<?php echo htmlspecialchars($event->getLocation()) ?>" size="40" maxlength="255" />
+ <input type="text" name="location" id="location" value="<?php echo htmlspecialchars($event->location) ?>" size="40" maxlength="255" />
</td>
</tr>
<strong><?php echo Horde::label('status', _("Stat_us")) ?></strong>
</td>
<td colspan="4">
- <?php echo Kronolith::buildStatusWidget('status', $event->getStatus()) ?>
+ <?php echo Kronolith::buildStatusWidget('status', $event->status) ?>
</td>
</tr>
<strong><?php echo Horde::label('private', _("Private?")) ?></strong>
</td>
<td colspan="4">
- <input type="checkbox" class="checkbox" id="private" name="private"<?php if ($event->isPrivate()) echo ' checked="checked"' ?> />
+ <input type="checkbox" class="checkbox" id="private" name="private"<?php if ($event->private) echo ' checked="checked"' ?> />
</td>
</tr>
<?php require KRONOLITH_TEMPLATES . '/edit/edit_timespan.inc' ?>
<tr>
<td colspan="5" class="control toggle" onclick="KronolithEventForm.toggleSection('description')">
<?php echo Horde::img('tree/blank.png', '', array('id' => 'toggle_description'), $GLOBALS['registry']->getImageDir('horde')) . ' <strong>' . Horde::label('description', _("Descri_ption")) ?></strong>
- <span class="extra" id="extra_description"><?php echo htmlspecialchars(substr(str_replace(array("\r", "\n"), ' ', $event->getDescription()), 0, 80)) ?></span>
+ <span class="extra" id="extra_description"><?php echo htmlspecialchars(substr(str_replace(array("\r", "\n"), ' ', $event->description), 0, 80)) ?></span>
</td>
</tr>
<tr id="section_description">
<td colspan="5">
- <textarea id="description" name="description" rows="4"><?php echo htmlspecialchars($event->getDescription()) ?></textarea>
+ <textarea id="description" name="description" rows="4"><?php echo htmlspecialchars($event->description) ?></textarea>
</td>
</tr>
<input type="text" name="tags" id="tags" value="<?php echo (!empty($tags) ? htmlspecialchars($tags) : '')?>" size="40" />
<div id="tags_results" name="tags_results" class="autocomplete"></div>
<span id="tags_loading_img" style="display:none;"><?php echo Horde::img('loading.gif', _("Loading...")) ?></span>
- <?php $tac = Horde_Ajax_Imple::factory(array('kronolith', 'TagAutoCompleter'), array('triggerId' => 'tags', 'id' => $event->getUID()));
+ <?php $tac = Horde_Ajax_Imple::factory(array('kronolith', 'TagAutoCompleter'), array('triggerId' => 'tags', 'id' => $event->uid));
$tac->attach();
?>
</td>
<td></td>
<td colspan="4">
<input id="sendupdates" type="checkbox" class="checkbox" name="sendupdates" />
- <label for="sendupdates"><?php echo $event->isInitialized() ? _("Send updates to all attendees?") : _("Send invitations to all attendees?") ?></label>
+ <label for="sendupdates"><?php echo $event->initialized ? _("Send updates to all attendees?") : _("Send invitations to all attendees?") ?></label>
</td>
</tr>
<tr>
<td nowrap="nowrap">
<?php echo $event->getLink() ?>
</td>
- <td class="nowrap"><?php echo htmlspecialchars($event->getLocation()) ?></td>
- <td class="nowrap"><?php echo Kronolith::statusToString($event->getStatus()) ?></td>
+ <td class="nowrap"><?php echo htmlspecialchars($event->location) ?></td>
+ <td class="nowrap"><?php echo Kronolith::statusToString($event->status) ?></td>
<td class="nowrap"><?php echo $event->start->strftime($prefs->getValue('date_format')) . $event->start->strftime($prefs->getValue('twentyFour') ? ' %H:%M' : ' %I:%M %p') ?></td>
<td class="nowrap"><?php echo $event->end->strftime($prefs->getValue('date_format')) . $event->end->strftime($prefs->getValue('twentyFour') ? ' %H:%M' : ' %I:%M %p') ?></td>
</tr>
<td class="rightAlign"><strong><?php echo _("Alarm") ?> </strong></td>
<td>
<?php
-if ($this->event->isInitialized() && $this->event->alarm > 0):
+if ($this->event->initialized && $this->event->alarm > 0):
if ($this->event->alarm % 10080 == 0) {
$alarm_value = $this->event->alarm / 10080;
$alarm_unit = _("Week(s)");