4 require_once
"./Services/Object/classes/class.ilObject.php";
31 $this->
ilObject($a_id,$a_call_by_reference);
41 "pool_offline" => array(
"integer", $this->
isOffline()),
56 $new_id = parent::create();
59 $fields[
"booking_pool_id"] = array(
"integer", $new_id);
61 $ilDB->insert(
"booking_settings", $fields);
74 if (!parent::update())
82 $ilDB->update(
"booking_settings", $this->
getDBFields(),
83 array(
"booking_pool_id" => array(
"integer", $this->
getId())));
98 $set = $ilDB->query(
'SELECT * FROM booking_settings'.
99 ' WHERE booking_pool_id = '.$ilDB->quote($this->getId(),
'integer'));
100 $row = $ilDB->fetchAssoc($set);
118 if (!parent::delete())
125 $ilDB->manipulate(
'DELETE FROM booking_settings'.
126 ' WHERE booking_pool_id = '.$ilDB->quote(
$id,
'integer'));
128 $ilDB->manipulate(
'DELETE FROM booking_schedule'.
129 ' WHERE pool_id = '.$ilDB->quote(
$id,
'integer'));
132 $set = $ilDB->query(
'SELECT booking_object_id FROM booking_object'.
133 ' WHERE pool_id = '.$ilDB->quote(
$id,
'integer'));
134 while(
$row = $ilDB->fetchAssoc($set))
136 $objects[] =
$row[
'booking_object_id'];
141 $ilDB->manipulate(
'DELETE FROM booking_reservation'.
142 ' WHERE '.$ilDB->in(
'object_id', $objects,
'',
'integer'));
145 $ilDB->manipulate(
'DELETE FROM booking_object'.
146 ' WHERE pool_id = '.$ilDB->quote(
$id,
'integer'));
151 public function cloneObject($a_target_id,$a_copy_id = 0,$a_omit_tree =
false)
153 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
155 $new_obj->setOffline($this->
isOffline());
163 include_once
"Modules/BookingManager/classes/class.ilBookingSchedule.php";
167 $smap[$item[
"booking_schedule_id"]] = $schedule->doClone($new_obj->getId());
172 include_once
"Modules/BookingManager/classes/class.ilBookingObject.php";
176 $bobj->doClone($new_obj->getId(), $smap);
206 return $roles ? $roles : array();
221 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
261 if ($a_node_id==
$_GET[
"ref_id"])
263 $parent_obj =& $this->
ilias->obj_factory->getInstanceByRefId($a_node_id);
264 $parent_type = $parent_obj->getType();
265 if($parent_type == $this->
getType())
267 $a_node_id = (int) $tree->getParentId($a_node_id);
271 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
280 $this->offline = (bool)$a_value;
298 $this->public_log = (bool)$a_value;
316 $this->schedule_type = (int)$a_value;
338 $set = $ilDB->query(
"SELECT pool_offline".
339 " FROM booking_settings".
340 " WHERE booking_pool_id = ".$ilDB->quote($a_obj_id,
"integer"));
341 $row = $ilDB->fetchAssoc($set);
342 return !(bool)
$row[
"pool_offline"];
notify($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
notifys an object about an event occured Based on the event happend, each object may decide how it re...
initDefaultRoles()
init default roles settings
getDBFields()
Parse properties for sql statements.
update()
update object data
getScheduleType()
Get schedule type.
Class ilObject Basic functions for all objects.
__construct($a_id=0, $a_call_by_reference=true)
Constructor.
schedule for booking ressource
hasPublicLog()
Get public log property.
setOffline($a_value=true)
Toggle offline property.
setScheduleType($a_value)
Set schedule type.
ilObject($a_id=0, $a_reference=true)
Constructor public.
static _lookupOnline($a_obj_id)
Check object status.
setPublicLog($a_value=true)
Toggle public log property.
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
static getList($a_pool_id)
Get list of booking objects for given type.
getType()
get object type public
isOffline()
Get offline property.
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
static getList($a_pool_id)
Get list of booking objects for given pool.