Copyright 2003-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information.
Author: Mike Cochrane (mike@graftonhall.co.nz)
Author: Jan Schneider (jan@horde.org)
示例#1
0
} 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 {
示例#2
0
文件: View.php 项目: horde/horde
 /**
  * Attempts to return a reference to a concrete Kronolith_FreeBusy_View
  * instance based on $view.  It will only create a new instance if no
  * Kronolith_FreeBusy_View instance with the same parameters currently
  * exists.
  *
  * This method must be invoked as:
  * $var = &Kronolith_FreeBusy_View::singleton()
  *
  * @param string $view  The type of concrete Kronolith_FreeBusy_View
  *                      subclass to return.
  *
  * @return mixed  The created concrete Kronolith_FreeBusy_View instance, or
  *                false on an error.
  */
 public static function &singleton($view)
 {
     static $instances = array();
     if (!isset($instances[$view])) {
         $instances[$view] = Kronolith_FreeBusy_View::factory($view);
     }
     return $instances[$view];
 }
示例#3
0
文件: attendees.php 项目: horde/horde
        } 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);