2 require_once(
'./Services/ActiveRecord/class.ActiveRecord.php');
3 require_once(
'./Modules/DataCollection/classes/TableView/class.ilDclTableViewFieldSetting.php');
78 return "il_dcl_tableview";
142 $this->tableview_order = $order;
199 public function sleep($field_name) {
200 if ($field_name ==
'roles') {
201 return json_encode($this->roles);
214 public function wakeUp($field_name, $field_value) {
215 if ($field_name ==
'roles') {
216 return json_decode($field_value);
226 public function delete() {
252 "tableview_id" => $this->
id,
254 'il_dcl_tfield_set.table_id' => $this->
getTableId(),
256 )->innerjoin(
'il_dcl_tfield_set',
'field',
'field',
array())
257 ->orderBy(
'il_dcl_tfield_set.field_order')
268 if (!$this->visible_fields_cache) {
272 "tableview_id" => $this->
id,
274 'il_dcl_tfield_set.table_id' => $this->
getTableId(),
276 )->innerjoin(
'il_dcl_tfield_set',
'field',
'field',
array())->orderBy(
'il_dcl_tfield_set.field_order')->get();
278 foreach ($visible as $field_rec) {
279 $fields[] = $field_rec->getFieldObject();
281 $this->visible_fields_cache = $fields;
291 'tableview_id' => $this->
getId(),
292 'il_dcl_tfield_set.table_id' => $this->
getTableId(),
294 )->innerjoin(
'il_dcl_tfield_set',
'field',
'field',
array(
'field_order'))->orderBy(
'field_order')->get();
301 public function create($create_default_settings =
true) {
303 if ($create_default_settings) {
315 foreach ($table->getFieldIds() as $field_id) {
321 if (!$table->getPublicCommentsEnabled()) {
335 'tableview_id' => $this->
id,
336 'field' => $field_id,
341 $field_set->setTableviewId($this->
id);
342 $field_set->setField($field_id);
344 $field_set->setFilterChangeable(
true);
345 $field_set->create();
365 $new_fieldsetting->setTableviewId($this->
getId());
366 if ($new_fields[$orig_fieldsetting->getField()]) {
368 $new_fieldsetting->setField($new_fields[$orig_fieldsetting->getField()]->getId());
371 $new_fieldsetting->setField($orig_fieldsetting->getField());
373 $new_fieldsetting->cloneStructure($orig_fieldsetting);
393 return self::where(
array(
'table_id' =>
$table_id))->orderBy(
'tableview_order')->get();
403 return self::where(
array(
'table_id' =>
$table_id))->orderBy(
'tableview_order')->count();
415 return $standardview;
419 $rbacreview = $DIC[
'rbacreview'];
421 foreach ($rbacreview->getParentRoleIds(
$_GET[
'ref_id']) as $role_array) {
422 $roles[] = $role_array[
'obj_id'];
427 if (
$_GET[
'ref_id']) {
429 $rbacreview = $DIC[
'rbacreview'];
431 foreach ($rbacreview->getParentRoleIds(
$_GET[
'ref_id']) as $role_array) {
432 $roles[] = $role_array[
'obj_id'];
434 $view->setRoles(array_merge(
$roles, $rbacreview->getLocalRoles(
$_GET[
'ref_id'])));
439 $view->setTitle(
$lng->txt(
'dcl_title_standardview'));
440 $view->setTableviewOrder(10);
441 $view->create($create_default_settings);
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.
setTableviewOrder($tableview_order)
static returnDbTableName()
create($create_default_settings=true)
createDefaultSettings()
create default ilDclTableViewFieldSetting entries
static _isStandardField($field_id)
Create styles array
The data for the language used.
static createOrGetStandardView($table_id, $create_default_settings=true)
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.
Class ilDclDetailedViewDefinition.