4 require_once
"./Services/Object/classes/class.ilObject.php";
30 public function __construct($a_id = 0, $a_call_by_reference =
true)
34 $this->db = $DIC->database();
37 parent::__construct($a_id, $a_call_by_reference);
64 $new_id = parent::create();
67 $fields[
"booking_pool_id"] =
array(
"integer", $new_id);
69 $ilDB->insert(
"booking_settings", $fields);
105 if ($this->
getId()) {
106 $set =
$ilDB->query(
'SELECT * FROM booking_settings' .
107 ' WHERE booking_pool_id = ' .
$ilDB->quote($this->getId(),
'integer'));
121 public function delete()
128 if (!parent::delete()) {
134 $ilDB->manipulate(
'DELETE FROM booking_settings' .
135 ' WHERE booking_pool_id = ' .
$ilDB->quote(
$id,
'integer'));
137 $ilDB->manipulate(
'DELETE FROM booking_schedule' .
138 ' WHERE pool_id = ' .
$ilDB->quote(
$id,
'integer'));
141 $set =
$ilDB->query(
'SELECT booking_object_id FROM booking_object' .
142 ' WHERE pool_id = ' .
$ilDB->quote(
$id,
'integer'));
144 $objects[] =
$row[
'booking_object_id'];
147 if (
sizeof($objects)) {
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())) {
166 $new_obj->setOffline($this->
isOffline());
176 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";
187 $bobj->doClone($new_obj->getId(), $smap);
201 $this->offline = (bool) $a_value;
219 $this->public_log = (bool) $a_value;
237 $this->schedule_type = (int) $a_value;
259 $ilDB = $DIC->database();
261 $set =
$ilDB->query(
"SELECT pool_offline" .
262 " FROM booking_settings" .
263 " WHERE booking_pool_id = " .
$ilDB->quote($a_obj_id,
"integer"));
265 return !(bool)
$row[
"pool_offline"];
275 if ($a_value !== null) {
276 $a_value = (int) $a_value;
278 $this->overall_limit = $a_value;
298 if ($a_value !== null) {
299 $a_value = (int) $a_value;
301 $this->reservation_period = $a_value;
323 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
326 foreach ($recs as $record_obj) {
327 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
329 $fields[$def->getFieldId()] =
array(
330 "id" => $def->getFieldId(),
331 "title" => $def->getTitle(),
332 "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.
__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 _lookupOnline($a_obj_id)
Check object status.
static _getSelectedRecordsByObject($a_obj_type, $a_ref_id, $a_sub_type="")
Get selected records by object.
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
Create styles array
The data for the language used.
getReservationFilterPeriod()
Get reservation filter period default.
update($pash, $contents, Config $config)
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.
static getAdvancedMDFields($a_ref_id)
setOverallLimit($a_value=null)
Set overall / global booking limit.