119 return "il_dcl_tableview";
191 $this->tableview_order = $order;
346 if ($field_name ==
'roles') {
347 return json_encode($this->roles);
360 public function wakeUp($field_name, $field_value)
362 if ($field_name ==
'roles') {
363 return json_decode($field_value);
373 public function delete()
402 "tableview_id" => $this->
id,
404 'il_dcl_tfield_set.table_id' => $this->
getTableId(),
406 )->innerjoin(
'il_dcl_tfield_set',
'field',
'field', array())
407 ->orderBy(
'il_dcl_tfield_set.field_order')
419 if (!$this->visible_fields_cache) {
423 "tableview_id" => $this->
id,
425 'il_dcl_tfield_set.table_id' => $this->
getTableId(),
427 )->innerjoin(
'il_dcl_tfield_set',
'field',
'field', array())->orderBy(
'il_dcl_tfield_set.field_order')->get();
429 foreach ($visible as $field_rec) {
430 $fields[] = $field_rec->getFieldObject();
432 $this->visible_fields_cache = $fields;
446 'tableview_id' => $this->
getId(),
447 'il_dcl_tfield_set.table_id' => $this->
getTableId(),
449 )->innerjoin(
'il_dcl_tfield_set',
'field',
'field', array(
'field_order'))->orderBy(
'field_order')->get();
459 'tableview_id' => $this->
getId(),
467 public function create($create_default_settings =
true)
470 if ($create_default_settings) {
483 foreach ($table->getFieldIds() as $field_id) {
489 if (!$table->getPublicCommentsEnabled()) {
504 'tableview_id' => $this->
id,
505 'field' => $field_id,
510 $field_set->setTableviewId($this->
id);
511 $field_set->setField($field_id);
513 $field_set->setFilterChangeable(
true);
514 $field_set->setLockedCreate(
false);
515 $field_set->setLockedEdit(
false);
516 $field_set->setRequiredCreate(
false);
517 $field_set->setRequiredEdit(
false);
518 $field_set->setVisibleCreate(
true);
519 $field_set->setVisibleEdit(
true);
520 $field_set->create();
550 $new_fieldsetting->setTableviewId($this->
getId());
551 if ($new_fields[$orig_fieldsetting->getField()]) {
553 $new_fieldsetting->setField($new_fields[$orig_fieldsetting->getField()]->getId());
556 $new_fieldsetting->setField($orig_fieldsetting->getField());
558 $new_field_id = $new_fieldsetting->cloneStructure($orig_fieldsetting);
561 $datatype = $orig_fieldsetting->getFieldObject()->getDatatypeId();
564 if (!is_null($match)) {
565 $new_default_value =
$f->create($datatype);
566 $new_default_value->setTviewSetId($new_field_id);
567 $new_default_value->setValue($match->getValue());
568 $new_default_value->create();
590 return self::where(array(
'table_id' =>
$table_id))->orderBy(
'tableview_order')->get();
601 return self::where(array(
'table_id' =>
$table_id))->orderBy(
'tableview_order')->count();
613 if ($standardview = self::where(array(
'table_id' =>
$table_id))->
orderBy(
'tableview_order')->
first()) {
614 return $standardview;
618 $rbacreview = $DIC[
'rbacreview'];
620 foreach ($rbacreview->getParentRoleIds(
$_GET[
'ref_id']) as $role_array) {
621 $roles[] = $role_array[
'obj_id'];
626 if (
$_GET[
'ref_id']) {
628 $rbacreview = $DIC[
'rbacreview'];
630 foreach ($rbacreview->getParentRoleIds(
$_GET[
'ref_id']) as $role_array) {
631 $roles[] = $role_array[
'obj_id'];
633 $view->setRoles(array_merge(
$roles, $rbacreview->getLocalRoles(
$_GET[
'ref_id'])));
638 $view->setTitle(
$lng->txt(
'dcl_title_standardview'));
639 $view->setTableviewOrder(10);
640 $view->setStepVs(
true);
641 $view->setStepC(
false);
642 $view->setStepE(
false);
643 $view->setStepO(
false);
644 $view->setStepS(
false);
645 $view->create($create_default_settings);
659 return $this->step_vs && $this->step_c && $this->step_e &&
$this->step_o;
static setCloneOf($old, $new, $type)
cloneStructure(ilDclTableView $orig, array $new_fields)
createFieldSetting($field_id)
create ilDclTableViewFieldSetting for this tableview and the given field id
wakeUp($field_name, $field_value)
getFilterableFieldSettings()
getFilterableFields Returns all fieldsetting-objects of this tableview which have set their filterabl...
static getAllForTableId($table_id)
static getCountForTableId($table_id)
static getTableCache($table_id=0)
static where($where, $operator=null)
Class ilDclTableViewFieldSetting.
validateConfigCompletion()
Check if the configuration of the view is complete.
setTableviewOrder($tableview_order)
static returnDbTableName()
create($create_default_settings=true)
createDefaultSettings()
create default ilDclTableViewFieldSetting entries
static _isStandardField($field_id)
static createOrGetStandardView($table_id, $create_default_settings=true)
static findSingle($data_type_id, $tview_id)
setDescription($description)
getVisibleFields()
Returns all field-objects of this tableview which have set their visibility to true, including standard fields.
static orderBy($orderBy, $orderDirection='ASC')
copy($a_id, $a_parent_type="", $a_parent_id=0, $a_clone_mobs=false)
Copy page.
getFieldSetting($field_id)
Class ilDclDetailedViewDefinition.