43 bool $a_call_by_reference =
true 47 $this->db = $DIC->database();
60 "pool_offline" => array(
"integer", $this->
isOffline()),
75 $new_id = parent::create();
78 $fields[
"booking_pool_id"] = array(
"integer", $new_id);
80 $ilDB->insert(
"booking_settings", $fields);
89 if (!parent::update()) {
98 array(
"booking_pool_id" => array(
"integer", $this->
getId()))
112 if ($this->
getId()) {
113 $set =
$ilDB->query(
'SELECT * FROM booking_settings' .
114 ' WHERE booking_pool_id = ' .
$ilDB->quote($this->getId(),
'integer'));
115 $row =
$ilDB->fetchAssoc($set);
135 $db = $DIC->database();
138 "SELECT * FROM booking_settings " .
139 " WHERE reminder_status = %s " .
140 " AND reminder_day > %s " .
141 " AND pool_offline = %s ",
142 array(
"integer",
"integer",
"integer"),
160 $db = $DIC->database();
162 "last_remind_ts" => array(
"integer", $a_ts)
164 "booking_pool_id" => array(
"integer", $a_obj_id)
168 public function delete():
bool 174 if ($this->referenced) {
176 $use_repo->deleteEntriesOfBookRefId($this->
getRefId());
180 if (!parent::delete()) {
186 $ilDB->manipulate(
'DELETE FROM booking_settings' .
187 ' WHERE booking_pool_id = ' .
$ilDB->quote(
$id,
'integer'));
189 $ilDB->manipulate(
'DELETE FROM booking_schedule' .
190 ' WHERE pool_id = ' .
$ilDB->quote(
$id,
'integer'));
193 $set =
$ilDB->query(
'SELECT booking_object_id FROM booking_object' .
194 ' WHERE pool_id = ' .
$ilDB->quote(
$id,
'integer'));
195 while ($row =
$ilDB->fetchAssoc($set)) {
196 $objects[] = $row[
'booking_object_id'];
199 if (count($objects)) {
200 $ilDB->manipulate(
'DELETE FROM booking_reservation' .
201 ' WHERE ' .
$ilDB->in(
'object_id', $objects,
'',
'integer'));
204 $ilDB->manipulate(
'DELETE FROM booking_object' .
205 ' WHERE pool_id = ' .
$ilDB->quote(
$id,
'integer'));
212 $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
214 if ($new_obj !== null) {
218 if (!$cp_options->isRootNode($this->getRefId())) {
219 $new_obj->setOffline($this->
isOffline());
235 $smap[$item[
"booking_schedule_id"]] = $schedule->doClone($new_obj->getId());
242 $bobj->doClone($new_obj->getId(), $smap);
255 $this->offline = $a_value;
269 $this->public_log = $a_value;
279 $this->schedule_type = $a_value;
289 $this->reminder_status = $a_val;
299 $this->reminder_day = $a_val;
309 $this->preference_nr = $a_val;
322 $this->pref_deadline = $a_val;
337 $ilDB = $DIC->database();
339 $set =
$ilDB->query(
"SELECT pool_offline" .
340 " FROM booking_settings" .
341 " WHERE booking_pool_id = " .
$ilDB->quote($a_obj_id,
"integer"));
342 $row =
$ilDB->fetchAssoc($set);
343 return !$row[
"pool_offline"];
351 $this->overall_limit = $a_value;
365 $this->reservation_period = $a_value;
385 foreach ($recs as $record_obj) {
387 $field_id = $def->getFieldId();
388 $fields[$field_id] = array(
390 "title" => $def->getTitle(),
391 "type" => $def->getType()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupOnline(int $a_obj_id)
getDBFields()
Parse properties for sql statements.
__construct(int $a_id=0, bool $a_call_by_reference=true)
fetchAssoc(ilDBStatement $statement)
setOverallLimit(?int $a_value=null)
Set overall / global booking limit.
update(string $table_name, array $values, array $where)
$where MUST contain existing columns only.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getList(int $a_pool_id)
Get list of booking objects for given pool.
static getAdvancedMDFields(int $a_ref_id)
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstancesByRecordId( $a_record_id, $a_only_searchable=false, string $language='')
Get definitions by record id.
static getPoolsWithReminders()
Get pools with reminders.
setReminderDay(int $a_val)
static writeLastReminderTimestamp(int $a_obj_id, int $a_ts)
setReminderStatus(int $a_val)
setPublicLog(bool $a_value=true)
Toggle public log property.
setPreferenceDeadline(int $a_val)
setScheduleType(int $a_value)
queryF(string $query, array $types, array $values)
getReservationFilterPeriod()
__construct(Container $dic, ilPlugin $plugin)
static _getInstance(int $a_copy_id)
cloneObject(int $target_id, int $copy_id=0, bool $omit_tree=false)
const TYPE_NO_SCHEDULE_PREFERENCES
setPreferenceNumber(int $a_val)
setReservationFilterPeriod(?int $a_value=null)
Set reservation filter period default.
static getList(int $a_pool_id, string $a_title=null)
Get list of booking objects.
setOffline(bool $a_value=true)