4 require_once
"./Services/Object/classes/class.ilObject.php";
34 parent::__construct($a_id,$a_call_by_reference);
61 $new_id = parent::create();
64 $fields[
"booking_pool_id"] =
array(
"integer", $new_id);
66 $ilDB->insert(
"booking_settings", $fields);
79 if (!parent::update())
87 $ilDB->update(
"booking_settings", $this->
getDBFields(),
103 $set = $ilDB->query(
'SELECT * FROM booking_settings'.
104 ' WHERE booking_pool_id = '.$ilDB->quote($this->getId(),
'integer'));
105 $row = $ilDB->fetchAssoc($set);
125 if (!parent::delete())
132 $ilDB->manipulate(
'DELETE FROM booking_settings'.
133 ' WHERE booking_pool_id = '.$ilDB->quote(
$id,
'integer'));
135 $ilDB->manipulate(
'DELETE FROM booking_schedule'.
136 ' WHERE pool_id = '.$ilDB->quote(
$id,
'integer'));
139 $set = $ilDB->query(
'SELECT booking_object_id FROM booking_object'.
140 ' WHERE pool_id = '.$ilDB->quote(
$id,
'integer'));
141 while(
$row = $ilDB->fetchAssoc($set))
143 $objects[] =
$row[
'booking_object_id'];
148 $ilDB->manipulate(
'DELETE FROM booking_reservation'.
149 ' WHERE '.$ilDB->in(
'object_id', $objects,
'',
'integer'));
152 $ilDB->manipulate(
'DELETE FROM booking_object'.
153 ' WHERE pool_id = '.$ilDB->quote(
$id,
'integer'));
158 public function cloneObject($a_target_id,$a_copy_id = 0, $a_omit_tree =
false)
160 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
165 if(!$cp_options->isRootNode($this->getRefId()))
167 $new_obj->setOffline($this->
isOffline());
178 include_once
"Modules/BookingManager/classes/class.ilBookingSchedule.php";
182 $smap[$item[
"booking_schedule_id"]] = $schedule->doClone($new_obj->getId());
187 include_once
"Modules/BookingManager/classes/class.ilBookingObject.php";
191 $bobj->doClone($new_obj->getId(), $smap);
205 $this->offline = (bool)$a_value;
223 $this->public_log = (bool)$a_value;
241 $this->schedule_type = (int)$a_value;
263 $set = $ilDB->query(
"SELECT pool_offline".
264 " FROM booking_settings".
265 " WHERE booking_pool_id = ".$ilDB->quote($a_obj_id,
"integer"));
266 $row = $ilDB->fetchAssoc($set);
267 return !(bool)
$row[
"pool_offline"];
277 if($a_value !== null)
279 $a_value = (int)$a_value;
281 $this->overall_limit = $a_value;
301 if($a_value !== null)
303 $a_value = (int)$a_value;
305 $this->reservation_period = $a_value;
327 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
330 foreach($recs as $record_obj)
332 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
335 $fields[$def->getFieldId()] =
array(
336 "id" => $def->getFieldId(),
337 "title" => $def->getTitle(),
338 "type" => $def->getType()
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.
static getAdvancedMDFields($a_glossary_id)
static _lookupOnline($a_obj_id)
Check object status.
setPublicLog($a_value=true)
Toggle public log property.
setReservationFilterPeriod($a_value=null)
Set reservation filter period default.
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
static _getSelectedRecordsByObject($a_obj_type, $a_obj_id, $a_sub_type="")
Get selected records by object.
Create styles array
The data for the language used.
getReservationFilterPeriod()
Get reservation filter period default.
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.