ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilCalendarInboxGUI Class Reference
+ Collaboration diagram for ilCalendarInboxGUI:

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCalendarInboxGUI::__construct ( ilDate  $seed_date)

Constructor.

public

Parameters

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

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

61  {
62  global $ilCtrl, $lng, $ilUser,$ilTabs,$tpl;
63 
64  $this->seed = $seed_date;
65 
66  $this->tpl = $tpl;
67  $this->lng = $lng;
68  $this->ctrl = $ilCtrl;
69  $this->tabs_gui = $ilTabs;
70 
71  $this->user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
72  $this->app_colors = new ilCalendarAppointmentColors($ilUser->getId());
73 
74  $this->timezone = $ilUser->getTimeZone();
75  }
Set timezone
static _getInstanceByUserId($a_user_id)
get singleton instance
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

Member Function Documentation

◆ acceptShared()

ilCalendarInboxGUI::acceptShared ( )
protected

accept shared calendar

protected

Returns

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

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

171  {
172  global $ilUser;
173 
174  if(!$_POST['cal_ids'] or !is_array($_POST['cal_ids']))
175  {
176  ilUtil::sendFailure($this->lng->txt('select_one'));
177  $this->inbox();
178  return false;
179  }
180 
181  include_once('./Services/Calendar/classes/class.ilCalendarSharedStatus.php');
182  $status = new ilCalendarSharedStatus($ilUser->getId());
183 
184  include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
185  foreach($_POST['cal_ids'] as $calendar_id)
186  {
187  if(!ilCalendarShared::isSharedWithUser($ilUser->getId(),$calendar_id))
188  {
189  ilUtil::sendFailure($this->lng->txt('permission_denied'));
190  $this->inbox();
191  return false;
192  }
193  $status->accept($calendar_id);
194  }
195 
196  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
197  // redfirect for loading new calendar+
198  $this->ctrl->redirect($this,'inbox');
199  return true;
200  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Stores status (accepted/declined) of shared calendars.
$ilUser
Definition: imgupload.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
static isSharedWithUser($a_usr_id, $a_calendar_id)
is shared with user
+ Here is the call graph for this function:

◆ declineShared()

ilCalendarInboxGUI::declineShared ( )
protected

accept shared calendar

protected

Returns

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

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

209  {
210  global $ilUser;
211 
212  if(!$_POST['cal_ids'] or !is_array($_POST['cal_ids']))
213  {
214  ilUtil::sendFailure($this->lng->txt('select_one'));
215  $this->inbox();
216  return false;
217  }
218 
219  include_once('./Services/Calendar/classes/class.ilCalendarSharedStatus.php');
220  $status = new ilCalendarSharedStatus($ilUser->getId());
221 
222  include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
223  foreach($_POST['cal_ids'] as $calendar_id)
224  {
225  if(!ilCalendarShared::isSharedWithUser($ilUser->getId(),$calendar_id))
226  {
227  ilUtil::sendFailure($this->lng->txt('permission_denied'));
228  $this->inbox();
229  return false;
230  }
231  $status->decline($calendar_id);
232  }
233 
234  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
235  $this->inbox();
236  return true;
237  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Stores status (accepted/declined) of shared calendars.
$ilUser
Definition: imgupload.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
static isSharedWithUser($a_usr_id, $a_calendar_id)
is shared with user
+ Here is the call graph for this function:

◆ executeCommand()

ilCalendarInboxGUI::executeCommand ( )

Execute command.

public

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

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

84  {
85  global $ilCtrl,$tpl;
86 
87  $next_class = $ilCtrl->getNextClass();
88  switch($next_class)
89  {
90  case 'ilcalendarappointmentgui':
91  $this->ctrl->setReturn($this,'');
92  $this->tabs_gui->setSubTabActive($_SESSION['cal_last_tab']);
93 
94  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
95  $app = new ilCalendarAppointmentGUI($this->seed,$this->seed, (int) $_GET['app_id']);
96  $this->ctrl->forwardCommand($app);
97  break;
98 
99  default:
100  $cmd = $this->ctrl->getCmd("inbox");
101  $this->$cmd();
102  $tpl->setContent($this->tpl->get());
103  break;
104  }
105 
106  return true;
107  }
$_SESSION["AccountId"]
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
Administrate calendar appointments.

◆ inbox()

ilCalendarInboxGUI::inbox ( )
protected

show inbox

protected

Returns

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

References $_GET, $ilCtrl, $title, ilCalendarShared\getSharedCalendarsForUser(), IL_CAL_UNIX, time, and ilCalendarSchedule\TYPE_INBOX.

Referenced by acceptShared(), and declineShared().

116  {
117  global $ilCtrl;
118 
119  $this->tpl = new ilTemplate('tpl.inbox.html',true,true,'Services/Calendar');
120 
121 
122  include_once('./Services/Calendar/classes/class.ilCalendarInboxSharedTableGUI.php');
123  include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
124 
125  $table = new ilCalendarInboxSharedTableGUI($this,'inbox');
126  $table->setCalendars(ilCalendarShared::getSharedCalendarsForUser());
127 
128  if($table->parse())
129  {
130  $this->tpl->setVariable('SHARED_CAL_TABLE',$table->getHTML());
131  }
132 
133  include_once('./Services/Calendar/classes/class.ilCalendarChangedAppointmentsTableGUI.php');
134 
135  $table_gui = new ilCalendarChangedAppointmentsTableGUI($this,'inbox');
136 
138  $schedule->setEventsLimit($table_gui->getLimit());
139  $schedule->addSubitemCalendars(true);
140  $schedule->calculate();
141 
142  if(isset($_GET['changed']))
143  {
144  $title = $this->lng->txt('cal_changed_events_header');
145  $events = $schedule->getChangedEvents(true);
146 
147  $ilCtrl->setParameter($this, 'changed', 1);
148  }
149  else
150  {
151  // type inbox will show upcoming events (today or later)
152  $title = $this->lng->txt('cal_upcoming_events_header');
153  //$events = $schedule->getEvents();
154  $events = $schedule->getScheduledEvents();
155  }
156 
157  $table_gui->setTitle($title);
158  $table_gui->setAppointments($events);
159 
160  $this->tpl->setVariable('CHANGED_TABLE',$table_gui->getHTML());
161 
162  }
static getSharedCalendarsForUser($a_usr_id=0)
get shared calendars of user
$_GET["client_id"]
const IL_CAL_UNIX
global $ilCtrl
Definition: ilias.php:18
Show shared calendars for a specific user.
Class for single dates.
special template class to simplify handling of ITX/PEAR
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
Represents a list of calendar appointments (including recurring events) for a specific user in a give...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCalendarInboxGUI::$ctrl
protected

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

◆ $lng

ilCalendarInboxGUI::$lng
protected

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

Referenced by __construct().

◆ $seed

ilCalendarInboxGUI::$seed = null
protected

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

◆ $tabs_gui

ilCalendarInboxGUI::$tabs_gui
protected

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

◆ $timezone

ilCalendarInboxGUI::$timezone = 'UTC'
protected

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

◆ $tpl

ilCalendarInboxGUI::$tpl
protected

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

Referenced by __construct(), and executeCommand().

◆ $user_settings

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: