From 7ac69a8d7cadb211b89821e39011447d04ff0590 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Wed, 9 Sep 2009 15:10:56 -0400 Subject: [PATCH] Experiment with getting either a share or resource here --- kronolith/edit.php | 7 ++++--- kronolith/lib/Kronolith.php | 12 ++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/kronolith/edit.php b/kronolith/edit.php index 5bc72cc13..4f2e4d6c6 100644 --- a/kronolith/edit.php +++ b/kronolith/edit.php @@ -43,7 +43,8 @@ $kronolith_driver = Kronolith::getDriver(); if ($exception = Horde_Util::getFormData('del_exception')) { $calendar = Horde_Util::getFormData('calendar'); - $share = &$kronolith_shares->getShare($calendar); + //$share = &$kronolith_shares->getShare($calendar); + $share = Kronolith::getInternalCalendar($calendar); if (is_a($share, 'PEAR_Error')) { $notification->push(sprintf(_("There was an error accessing the calendar: %s"), $share->getMessage()), 'horde.error'); } else { @@ -64,8 +65,8 @@ if ($exception = Horde_Util::getFormData('del_exception')) { $target = $targetcalendar; $user = Horde_Auth::getAuth(); } - $share = &$kronolith_shares->getShare($target); - + //$share = &$kronolith_shares->getShare($target); + $share = Kronolith::getInternalCalendar($target); if (is_a($share, 'PEAR_Error')) { $notification->push(sprintf(_("There was an error accessing the calendar: %s"), $share->getMessage()), 'horde.error'); } else { diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index d8efff968..f099b0ea6 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -2055,4 +2055,16 @@ class Kronolith return false; } + + static public function getInternalCalendar($target) + { + if (self::isResourceCalendar($taget)) { + $driver = self::getDriver('Resource'); + $id = $driver->getResourceIdByCalendar($id); + return $driver->getResoruce($id); + } else { + return $GLOBALS['kronolith_shares']->getShare($target); + } + } + } -- 2.11.0