115 return "il_dcl_tableview";
123 public function setId(
int $id): void
155 $this->tableview_order = $order;
241 public function sleep($field_name): ?string
243 if ($field_name ==
'roles') {
244 return json_encode($this->roles);
254 public function wakeUp($field_name, $field_value): ?array
256 if ($field_name ==
'roles') {
257 return json_decode($field_value);
263 public function delete():
void 282 return parent::findOrGetInstance($primary_key, $add_constructor_args);
294 "tableview_id" => $this->
id,
296 'il_dcl_tfield_set.table_id' => $this->
getTableId(),
298 )->innerjoin(
'il_dcl_tfield_set',
'field',
'field', array())
299 ->orderBy(
'il_dcl_tfield_set.field_order')
309 if (!$this->visible_fields_cache) {
312 "tableview_id" => $this->
id,
314 'il_dcl_tfield_set.table_id' => $this->
getTableId(),
321 )->orderBy(
'il_dcl_tfield_set.field_order')->get();
323 foreach ($visible as $field_rec) {
324 $fields[] = $field_rec->getFieldObject();
326 $this->visible_fields_cache = $fields;
340 'tableview_id' => $this->
getId(),
341 'il_dcl_tfield_set.table_id' => $this->
getTableId(),
344 ->innerjoin(
'il_dcl_tfield_set',
'field',
'field', [
'field_order'])->orderBy(
'field_order')
349 $datatype = $setting->getFieldObject()->getDatatypeId();
351 $result[] = $setting;
365 'tableview_id' => $this->
getId(),
370 public function create(
bool $create_default_settings =
true): void
373 if ($create_default_settings) {
385 foreach ($table->getFieldIds() as $field_id) {
391 if (!$table->getPublicCommentsEnabled()) {
404 'tableview_id' => $this->
id,
405 'field' => $field_id,
410 $field_set->setTableviewId($this->
id);
411 $field_set->setField($field_id);
413 $field_set->setFilterChangeable(
true);
414 $field_set->setLockedCreate(
false);
415 $field_set->setLockedEdit(
false);
416 $field_set->setRequiredCreate(
false);
417 $field_set->setRequiredEdit(
false);
418 $field_set->setVisibleCreate(
true);
419 $field_set->setVisibleEdit(
true);
420 $field_set->create();
432 $this->
setTitle($orig->
getTitle() .
' ' . $DIC->language()->txt(
'copy_of_suffix'));
449 $new_fieldsetting->setTableviewId($this->
getId());
450 if ($new_fields[$orig_fieldsetting->getField()] ?? null) {
452 $new_fieldsetting->setField($new_fields[$orig_fieldsetting->getField()]->getId());
455 $new_fieldsetting->setField($orig_fieldsetting->getField());
457 $new_field_id = $new_fieldsetting->cloneStructure($orig_fieldsetting);
460 $datatype = $orig_fieldsetting->getFieldObject()->getDatatypeId();
461 $match = ilDclTableViewBaseDefaultValue::findSingle($datatype, $orig_fieldsetting->getId());
463 if (!is_null($match)) {
464 $new_default_value =
$f->create($datatype);
465 $new_default_value->setTviewSetId($new_field_id);
466 $new_default_value->setValue($match->getValue());
467 $new_default_value->create();
486 return self::where(array(
'table_id' => $table_id))->orderBy(
'tableview_order')->get();
491 return self::where(array(
'table_id' => $table_id))->orderBy(
'tableview_order')->count();
501 if ($standardview = self::where(array(
'table_id' => $table_id))->
orderBy(
'tableview_order')->
first()) {
502 return $standardview;
506 $rbacreview = $DIC[
'rbacreview'];
507 $http = $DIC->http();
513 foreach ($rbacreview->getParentRoleIds(
$ref_id) as $role_array) {
514 $roles[] = $role_array[
'obj_id'];
519 $hasRefId =
$http->wrapper()->query()->has(
'ref_id');
523 $rbacreview = $DIC[
'rbacreview'];
528 foreach ($rbacreview->getParentRoleIds(
$ref_id) as $role_array) {
529 $roles[] = $role_array[
'obj_id'];
531 $view->setRoles(array_merge($roles, $rbacreview->getLocalRoles(
$ref_id)));
533 $view->setTableId($table_id);
536 $view->setTitle(
$lng->txt(
'dcl_title_standardview'));
537 $view->setTableviewOrder(10);
538 $view->setStepVs(
true);
539 $view->setStepC(
false);
540 $view->setStepE(
false);
541 $view->setStepO(
false);
542 $view->setStepS(
false);
543 $view->create($create_default_settings);
554 return $this->step_vs && $this->step_c && $this->step_e &&
$this->step_o;
cloneStructure(ilDclTableView $orig, array $new_fields)
static createOrGetStandardView(int $table_id, bool $create_default_settings=true)
static orderBy($orderBy, string $orderDirection='ASC')
createFieldSetting($field_id)
create ilDclTableViewFieldSetting for this tableview and the given field id
wakeUp($field_name, $field_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getFilterableFieldSettings()
getFilterableFields Returns all fieldsetting-objects of this tableview which have set their filterabl...
copy(int $a_id, string $a_parent_type="", int $a_new_parent_id=0, bool $a_clone_mobs=false, int $obj_copy_id=0)
Copy page.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static where($where, $operator=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setDescription(string $description)
static findOrGetInstance($primary_key, array $add_constructor_args=array())
validateConfigCompletion()
Check if the configuration of the view is complete.
static getTableCache(int $table_id=null)
static returnDbTableName()
static getAllDatatype(bool $force=false)
Get all possible Datatypes.
createDefaultSettings()
create default ilDclTableViewFieldSetting entries
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getCountForTableId(int $table_id)
static setCloneOf(int $old, int $new, string $type)
static _isStandardField($field_id)
array $visible_fields_cache
create(bool $create_default_settings=true)
getVisibleFields()
Returns all field-objects of this tableview which have set their visibility to true, including standard fields.
static getAllForTableId(int $table_id)
setTableId(int $table_id)
getFieldSetting($field_id)
setTableviewOrder(int $tableview_order)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Refinery Factory $refinery