4 require_once
"./Services/Object/classes/class.ilObject.php";
32 public function __construct($a_id = 0, $a_call_by_reference =
true)
36 $this->db = $DIC->database();
39 parent::__construct($a_id, $a_call_by_reference);
49 "pool_offline" => array(
"integer", $this->
isOffline()),
68 $new_id = parent::create();
71 $fields[
"booking_pool_id"] = array(
"integer", $new_id);
73 $ilDB->insert(
"booking_settings", $fields);
95 array(
"booking_pool_id" => array(
"integer", $this->
getId()))
109 if ($this->
getId()) {
110 $set =
$ilDB->query(
'SELECT * FROM booking_settings' .
111 ' WHERE booking_pool_id = ' .
$ilDB->quote($this->getId(),
'integer'));
132 $db = $DIC->database();
135 "SELECT * FROM booking_settings " .
136 " WHERE reminder_status = %s " .
137 " AND reminder_day > %s " .
138 " AND pool_offline = %s ",
139 array(
"integer",
"integer",
"integer"),
142 while ($rec =
$db->fetchAssoc($set)) {
157 $db = $DIC->database();
158 $db->update(
"booking_settings", array(
159 "last_remind_ts" => array(
"integer", $a_ts)
161 "booking_pool_id" => array(
"integer", $a_obj_id)
170 public function delete()
177 if (!parent::delete()) {
183 $ilDB->manipulate(
'DELETE FROM booking_settings' .
184 ' WHERE booking_pool_id = ' .
$ilDB->quote(
$id,
'integer'));
186 $ilDB->manipulate(
'DELETE FROM booking_schedule' .
187 ' WHERE pool_id = ' .
$ilDB->quote(
$id,
'integer'));
190 $set =
$ilDB->query(
'SELECT booking_object_id FROM booking_object' .
191 ' WHERE pool_id = ' .
$ilDB->quote(
$id,
'integer'));
193 $objects[] =
$row[
'booking_object_id'];
196 if (
sizeof($objects)) {
197 $ilDB->manipulate(
'DELETE FROM booking_reservation' .
198 ' WHERE ' .
$ilDB->in(
'object_id', $objects,
'',
'integer'));
201 $ilDB->manipulate(
'DELETE FROM booking_object' .
202 ' WHERE pool_id = ' .
$ilDB->quote(
$id,
'integer'));
207 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
209 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
214 if (!$cp_options->isRootNode($this->getRefId())) {
215 $new_obj->setOffline($this->
isOffline());
227 include_once
"Modules/BookingManager/classes/class.ilBookingSchedule.php";
230 $smap[$item[
"booking_schedule_id"]] = $schedule->doClone($new_obj->getId());
235 include_once
"Modules/BookingManager/classes/class.ilBookingObject.php";
238 $bobj->doClone($new_obj->getId(), $smap);
252 $this->offline = (bool) $a_value;
270 $this->public_log = (bool) $a_value;
288 $this->schedule_type = (int) $a_value;
307 $this->reminder_status = $a_val;
327 $this->reminder_day = $a_val;
350 $ilDB = $DIC->database();
352 $set =
$ilDB->query(
"SELECT pool_offline" .
353 " FROM booking_settings" .
354 " WHERE booking_pool_id = " .
$ilDB->quote($a_obj_id,
"integer"));
356 return !(bool)
$row[
"pool_offline"];
366 if ($a_value !== null) {
367 $a_value = (int) $a_value;
369 $this->overall_limit = $a_value;
389 if ($a_value !== null) {
390 $a_value = (int) $a_value;
392 $this->reservation_period = $a_value;
414 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
417 foreach ($recs as $record_obj) {
418 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
420 $fields[$def->getFieldId()] = array(
421 "id" => $def->getFieldId(),
422 "title" => $def->getTitle(),
423 "type" => $def->getType()
setReminderStatus($a_val)
Set reminder status.
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
static writeLastReminderTimestamp($a_obj_id, $a_ts)
Write last reminder timestamp.
hasPublicLog()
Get public log property.
setOffline($a_value=true)
Toggle offline property.
setScheduleType($a_value)
Set schedule type.
static getPoolsWithReminders()
Get poos with reminders.
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
setReminderDay($a_val)
Set reminder day.
getReminderStatus()
Get reminder status.
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.
getReminderDay()
Get reminder day.