59 $this->usr_id = $a_usr_id;
74 return isset($this->calendars[$a_cal_id])
and $this->calendars[$a_cal_id] == self::STATUS_ACCEPTED;
86 return isset($this->calendars[$a_cal_id])
and $this->calendars[$a_cal_id] == self::STATUS_DECLINED;
100 $ilDB = $DIC[
'ilDB'];
102 $query =
"SELECT cal_id FROM cal_shared_status " .
103 "WHERE status = " .
$ilDB->quote(self::STATUS_ACCEPTED,
'integer') .
" " .
104 "AND usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" ";
107 $cal_ids[] =
$row->cal_id;
109 return $cal_ids ? $cal_ids : array();
121 public static function hasStatus($a_usr_id, $a_calendar_id)
125 $ilDB = $DIC[
'ilDB'];
127 $query =
"SELECT * FROM cal_shared_status " .
128 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
129 "AND cal_id = " .
$ilDB->quote($a_calendar_id,
'integer') .
" ";
131 return $res->numRows() ? true :
false;
147 $ilDB = $DIC[
'ilDB'];
149 $query =
"DELETE FROM cal_shared_status " .
150 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" ";
167 $ilDB = $DIC[
'ilDB'];
169 $query =
"DELETE FROM cal_shared_status " .
170 "WHERE cal_id = " .
$ilDB->quote($a_calendar_id,
'integer') .
" ";
188 $ilDB = $DIC[
'ilDB'];
189 $rbacreview = $DIC[
'rbacreview'];
193 $query =
"DELETE FROM cal_shared_status " .
194 "WHERE cal_id = " .
$ilDB->quote($a_calendar_id,
'integer') .
" " .
195 "AND usr_id = " .
$ilDB->quote($a_id,
'integer') .
" ";
198 $assigned_users = $rbacreview->assignedUsers($a_id);
200 if (!count($assigned_users)) {
204 $query =
"DELETE FROM cal_shared_status " .
205 "WHERE cal_id = " .
$ilDB->quote($a_calendar_id,
'integer') .
" " .
206 "AND " .
$ilDB->in(
'usr_id', $assigned_users,
false,
'integer');
226 $ilDB = $DIC[
'ilDB'];
228 self::deleteStatus($this->usr_id, $a_calendar_id);
230 $query =
"INSERT INTO cal_shared_status (cal_id,usr_id,status) " .
232 $this->db->quote($a_calendar_id,
'integer') .
", " .
233 $this->db->quote($this->usr_id,
'integer') .
", " .
234 $this->db->quote(self::STATUS_ACCEPTED,
'integer') .
" " .
238 $this->calendars[$a_calendar_id] = self::STATUS_ACCEPTED;
254 $ilDB = $DIC[
'ilDB'];
256 self::deleteStatus($this->usr_id, $a_calendar_id);
258 $query =
"INSERT INTO cal_shared_status (cal_id,usr_id,status) " .
260 $this->db->quote($a_calendar_id,
'integer') .
", " .
261 $this->db->quote($this->usr_id,
'integer') .
", " .
262 $this->db->quote(self::STATUS_DECLINED,
'integer') .
" " .
266 $this->calendars[$a_calendar_id] = self::STATUS_DECLINED;
281 $ilDB = $DIC[
'ilDB'];
283 $query =
"SELECT * FROM cal_shared_status " .
284 "WHERE usr_id = " . $this->db->quote($this->usr_id,
'integer') .
" ";
287 $this->calendars[
$row->cal_id] =
$row->status;
298 include_once(
'./Services/Calendar/classes/class.ilCalendarShared.php');
301 $invitations = array();
303 foreach ($shared as
$data) {
310 $invitations[] = array(
311 'cal_id' => $data[
'cal_id'],
312 'create_date' => $data[
'create_date'],
313 'obj_type' => $data[
'obj_type'],
314 'name' => $tmp_calendar->getTitle(),
315 'owner' => $tmp_calendar->getObjId(),
317 'accepted' => $this->
isAccepted($data[
'cal_id']),
318 'declined' => $this->
isDeclined($data[
'cal_id'])
decline($a_calendar_id)
decline calendar
static getAcceptedCalendars($a_usr_id)
get accepted shared calendars
static getSharedCalendarsForUser($a_usr_id=0)
get shared calendars of user
static deleteCalendar($a_calendar_id)
Delete calendar.
Stores status (accepted/declined) of shared calendars.
Stores calendar categories.
__construct($a_usr_id)
Constructor.
foreach($_POST as $key=> $value) $res
static deleteUser($a_usr_id)
Delete by user.
accept($a_calendar_id)
accept calendar
isDeclined($a_cal_id)
is declined
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getAssignedAppointments($a_cat_id)
Get assigned apointments.
getOpenInvitations()
Get open invitations.
isAccepted($a_cal_id)
is accepted
static deleteStatus($a_id, $a_calendar_id)
delete status
static hasStatus($a_usr_id, $a_calendar_id)
check if a status is set for an calendar