57 $this->usr_id = $a_usr_id;
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');
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') .
" " .
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') .
" " .
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'])
An exception for terminatinating execution or to throw for unit testing.
static _getAssignedAppointments($a_cat_id)
Get assigned apointments.
Stores calendar categories.
Stores status (accepted/declined) of shared calendars.
decline($a_calendar_id)
decline calendar
__construct($a_usr_id)
Constructor.
isAccepted($a_cal_id)
is accepted
isDeclined($a_cal_id)
is declined
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
getOpenInvitations()
Get open invitations.
accept($a_calendar_id)
accept calendar
static deleteUser($a_usr_id)
Delete by user.
static getAcceptedCalendars($a_usr_id)
get accepted shared calendars
static deleteCalendar($a_calendar_id)
Delete calendar.
static getSharedCalendarsForUser($a_usr_id=0)
get shared calendars of user
static _lookupType($a_id, $a_reference=false)
lookup object type
foreach($_POST as $key=> $value) $res