58 $this->event_id = $a_event_id;
68 $this->event_id = $a_event_id;
77 return $this->items ? $this->items : array();
81 $this->items = array();
82 foreach ($a_items as $item_id) {
83 $this->items[] = (int) $item_id;
95 $this->items[] = (int) $a_item_ref_id;
99 public function delete()
108 $ilDB = $DIC[
'ilDB'];
110 $query =
"DELETE FROM event_items " .
111 "WHERE event_id = " .
$ilDB->quote($a_event_id,
'integer') .
" ";
123 $query =
"DELETE FROM event_items WHERE " . $this->db->in(
'item_id', $a_items,
false,
'integer') .
124 " AND event_id = " . $this->db->quote($this->event_id,
'integer');
135 $ilDB = $DIC[
'ilDB'];
139 foreach ($this->items as $item) {
140 $query =
"INSERT INTO event_items (event_id,item_id) " .
143 $ilDB->quote($item,
'integer') .
" " .
154 $ilDB = $DIC[
'ilDB'];
155 $tree = $DIC[
'tree'];
157 $session_nodes =
$tree->getChildsByType($a_ref_id,
'sess');
159 foreach ($session_nodes as $node) {
160 $session_ids[] = $node[
'obj_id'];
162 $query =
"SELECT item_id FROM event_items " .
163 "WHERE " .
$ilDB->in(
'event_id', $session_ids,
false,
'integer');
185 $ilDB = $DIC[
'ilDB'];
187 $query =
"SELECT * FROM event_items " .
188 "WHERE event_id = " .
$ilDB->quote($a_event_id,
'integer');
200 $ilDB = $DIC[
'ilDB'];
202 $query =
"SELECT * FROM event_items " .
203 "WHERE item_id = " .
$ilDB->quote($a_item_id,
'integer') .
" ";
206 return $res->numRows() ? true :
false;
217 $db = $DIC->database();
218 $query =
'SELECT e.event_id,e_start FROM event_items e ' .
219 'JOIN event_appointment ea ON e.event_id = ea.event_id ' .
220 'WHERE item_id = ' . $db->quote($item_ref_id,
'integer') .
' ' .
221 'ORDER BY (e_start)';
245 $ilObjDataCache = $DIC[
'ilObjDataCache'];
246 $ilLog = $DIC->logger()->sess();
248 $ilLog->debug(
'Begin cloning session materials ...');
250 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
252 $mappings = $cwo->getMappings();
254 $new_items = array();
256 if (isset($mappings[$item_id])
and $mappings[$item_id]) {
257 $ilLog->debug(
'Clone session material nr. ' . $item_id);
258 $new_items[] = $mappings[$item_id];
260 $ilLog->debug(
'No mapping found for session material nr. ' . $item_id);
265 $ilLog->debug(
'Finished cloning session materials ...');
275 $ilDB = $DIC[
'ilDB'];
276 $tree = $DIC[
'tree'];
278 $query =
"SELECT * FROM event_items " .
279 "WHERE event_id = " .
$ilDB->quote($this->
getEventId(),
'integer') .
" ";
282 $this->items = array();
288 $query =
"DELETE FROM event_items " .
289 "WHERE item_id = " .
$ilDB->quote(
$row->item_id,
'integer');
294 $this->items[] = (int)
$row->item_id;
getItems()
get assigned items
removeItems($a_items)
Remove specific items from the DB.
static _getItemsOfContainer($a_ref_id)
static getEventsForItemOrderedByStartingTime($item_ref_id)
cloneItems($a_source_id, $a_copy_id)
Clone items.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
foreach($_POST as $key=> $value) $res
static _getItemsOfEvent($a_event_id)
Get items by event.
addItem($a_item_ref_id)
Add one item.
static _delete($a_event_id)