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()),
59 $new_id = parent::create();
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)
157 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
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;
366 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
369 foreach($recs as $record_obj)
371 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
374 $fields[$def->getFieldId()] = array(
375 "id" => $def->getFieldId(),
376 "title" => $def->getTitle(),
377 "type" => $def->getType()
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...
getDBFields()
Parse properties for sql statements.
static getList($a_pool_id, $a_title=null)
Get list of booking objects for given type.
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 getAdvancedMDFields($a_glossary_id)
static _lookupOnline($a_obj_id)
Check object status.
setPublicLog($a_value=true)
Toggle public log property.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static getInstancesByRecordId($a_record_id, $a_only_searchable=false)
Get definitions by record id.
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
static _getSelectedRecordsByObject($a_obj_type, $a_obj_id, $a_sub_type="")
Get selected records by object.
getType()
get object type public
isOffline()
Get offline property.
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
getOverallLimit()
Get overall / global booking limit.
static getList($a_pool_id)
Get list of booking objects for given pool.
setOverallLimit($a_value=null)
Set overall / global booking limit.