} else { $allResources = array(); } // Get the current Free/Busy view; default to the 'day' view if none specified. $view = Horde_Util::getFormData('view', 'Day'); // Pre-format our delete image/link. $delimg = Horde::img('delete.png', _("Remove Attendee")); $ident = $injector->getInstance('Horde_Core_Factory_Identity')->create(); $identities = $ident->getAll('id'); $vars = Horde_Variables::getDefaultVariables(); $tabs = new Horde_Core_Ui_Tabs(null, $vars); $tabs->addTab(_("Day"), new Horde_Url('javascript:switchView(\'Day\')'), 'Day'); $tabs->addTab(_("Work Week"), new Horde_Url('javascript:switchView(\'Workweek\')'), 'Workweek'); $tabs->addTab(_("Week"), new Horde_Url('javascript:switchView(\'Week\')'), 'Week'); $tabs->addTab(_("Month"), new Horde_Url('javascript:switchView(\'Month\')'), 'Month'); $attendee_view =& Kronolith_FreeBusy_View::singleton($view); // Add the creator as a required attendee in the Free/Busy display $cal = @unserialize($prefs->getValue('fb_cals')); if (!is_array($cal)) { $cal = null; } // If the free/busy calendars preference is empty, default to the user's // default_share preference, and if that's empty, to their username. if (!$cal) { $cal = 'internal_' . $prefs->getValue('default_share'); if (!$cal) { $cal = 'internal_' . $GLOBALS['registry']->getAuth(); } $cal = array($cal); } try {
} else { $url = Horde::url($prefs->getValue('defaultview') . '.php', true)->add('date', $start->dateString()); } // Make sure URL is unique. $url->unique()->redirect(); case 'clear': // Remove all the attendees and resources. $session->remove('kronolith', 'attendees'); $session->remove('kronolith', 'resources'); break; } // Pre-format our delete image/link. $delimg = Horde::img('delete.png', _("Remove Attendee")); $ident = $injector->getInstance('Horde_Core_Factory_Identity')->create(); $identities = $ident->getAll('id'); $fbView = Kronolith_FreeBusy_View::singleton($view); $fbOpts = array('start' => $start->datestamp(), 'end' => $end->datestamp()); try { $vfb = Kronolith_FreeBusy::getForUser($GLOBALS['registry']->getAuth(), $fbOpts); $fbView->addRequiredMember($vfb); } catch (Exception $e) { $notification->push(sprintf(_("Error retrieving your free/busy information: %s"), $e->getMessage())); } // Add the Free/Busy information for each attendee. foreach ($session->get('kronolith', 'attendees') as $attendee) { if ($attendee->role != Kronolith::PART_REQUIRED && $attendee->role != Kronolith::PART_OPTIONAL) { continue; } try { if ($attendee->user) { $vfb = Kronolith_Freebusy::getForUser($attendee->user, $fbOpts);