56 $this->usr_id = $a_usr_id;
97 $query =
"SELECT cal_id FROM cal_shared_status ".
98 "WHERE status = ".$ilDB->quote(self::STATUS_ACCEPTED ,
'integer').
" ".
99 "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;
180 $query =
"DELETE FROM cal_shared_status ".
181 "WHERE cal_id = ".$ilDB->quote($a_calendar_id ,
'integer').
" ".
182 "AND usr_id = ".$ilDB->quote($a_id ,
'integer').
" ";
188 $assigned_users = $rbacreview->assignedUsers($a_id);
190 if(!count($assigned_users))
195 $query =
"DELETE FROM cal_shared_status ".
196 "WHERE cal_id = ".$ilDB->quote($a_calendar_id ,
'integer').
" ".
197 "AND ".$ilDB->in(
'usr_id',$assigned_users,
false,
'integer');
220 $query =
"INSERT INTO cal_shared_status (cal_id,usr_id,status) ".
222 $this->db->quote($a_calendar_id ,
'integer').
", ".
223 $this->db->quote($this->usr_id ,
'integer').
", ".
224 $this->db->quote(self::STATUS_ACCEPTED ,
'integer').
" ".
246 $query =
"INSERT INTO cal_shared_status (cal_id,usr_id,status) ".
248 $this->db->quote($a_calendar_id ,
'integer').
", ".
249 $this->db->quote($this->usr_id ,
'integer').
", ".
250 $this->db->quote(self::STATUS_DECLINED ,
'integer').
" ".
270 $query =
"SELECT * FROM cal_shared_status ".
271 "WHERE usr_id = ".$this->db->quote($this->usr_id ,
'integer').
" ";
275 $this->calendars[
$row->cal_id] =
$row->status;