class Kronolith_Driver_Kolab extends Kronolith_Driver
{
/**
+ * The session handler.
+ *
+ * @var Horde_Kolab_Session
+ */
+ private $_session;
+
+ /**
* Our Kolab server connection.
*
* @var Kolab
private $_store;
/**
+ * Set the session handler.
+ *
+ * @param Horde_Kolab_Session $session The session handler.
+ *
+ * @return NULL
+ */
+ public function setSession(Horde_Kolab_Session $session)
+ {
+ $this->_session = $session;
+ }
+
+ /**
+ * Retrieve a connected kolab session.
+ *
+ * @return Horde_Kolab_Session The connected session.
+ *
+ * @throws Horde_Kolab_Session_Exception
+ */
+ public function getSession()
+ {
+ if (!isset($this->_session)) {
+ $this->_session = Horde_Kolab_Session_Singleton::singleton();
+ }
+ return $this->_session;
+ }
+
+ /**
* Attempts to open a Kolab Groupware folder.
*/
public function initialize()
{
- $this->_kolab = new Kolab();
+ $this->_kolab = $this->getSession()->getStorage();
$this->reset();
}
}
// Connect to the Kolab backend
- $result = $this->_kolab->open($this->calendar, 1);
- if ($result instanceof PEAR_Error) {
- throw new Kronolith_Exception($result);
- }
- $this->_store = $this->_kolab->_storage;
+ $this->_store = $this->_kolab->getShareData($this->calendar, 'event');
// build internal event cache
$this->_events_cache = array();
$allevents = $this->listEvents($date, null, false, true);
$events = array();
- foreach ($allevents as $eventId) {
+ foreach ($allevents as $eventId => $data) {
$event = $this->getEvent($eventId);
if (!$event->recurs()) {
$start = new Horde_Date($event->start);
$this->synchronize(true);
if (is_callable('Kolab', 'triggerFreeBusyUpdate')) {
- Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($event->calendar));
+ //Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($event->calendar));
}
return $event->uid;
}
if (is_callable('Kolab', 'triggerFreeBusyUpdate')) {
- Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($this->calendar));
- Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($newCalendar));
+ //Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($this->calendar));
+ //Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($newCalendar));
}
return $event;
$result = $this->_store->deleteAll($calendar);
if (is_callable('Kolab', 'triggerFreeBusyUpdate')) {
- Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($calendar));
+ //Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($calendar));
}
}
$history->log('kronolith:' . $event->calendar . ':' . $event->uid, array('action' => 'delete'), true);
if (is_callable('Kolab', 'triggerFreeBusyUpdate')) {
- Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($event->calendar));
+ //Kolab::triggerFreeBusyUpdate($this->_store->parseFolder($event->calendar));
}
unset($this->_events_cache[$eventId]);