56 $this->usr_id = $a_usr_id;
97 $query =
"SELECT cal_id FROM cal_shared_status ".
98 "WHERE status = ".$ilDB->quote(self::STATUS_ACCEPTED).
" ".
99 "AND usr_id = ".$ilDB->quote($a_usr_id).
" ";
100 $res = $ilDB->query($query);
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).
" ".
123 "AND cal_id = ".$ilDB->quote($a_calendar_id).
" ";
124 $res = $ilDB->query($query);
125 return $res->numRows() ?
true :
false;
140 $query =
"DELETE FROM cal_shared_status ".
141 "WHERE usr_id = ".$ilDB->quote($a_usr_id).
" ";
142 $ilDB->query($query);
158 $query =
"DELETE FROM cal_shared_status ".
159 "WHERE cal_id = ".$ilDB->quote($a_calendar_id).
" ";
160 $ilDB->query($query);
175 global $ilDB,$rbacreview;
180 $query =
"DELETE FROM cal_shared_status ".
181 "WHERE cal_id = ".$ilDB->quote($a_calendar_id).
" ".
182 "AND usr_id = ".$ilDB->quote($a_id).
" ";
183 $ilDB->query($query);
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).
" ".
198 $ilDB->query($query);
218 $query =
"INSERT INTO cal_shared_status ".
219 "SET cal_id = ".$this->db->quote($a_calendar_id).
", ".
220 "usr_id = ".$this->db->quote($this->usr_id).
", ".
221 "status = ".$this->db->quote(self::STATUS_ACCEPTED).
" ";
222 $this->db->query($query);
240 $query =
"INSERT INTO cal_shared_status ".
241 "SET cal_id = ".$this->db->quote($a_calendar_id).
", ".
242 "usr_id = ".$this->db->quote($this->usr_id).
", ".
243 "status = ".$this->db->quote(self::STATUS_DECLINED).
" ";
244 $this->db->query($query);
260 $query =
"SELECT * FROM cal_shared_status ".
261 "WHERE usr_id = ".$this->db->quote($this->usr_id).
" ";
262 $res = $this->db->query($query);
265 $this->calendars[$row->cal_id] = $row->status;