5 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
6 require_once
'class.ilDataCollectionCache.php';
30 parent::__construct($a_parent_obj, $a_parent_cmd);
32 $this->parent_obj = $a_parent_obj;
35 $this->
setId(
'dcl_field_list');
37 $this->
addColumn($lng->txt(
'dcl_order'), NULL,
'30px');
38 $this->
addColumn($lng->txt(
'dcl_title'), NULL,
'auto');
39 $this->
addColumn($lng->txt(
'dcl_visible'), NULL,
'30px');
40 $this->
addColumn($lng->txt(
'dcl_filter'), NULL,
'30px');
41 $this->
addColumn($lng->txt(
'dcl_locked'), NULL,
'30px',
false,
"", $lng->txt(
'dcl_locked_tooltip'));
42 $this->
addColumn($lng->txt(
'dcl_in_export'), NULL,
'30px');
43 $this->
addColumn($lng->txt(
'dcl_description'), NULL,
'auto');
44 $this->
addColumn($lng->txt(
'dcl_field_datatype'), NULL,
'auto');
45 $this->
addColumn($lng->txt(
'dcl_required'), NULL,
'auto');
46 $this->
addColumn($lng->txt(
'dcl_unique'), NULL,
'auto');
47 $this->
addColumn($lng->txt(
'actions'), NULL,
'30px');
49 if (count($this->table->getRecordFields())) {
51 $this->
addMultiCommand(
'confirmDeleteFields', $lng->txt(
'dcl_delete_fields'));
54 $ilCtrl->setParameterByClass(
'ildatacollectionfieldeditgui',
'table_id', $this->parent_obj->table_id);
55 $ilCtrl->setParameterByClass(
'ildatacollectionfieldlistgui',
'table_id', $this->parent_obj->table_id);
57 $this->
setFormAction($ilCtrl->getFormActionByClass(
'ildatacollectionfieldlistgui'));
75 $this->
setData($this->table->getFields());
76 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionDatatype.php');
77 $this->
setTitle($lng->txt(
'dcl_table_list_fields'));
78 $this->
setRowTemplate(
'tpl.field_list_row.html',
'Modules/DataCollection');
79 $this->
setStyle(
'table', $this->
getStyle(
'table') .
' ' .
'dcl_record_list');
90 $this->tpl->setVariable(
'FIELD_ID', $a_set->
getId());
93 $this->tpl->setVariable(
'NAME',
'order[' . $a_set->
getId() .
']');
94 $this->tpl->setVariable(
'VALUE', $this->order);
96 $this->tpl->setVariable(
'CHECKBOX_VISIBLE',
'visible[' . $a_set->
getId() .
']');
98 $this->tpl->setVariable(
'CHECKBOX_VISIBLE_CHECKED',
'checked');
103 $show_exportable =
true;
107 $show_filter =
false;
115 $show_filter =
false;
118 if ($a_set->
getId() ==
'comments') {
119 $show_filter =
false;
120 $show_exportable =
false;
123 $this->tpl->setVariable(
'CHECKBOX_FILTERABLE',
'filterable[' . $a_set->
getId() .
']');
125 $this->tpl->setVariable(
'CHECKBOX_FILTERABLE_CHECKED',
'checked');
128 $this->tpl->setVariable(
'NO_FILTER',
'');
131 if ($show_exportable) {
132 $this->tpl->setVariable(
'CHECKBOX_EXPORTABLE',
'exportable[' . $a_set->
getId() .
']');
134 $this->tpl->setVariable(
'CHECKBOX_EXPORTABLE_CHECKED',
'checked');
137 $this->tpl->setVariable(
'NO_FILTER_EXPORTABLE',
'');
141 $this->tpl->setVariable(
'CHECKBOX_NAME_LOCKED',
'locked[' . $a_set->
getId() .
']');
143 $this->tpl->setVariable(
'CHECKBOX_CHECKED_LOCKED',
'checked');
146 $this->tpl->setVariable(
'NOT_LOCKED',
'');
149 $this->order = $this->order + 10;
150 $this->tpl->setVariable(
'ORDER_NAME',
'order[' . $a_set->
getId() .
']');
151 $this->tpl->setVariable(
'ORDER_VALUE', $this->order);
153 $this->tpl->setVariable(
'TITLE', $a_set->
getTitle());
174 $this->tpl->setVariable(
'REQUIRED', $required);
175 $this->tpl->setVariable(
'UNIQUE', $uniq);
177 $this->tpl->setVariable(
'NO_REQUIRED',
'');
178 $this->tpl->setVariable(
'NO_UNIQUE',
'');
181 $ilCtrl->setParameterByClass(
'ildatacollectionfieldeditgui',
'field_id', $a_set->
getId());
184 include_once(
'./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php');
186 $alist->setId($a_set->
getId());
187 $alist->setListTitle($lng->txt(
'actions'));
189 if ($this->table->hasPermissionToFields($this->parent_obj->parent_obj->ref_id)) {
190 $alist->addItem($lng->txt(
'edit'),
'edit', $ilCtrl->getLinkTargetByClass(
'ildatacollectionfieldeditgui',
'edit'));
191 $alist->addItem($lng->txt(
'delete'),
'delete', $ilCtrl->getLinkTargetByClass(
'ildatacollectionfieldeditgui',
'confirmDelete'));
194 $this->tpl->setVariable(
'ACTIONS', $alist->getHTML());
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setFormName($a_formname)
Set Form name.
setExternalSorting($a_val)
Set external sorting.
setStyle($a_element, $a_style)
setShowTemplates($a_value)
Toggle templates.
getDatatypeId()
Get datatype_id.
Class ilDataCollectionFieldListTableGUI.
setExternalSegmentation($a_val)
Set external segmentation.
Class ilDataCollectionFieldListGUI.
getRequired()
Get Required Required.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static getFieldCache($field_id=0)
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
addMultiCommand($a_cmd, $a_text)
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Class ilDataCollectionField.
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setEnableHeader($a_enableheader)
Set Enable Header.
fillRow(ilDataCollectionField $a_set)
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setEnableTitle($a_enabletitle)
Set Enable Title.
const INPUTFORMAT_REFERENCE
static getTableCache($table_id=0)
getDescription()
Get description.
__construct(ilDataCollectionFieldListGUI $a_parent_obj, $a_parent_cmd, $table_id)