57 $this->usr_id = $a_usr_id;
72 return isset($this->calendars[$a_cal_id]) and $this->calendars[$a_cal_id] == self::STATUS_ACCEPTED;
84 return isset($this->calendars[$a_cal_id]) and $this->calendars[$a_cal_id] == self::STATUS_DECLINED;
98 $query =
"SELECT cal_id FROM cal_shared_status " .
99 "WHERE status = " . $ilDB->quote(self::STATUS_ACCEPTED,
'integer') .
" " .
100 "AND usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" ";
103 $cal_ids[] =
$row->cal_id;
105 return $cal_ids ? $cal_ids :
array();
117 public static function hasStatus($a_usr_id, $a_calendar_id)
121 $query =
"SELECT * FROM cal_shared_status " .
122 "WHERE usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" " .
123 "AND cal_id = " . $ilDB->quote($a_calendar_id,
'integer') .
" ";
125 return $res->numRows() ? true :
false;
140 $query =
"DELETE FROM cal_shared_status " .
141 "WHERE usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" ";
158 $query =
"DELETE FROM cal_shared_status " .
159 "WHERE cal_id = " . $ilDB->quote($a_calendar_id,
'integer') .
" ";
175 global
$ilDB,$rbacreview;
179 $query =
"DELETE FROM cal_shared_status " .
180 "WHERE cal_id = " . $ilDB->quote($a_calendar_id,
'integer') .
" " .
181 "AND usr_id = " . $ilDB->quote($a_id,
'integer') .
" ";
184 $assigned_users = $rbacreview->assignedUsers($a_id);
186 if (!count($assigned_users)) {
190 $query =
"DELETE FROM cal_shared_status " .
191 "WHERE cal_id = " . $ilDB->quote($a_calendar_id,
'integer') .
" " .
192 "AND " . $ilDB->in(
'usr_id', $assigned_users,
false,
'integer');
212 self::deleteStatus($this->usr_id, $a_calendar_id);
214 $query =
"INSERT INTO cal_shared_status (cal_id,usr_id,status) " .
216 $this->db->quote($a_calendar_id,
'integer') .
", " .
217 $this->db->quote($this->usr_id,
'integer') .
", " .
218 $this->db->quote(self::STATUS_ACCEPTED,
'integer') .
" " .
222 $this->calendars[$a_calendar_id] = self::STATUS_ACCEPTED;
238 self::deleteStatus($this->usr_id, $a_calendar_id);
240 $query =
"INSERT INTO cal_shared_status (cal_id,usr_id,status) " .
242 $this->db->quote($a_calendar_id,
'integer') .
", " .
243 $this->db->quote($this->usr_id,
'integer') .
", " .
244 $this->db->quote(self::STATUS_DECLINED,
'integer') .
" " .
248 $this->calendars[$a_calendar_id] = self::STATUS_DECLINED;
263 $query =
"SELECT * FROM cal_shared_status " .
264 "WHERE usr_id = " . $this->db->quote($this->usr_id,
'integer') .
" ";
267 $this->calendars[
$row->cal_id] =
$row->status;
278 include_once(
'./Services/Calendar/classes/class.ilCalendarShared.php');
281 $invitations =
array();
283 foreach ($shared as
$data) {
290 $invitations[] =
array(
291 'cal_id' => $data[
'cal_id'],
292 'create_date' => $data[
'create_date'],
293 'obj_type' => $data[
'obj_type'],
294 'name' => $tmp_calendar->getTitle(),
295 'owner' => $tmp_calendar->getObjId(),
297 'accepted' => $this->
isAccepted($data[
'cal_id']),
298 '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
Create styles array
The data for the language used.
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