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').
" ";
104 $cal_ids[] =
$row->cal_id;
106 return $cal_ids ? $cal_ids : array();
118 public static function hasStatus($a_usr_id,$a_calendar_id)
122 $query =
"SELECT * FROM cal_shared_status ".
123 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ".
124 "AND cal_id = ".$ilDB->quote($a_calendar_id ,
'integer').
" ";
126 return $res->numRows() ?
true :
false;
141 $query =
"DELETE FROM cal_shared_status ".
142 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ";
159 $query =
"DELETE FROM cal_shared_status ".
160 "WHERE cal_id = ".$ilDB->quote($a_calendar_id ,
'integer').
" ";
176 global
$ilDB,$rbacreview;
181 $query =
"DELETE FROM cal_shared_status ".
182 "WHERE cal_id = ".$ilDB->quote($a_calendar_id ,
'integer').
" ".
183 "AND usr_id = ".$ilDB->quote($a_id ,
'integer').
" ";
189 $assigned_users = $rbacreview->assignedUsers($a_id);
191 if(!count($assigned_users))
196 $query =
"DELETE FROM cal_shared_status ".
197 "WHERE cal_id = ".$ilDB->quote($a_calendar_id ,
'integer').
" ".
198 "AND ".$ilDB->in(
'usr_id',$assigned_users,
false,
'integer');
221 $query =
"INSERT INTO cal_shared_status (cal_id,usr_id,status) ".
223 $this->db->quote($a_calendar_id ,
'integer').
", ".
224 $this->db->quote($this->usr_id ,
'integer').
", ".
225 $this->db->quote(self::STATUS_ACCEPTED ,
'integer').
" ".
247 $query =
"INSERT INTO cal_shared_status (cal_id,usr_id,status) ".
249 $this->db->quote($a_calendar_id ,
'integer').
", ".
250 $this->db->quote($this->usr_id ,
'integer').
", ".
251 $this->db->quote(self::STATUS_DECLINED ,
'integer').
" ".
271 $query =
"SELECT * FROM cal_shared_status ".
272 "WHERE usr_id = ".$this->db->quote($this->usr_id ,
'integer').
" ";
276 $this->calendars[
$row->cal_id] =
$row->status;