4 require_once
"./classes/class.ilObject.php";
27 $this->
ilObject($a_id,$a_call_by_reference);
41 $ilDB->manipulate(
'INSERT INTO booking_settings (booking_pool_id)'.
42 ' VALUES ('.$ilDB->quote($new_id,
'integer').
')');
55 if (!parent::update())
63 $ilDB->manipulate(
'UPDATE booking_settings'.
64 ' SET pool_offline = '.$ilDB->quote($this->isOffline(),
'integer').
65 ', public_log = '.$ilDB->quote($this->hasPublicLog(),
'integer').
66 ', slots_no = '.$ilDB->quote($this->getNumberOfSlots(),
'integer').
67 ' WHERE booking_pool_id = '.$ilDB->quote($this->getId(),
'integer'));
82 $set = $ilDB->query(
'SELECT * FROM booking_settings'.
83 ' WHERE booking_pool_id = '.$ilDB->quote($this->getId(),
'integer'));
84 $row = $ilDB->fetchAssoc($set);
102 if (!parent::delete())
109 $ilDB->manipulate(
'DELETE FROM booking_settings'.
110 ' WHERE booking_pool_id = '.$ilDB->quote(
$id,
'integer'));
112 $ilDB->manipulate(
'DELETE FROM booking_schedule'.
113 ' WHERE pool_id = '.$ilDB->quote(
$id,
'integer'));
116 $set = $ilDB->query(
'SELECT booking_type_id FROM booking_type'.
117 ' WHERE pool_id = '.$ilDB->quote(
$id,
'integer'));
118 while(
$row = $ilDB->fetchAssoc($set))
120 $types[] =
$row[
'booking_type_id'];
126 $set = $ilDB->query(
'SELECT booking_object_id FROM booking_object'.
127 ' WHERE '.$ilDB->in(
'type_id', $types,
'',
'integer'));
128 while(
$row = $ilDB->fetchAssoc($set))
130 $objects[] =
$row[
'booking_object_id'];
135 $ilDB->manipulate(
'DELETE FROM booking_reservation'.
136 ' WHERE '.$ilDB->in(
'object_id', $objects,
'',
'integer'));
139 $ilDB->manipulate(
'DELETE FROM booking_object'.
140 ' WHERE '.$ilDB->in(
'type_id', $types,
'',
'integer'));
142 $ilDB->manipulate(
'DELETE FROM booking_type'.
143 ' WHERE pool_id = '.$ilDB->quote(
$id,
'integer'));
171 return $roles ? $roles : array();
186 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
226 if ($a_node_id==
$_GET[
"ref_id"])
228 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
229 $parent_type = $parent_obj->getType();
230 if($parent_type == $this->
getType())
232 $a_node_id = (int) $tree->getParentId($a_node_id);
236 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
245 $this->offline = (bool)$a_value;
263 $this->public_log = (bool)$a_value;
281 $this->slots_no = (int)$a_value;