Stores status (accepted/declined) of shared calendars.
More...
Stores status (accepted/declined) of shared calendars.
- Author
- Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Definition at line 25 of file class.ilCalendarSharedStatus.php.
◆ __construct()
ilCalendarSharedStatus::__construct |
( |
int |
$a_usr_id | ) |
|
◆ accept()
ilCalendarSharedStatus::accept |
( |
int |
$a_calendar_id | ) |
|
Definition at line 133 of file class.ilCalendarSharedStatus.php.
References $res.
135 self::deleteStatus($this->usr_id, $a_calendar_id);
136 $query =
"INSERT INTO cal_shared_status (cal_id,usr_id,status) " .
138 $this->db->quote($a_calendar_id,
'integer') .
", " .
139 $this->db->quote($this->usr_id,
'integer') .
", " .
140 $this->db->quote(self::STATUS_ACCEPTED,
'integer') .
" " .
142 $res = $this->db->manipulate($query);
144 $this->calendars[$a_calendar_id] = self::STATUS_ACCEPTED;
◆ decline()
ilCalendarSharedStatus::decline |
( |
int |
$a_calendar_id | ) |
|
Definition at line 147 of file class.ilCalendarSharedStatus.php.
References $res.
149 self::deleteStatus($this->usr_id, $a_calendar_id);
150 $query =
"INSERT INTO cal_shared_status (cal_id,usr_id,status) " .
152 $this->db->quote($a_calendar_id,
'integer') .
", " .
153 $this->db->quote($this->usr_id,
'integer') .
", " .
154 $this->db->quote(self::STATUS_DECLINED,
'integer') .
" " .
156 $res = $this->db->manipulate($query);
157 $this->calendars[$a_calendar_id] = self::STATUS_DECLINED;
◆ deleteCalendar()
static ilCalendarSharedStatus::deleteCalendar |
( |
int |
$a_calendar_id | ) |
|
|
static |
◆ deleteStatus()
static ilCalendarSharedStatus::deleteStatus |
( |
int |
$a_id, |
|
|
int |
$a_calendar_id |
|
) |
| |
|
static |
Definition at line 107 of file class.ilCalendarSharedStatus.php.
References $DIC, $ilDB, $res, and ilObject\_lookupType().
Referenced by ilCalendarShared\stopSharing().
111 $ilDB = $DIC[
'ilDB'];
112 $rbacreview = $DIC[
'rbacreview'];
115 $query =
"DELETE FROM cal_shared_status " .
116 "WHERE cal_id = " .
$ilDB->quote($a_calendar_id,
'integer') .
" " .
117 "AND usr_id = " .
$ilDB->quote($a_id,
'integer') .
" ";
120 $assigned_users = $rbacreview->assignedUsers($a_id);
122 if (!count($assigned_users)) {
126 $query =
"DELETE FROM cal_shared_status " .
127 "WHERE cal_id = " .
$ilDB->quote($a_calendar_id,
'integer') .
" " .
128 "AND " .
$ilDB->in(
'usr_id', $assigned_users,
false,
'integer');
static _lookupType(int $id, bool $reference=false)
◆ deleteUser()
static ilCalendarSharedStatus::deleteUser |
( |
int |
$a_usr_id | ) |
|
|
static |
◆ getAcceptedCalendars()
static ilCalendarSharedStatus::getAcceptedCalendars |
( |
int |
$a_usr_id | ) |
|
|
static |
◆ getOpenInvitations()
ilCalendarSharedStatus::getOpenInvitations |
( |
| ) |
|
Definition at line 170 of file class.ilCalendarSharedStatus.php.
References $data, ilCalendarCategoryAssignments\_getAssignedAppointments(), ilCalendarShared\getSharedCalendarsForUser(), isAccepted(), and isDeclined().
Referenced by ilCalendarInboxSharedTableGUI\parse().
174 $invitations = array();
175 foreach ($shared as
$data) {
182 $invitations[] = array(
183 'cal_id' => (
int) $data[
'cal_id'],
184 'create_date' => $data[
'create_date'],
185 'obj_type' => $data[
'obj_type'],
186 'name' => $tmp_calendar->getTitle(),
187 'owner' => $tmp_calendar->getObjId(),
189 'accepted' => $this->
isAccepted((
int) $data[
'cal_id']),
190 'declined' => $this->
isDeclined((
int) $data[
'cal_id'])
Stores calendar categories.
isAccepted(int $a_cal_id)
static getSharedCalendarsForUser(int $a_usr_id=0)
static _getAssignedAppointments(array $a_cat_id)
Get assigned apointments.
isDeclined(int $a_cal_id)
◆ hasStatus()
static ilCalendarSharedStatus::hasStatus |
( |
int |
$a_usr_id, |
|
|
int |
$a_calendar_id |
|
) |
| |
|
static |
Definition at line 75 of file class.ilCalendarSharedStatus.php.
References $DIC, $ilDB, and $res.
80 $query =
"SELECT * FROM cal_shared_status " .
81 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
82 "AND cal_id = " .
$ilDB->quote($a_calendar_id,
'integer') .
" ";
84 return (
bool)
$res->numRows();
◆ isAccepted()
ilCalendarSharedStatus::isAccepted |
( |
int |
$a_cal_id | ) |
|
◆ isDeclined()
ilCalendarSharedStatus::isDeclined |
( |
int |
$a_cal_id | ) |
|
◆ read()
ilCalendarSharedStatus::read |
( |
| ) |
|
|
protected |
◆ $calendars
array ilCalendarSharedStatus::$calendars = array() |
|
private |
◆ $db
◆ $usr_id
int ilCalendarSharedStatus::$usr_id = 0 |
|
private |
◆ $writable
array ilCalendarSharedStatus::$writable = array() |
|
private |
◆ STATUS_ACCEPTED
const ilCalendarSharedStatus::STATUS_ACCEPTED = 1 |
◆ STATUS_DECLINED
const ilCalendarSharedStatus::STATUS_DECLINED = 2 |
◆ STATUS_DELETED
const ilCalendarSharedStatus::STATUS_DELETED = 3 |
The documentation for this class was generated from the following file: