ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarInboxGUI Class Reference
+ Collaboration diagram for ilCalendarInboxGUI:

Public Member Functions

 __construct (ilDate $seed_date)
 Constructor.
 executeCommand ()
 Execute command.

Protected Member Functions

 inbox ()
 show inbox
 acceptShared ()
 accept shared calendar
 declineShared ()
 accept shared calendar

Protected Attributes

 $seed = null
 $user_settings = null
 $lng
 $ctrl
 $tabs_gui
 $tpl
 $timezone = 'UTC'

Detailed Description

Constructor & Destructor Documentation

ilCalendarInboxGUI::__construct ( ilDate  $seed_date)

Constructor.

public

Parameters

Definition at line 60 of file class.ilCalendarInboxGUI.php.

References $ilCtrl, $lng, $tpl, and ilCalendarUserSettings\_getInstanceByUserId().

{
global $ilCtrl, $lng, $ilUser,$ilTabs,$tpl;
$this->seed = $seed_date;
$this->tpl = $tpl;
$this->lng = $lng;
$this->ctrl = $ilCtrl;
$this->tabs_gui = $ilTabs;
$this->user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
$this->app_colors = new ilCalendarAppointmentColors($ilUser->getId());
$this->timezone = $ilUser->getTimeZone();
}

+ Here is the call graph for this function:

Member Function Documentation

ilCalendarInboxGUI::acceptShared ( )
protected

accept shared calendar

protected

Returns

Definition at line 149 of file class.ilCalendarInboxGUI.php.

References $_POST, inbox(), ilCalendarShared\isSharedWithUser(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilUser;
if(!$_POST['cal_ids'] or !is_array($_POST['cal_ids']))
{
ilUtil::sendFailure($this->lng->txt('select_one'));
$this->inbox();
return false;
}
include_once('./Services/Calendar/classes/class.ilCalendarSharedStatus.php');
$status = new ilCalendarSharedStatus($ilUser->getId());
include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
foreach($_POST['cal_ids'] as $calendar_id)
{
if(!ilCalendarShared::isSharedWithUser($ilUser->getId(),$calendar_id))
{
ilUtil::sendFailure($this->lng->txt('permission_denied'));
$this->inbox();
return false;
}
$status->accept($calendar_id);
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
// redfirect for loading new calendar+
$this->ctrl->redirect($this,'inbox');
return true;
}

+ Here is the call graph for this function:

ilCalendarInboxGUI::declineShared ( )
protected

accept shared calendar

protected

Returns

Definition at line 187 of file class.ilCalendarInboxGUI.php.

References $_POST, inbox(), ilCalendarShared\isSharedWithUser(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilUser;
if(!$_POST['cal_ids'] or !is_array($_POST['cal_ids']))
{
ilUtil::sendFailure($this->lng->txt('select_one'));
$this->inbox();
return false;
}
include_once('./Services/Calendar/classes/class.ilCalendarSharedStatus.php');
$status = new ilCalendarSharedStatus($ilUser->getId());
include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
foreach($_POST['cal_ids'] as $calendar_id)
{
if(!ilCalendarShared::isSharedWithUser($ilUser->getId(),$calendar_id))
{
ilUtil::sendFailure($this->lng->txt('permission_denied'));
$this->inbox();
return false;
}
$status->decline($calendar_id);
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->inbox();
return true;
}

+ Here is the call graph for this function:

ilCalendarInboxGUI::executeCommand ( )

Execute command.

public

Definition at line 83 of file class.ilCalendarInboxGUI.php.

References $_GET, $_SESSION, $cmd, $ilCtrl, and $tpl.

{
global $ilCtrl,$tpl;
$next_class = $ilCtrl->getNextClass();
switch($next_class)
{
case 'ilcalendarappointmentgui':
$this->ctrl->setReturn($this,'');
$this->tabs_gui->setSubTabActive($_SESSION['cal_last_tab']);
include_once('./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
$app = new ilCalendarAppointmentGUI($this->seed,(int) $_GET['app_id']);
$this->ctrl->forwardCommand($app);
break;
default:
$cmd = $this->ctrl->getCmd("inbox");
$this->$cmd();
$tpl->setContent($this->tpl->get());
break;
}
return true;
}
ilCalendarInboxGUI::inbox ( )
protected

show inbox

protected

Returns

Definition at line 115 of file class.ilCalendarInboxGUI.php.

References ilCalendarShared\getSharedCalendarsForUser(), and ilCalendarSchedule\TYPE_INBOX.

Referenced by acceptShared(), and declineShared().

{
$this->tpl = new ilTemplate('tpl.inbox.html',true,true,'Services/Calendar');
include_once('./Services/Calendar/classes/class.ilCalendarInboxSharedTableGUI.php');
include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
$table = new ilCalendarInboxSharedTableGUI($this,'inbox');
if($table->parse())
{
$this->tpl->setVariable('SHARED_CAL_TABLE',$table->getHTML());
}
$schedule = new ilCalendarSchedule($this->seed,ilCalendarSchedule::TYPE_INBOX);
$events = $schedule->getChangedEvents(true);
include_once('./Services/Calendar/classes/class.ilCalendarChangedAppointmentsTableGUI.php');
$table_gui = new ilCalendarChangedAppointmentsTableGUI($this,'inbox');
$table_gui->setTitle($this->lng->txt('cal_changed_events_header'));
$table_gui->setAppointments($events);
$this->tpl->setVariable('CHANGED_TABLE',$table_gui->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilCalendarInboxGUI::$ctrl
protected

Definition at line 47 of file class.ilCalendarInboxGUI.php.

ilCalendarInboxGUI::$lng
protected

Definition at line 46 of file class.ilCalendarInboxGUI.php.

Referenced by __construct().

ilCalendarInboxGUI::$seed = null
protected

Definition at line 43 of file class.ilCalendarInboxGUI.php.

ilCalendarInboxGUI::$tabs_gui
protected

Definition at line 48 of file class.ilCalendarInboxGUI.php.

ilCalendarInboxGUI::$timezone = 'UTC'
protected

Definition at line 51 of file class.ilCalendarInboxGUI.php.

ilCalendarInboxGUI::$tpl
protected

Definition at line 49 of file class.ilCalendarInboxGUI.php.

Referenced by __construct(), and executeCommand().

ilCalendarInboxGUI::$user_settings = null
protected

Definition at line 44 of file class.ilCalendarInboxGUI.php.


The documentation for this class was generated from the following file: