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);
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"),
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());
222 $new_obj->setScheduleType($this->getScheduleType());
223 $new_obj->setPublicLog($this->hasPublicLog());
224 $new_obj->setOverallLimit($this->getOverallLimit());
225 $new_obj->setReminderStatus($this->getReminderStatus());
226 $new_obj->setReminderDay($this->getReminderDay());
227 $new_obj->setPreferenceNumber($this->getPreferenceNumber());
228 $new_obj->setPreferenceDeadline($this->getPreferenceDeadline());
231 if ($this->getScheduleType() === self::TYPE_FIX_SCHEDULE) {
235 $smap[$item[
"booking_schedule_id"]] = $schedule->doClone($new_obj->getId());
242 $bobj->doClone($new_obj->getId(), $smap);
255 $this->offline = $a_value;
260 return $this->offline;
269 $this->public_log = $a_value;
274 return $this->public_log;
279 $this->schedule_type = $a_value;
284 return $this->schedule_type;
289 $this->reminder_status = $a_val;
294 return $this->reminder_status;
299 $this->reminder_day = $a_val;
304 return $this->reminder_day;
309 $this->preference_nr = $a_val;
314 return $this->preference_nr;
322 $this->pref_deadline = $a_val;
330 return $this->pref_deadline;
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;
356 return $this->overall_limit;
365 $this->reservation_period = $a_value;
370 return $this->reservation_period;
385 foreach ($recs as $record_obj) {
387 $field_id = $def->getFieldId();
388 $fields[$field_id] = array(
390 "title" => $def->getTitle(),
391 "type" => $def->getType()
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static getInstancesByRecordId( $a_record_id, $a_only_searchable=false, string $language='')
Get definitions by record 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 getList(int $a_pool_id, string $a_title=null)
Get list of booking objects.
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 _getInstance(int $a_copy_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setReminderDay(int $a_val)
setPreferenceNumber(int $a_val)
static writeLastReminderTimestamp(int $a_obj_id, int $a_ts)
__construct(int $a_id=0, bool $a_call_by_reference=true)
static getAdvancedMDFields(int $a_ref_id)
setOffline(bool $a_value=true)
getDBFields()
Parse properties for sql statements.
create()
note: title, description and type should be set when this function is called
const TYPE_NO_SCHEDULE_PREFERENCES
static _lookupOnline(int $a_obj_id)
cloneObject(int $target_id, int $copy_id=0, bool $omit_tree=false)
setPreferenceDeadline(int $a_val)
setReservationFilterPeriod(?int $a_value=null)
Set reservation filter period default.
setReminderStatus(int $a_val)
setScheduleType(int $a_value)
setOverallLimit(?int $a_value=null)
Set overall / global booking limit.
getReservationFilterPeriod()
setPublicLog(bool $a_value=true)
Toggle public log property.
static getPoolsWithReminders()
Get pools with reminders.
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...
update(string $table_name, array $values, array $where)
@description $where MUST contain existing columns only.
fetchAssoc(ilDBStatement $statement)
queryF(string $query, array $types, array $values)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc