50 $this->cal_entry_id = $a_cal_entry_id;
67 $query =
"SELECT cat_id FROM cal_cat_assignments " .
68 "WHERE cal_id = " . $ilDB->quote($a_cal_id,
'integer') .
" ";
71 $cat_ids[] =
$row->cat_id;
73 return $cat_ids ? $cat_ids :
array();
86 if (count($cats = self::_lookupCategories($a_cal_id))) {
103 $query =
"SELECT * FROM cal_cat_assignments " .
104 "WHERE " . $ilDB->in(
'cal_id', $a_cal_ids,
false,
'integer');
109 return $map ? $map :
array();
123 $query =
"SELECT * FROM cal_cat_assignments " .
124 "WHERE " . $ilDB->in(
'cat_id', $a_cat_id,
false,
'integer');
128 $cal_ids[] =
$row->cal_id;
130 return $cal_ids ? $cal_ids :
array();
141 $query =
'SELECT COUNT(*) num FROM cal_cat_assignments ' .
142 'WHERE ' . $ilDB->in(
'cat_id', $a_cat_ids,
false,
'integer');
162 $query =
"SELECT ce.cal_id FROM cal_categories cc " .
163 "JOIN cal_cat_assignments cca ON cc.cat_id = cca.cat_id " .
164 "JOIN cal_entries ce ON cca.cal_id = ce.cal_id " .
165 "WHERE auto_generated = 1 " .
166 "AND obj_id = " . $ilDB->quote($a_obj_id,
'integer') .
" ";
169 $apps[] =
$row->cal_id;
171 return $apps ? $apps :
array();
185 $query =
"DELETE FROM cal_cat_assignments " .
186 "WHERE cal_id = " . $ilDB->quote($a_app_id,
'integer') .
" ";
204 $query =
"DELETE FROM cal_cat_assignments " .
205 "WHERE cat_id = " . $ilDB->quote($a_cat_id,
'integer') .
" ";
218 return isset($this->assignments[0]) ? $this->assignments[0] :
false;
229 return $this->assignments ? $this->assignments :
array();
243 $query =
"INSERT INTO cal_cat_assignments (cal_id,cat_id) " .
245 $this->db->quote($this->cal_entry_id,
'integer') .
", " .
246 $this->db->quote($a_cal_cat_id,
'integer') .
" " .
249 $this->assignments[] = (int) $a_cal_cat_id;
265 $query =
"DELETE FROM cal_cat_assignments " .
266 "WHERE cal_id = " . $this->db->quote($this->cal_entry_id,
'integer') .
", " .
267 "AND cat_id = " . $this->db->quote($a_cat_id,
'integer') .
" ";
270 if ((
$key = array_search($a_cat_id, $this->assignments)) !==
false) {
271 unset($this->assignments[
$key]);
285 $query =
"DELETE FROM cal_cat_assignments " .
286 "WHERE cal_id = " . $this->db->quote($this->cal_entry_id,
'integer') .
" ";
302 $query =
"SELECT * FROM cal_cat_assignments " .
303 "WHERE cal_id = " . $this->db->quote($this->cal_entry_id,
'integer') .
" ";
307 $this->assignments[] =
$row->cat_id;
__construct($a_cal_entry_id)
Constructor.
static _lookupCategory($a_cal_id)
Lookup category id.
getAssignments()
get assignments
static lookupNumberOfAssignedAppointments($a_cat_ids)
Get number of assigned appoitments.
static _lookupCategories($a_cal_id)
lookup categories
deleteAssignments()
delete assignments
foreach($_POST as $key=> $value) $res
static _getAutoGeneratedAppointmentsByObjId($a_obj_id)
get automatic generated appointments of category
deleteAssignment($a_cat_id)
delete assignment
static _deleteByAppointmentId($a_app_id)
Delete appointment assignment.
Create styles array
The data for the language used.
static _deleteByCategoryId($a_cat_id)
Delete assignments by category id.
addAssignment($a_cal_cat_id)
add assignment
static _getAssignedAppointments($a_cat_id)
Get assigned apointments.
getFirstAssignment()
get first assignment
static _getAppointmentCalendars($a_cal_ids)
lookup calendars for appointment ids