4 require_once
"./Services/Object/classes/class.ilObject.php";
33 $this->
ilObject($a_id,$a_call_by_reference);
43 "pool_offline" => array(
"integer", $this->
isOffline()),
62 $fields[
"booking_pool_id"] = array(
"integer", $new_id);
64 $ilDB->insert(
"booking_settings", $fields);
77 if (!parent::update())
85 $ilDB->update(
"booking_settings", $this->
getDBFields(),
86 array(
"booking_pool_id" => array(
"integer", $this->
getId())));
101 $set = $ilDB->query(
'SELECT * FROM booking_settings'.
102 ' WHERE booking_pool_id = '.$ilDB->quote($this->getId(),
'integer'));
103 $row = $ilDB->fetchAssoc($set);
122 if (!parent::delete())
129 $ilDB->manipulate(
'DELETE FROM booking_settings'.
130 ' WHERE booking_pool_id = '.$ilDB->quote(
$id,
'integer'));
132 $ilDB->manipulate(
'DELETE FROM booking_schedule'.
133 ' WHERE pool_id = '.$ilDB->quote(
$id,
'integer'));
136 $set = $ilDB->query(
'SELECT booking_object_id FROM booking_object'.
137 ' WHERE pool_id = '.$ilDB->quote(
$id,
'integer'));
138 while(
$row = $ilDB->fetchAssoc($set))
140 $objects[] =
$row[
'booking_object_id'];
145 $ilDB->manipulate(
'DELETE FROM booking_reservation'.
146 ' WHERE '.$ilDB->in(
'object_id', $objects,
'',
'integer'));
149 $ilDB->manipulate(
'DELETE FROM booking_object'.
150 ' WHERE pool_id = '.$ilDB->quote(
$id,
'integer'));
155 public function cloneObject($a_target_id,$a_copy_id = 0,$a_omit_tree =
false)
162 if(!$cp_options->isRootNode($this->getRefId()))
164 $new_obj->setOffline($this->
isOffline());
175 include_once
"Modules/BookingManager/classes/class.ilBookingSchedule.php";
179 $smap[$item[
"booking_schedule_id"]] = $schedule->doClone($new_obj->getId());
184 include_once
"Modules/BookingManager/classes/class.ilBookingObject.php";
188 $bobj->doClone($new_obj->getId(), $smap);
209 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
249 if ($a_node_id==
$_GET[
"ref_id"])
251 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
252 $parent_type = $parent_obj->getType();
253 if($parent_type == $this->
getType())
255 $a_node_id = (int) $tree->getParentId($a_node_id);
259 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
268 $this->offline = (bool)$a_value;
286 $this->public_log = (bool)$a_value;
304 $this->schedule_type = (int)$a_value;
326 $set = $ilDB->query(
"SELECT pool_offline".
327 " FROM booking_settings".
328 " WHERE booking_pool_id = ".$ilDB->quote($a_obj_id,
"integer"));
329 $row = $ilDB->fetchAssoc($set);
330 return !(bool)
$row[
"pool_offline"];
340 if($a_value !== null)
342 $a_value = (int)$a_value;
344 $this->overall_limit = $a_value;