4 require_once (
"./Modules/DataCollection/classes/class.ilDataCollectionField.php");
5 require_once (
"./Modules/DataCollection/classes/class.ilDataCollectionTable.php");
6 include_once(
"class.ilDataCollectionDatatype.php");
7 require_once
"class.ilDataCollectionCache.php";
8 require_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
63 $this->main_table_id = $a_parent_obj->object->getMainTableId();
64 $this->table_id = $table_id;
65 $this->parent_obj = $a_parent_obj;
66 $this->obj_id = $a_parent_obj->obj_id;
70 $this->tabs = $ilTabs;
71 $this->toolbar = $ilToolbar;
74 $this->ctrl->redirectByClass(
'ildatacollectionrecordlistgui',
'listRecords');
84 $cmd = $this->ctrl->getCmd();
97 $field_ids = isset(
$_POST[
'dcl_field_ids']) ?
$_POST[
'dcl_field_ids'] : array();
99 foreach ($field_ids as $field_id) {
100 $table->deleteField($field_id);
103 $this->ctrl->redirect($this,
'listFields');
109 public function confirmDeleteFields() {
110 $this->tabs->clearSubTabs();
112 $conf->setFormAction($this->ctrl->getFormAction($this));
113 $conf->setHeaderText($this->lng->txt(
'dcl_confirm_delete_fields'));
114 $field_ids = isset(
$_POST[
'dcl_field_ids']) ?
$_POST[
'dcl_field_ids'] : array();
115 foreach ($field_ids as $field_id) {
118 $conf->addItem(
'dcl_field_ids[]', $field_id, $field->getTitle());
120 $conf->setConfirm($this->lng->txt(
'delete'),
'deleteFields');
121 $conf->setCancel($this->lng->txt(
'cancel'),
'listFields');
122 $this->tpl->setContent($conf->getHTML());
131 $fields = $table->getFields();
133 foreach($fields as $field)
135 $field->setVisible(
$_POST[
'visible'][$field->getId()] ==
"on");
136 $field->setEditable(
$_POST[
'editable'][$field->getId()] ==
"on");
137 $field->setFilterable(
$_POST[
'filterable'][$field->getId()] ==
"on");
138 $field->setLocked(
$_POST[
'locked'][$field->getId()] ==
"on");
139 $field->setExportable(
$_POST[
'exportable'][$field->getId()] ==
"on");
140 $field->setOrder(
$_POST[
'order'][$field->getId()]);
143 $table->buildOrderFields();
154 require_once(
"./Modules/DataCollection/classes/class.ilDataCollectionTable.php");
155 $tables = $this->parent_obj->object->getTables();
157 foreach($tables as $table)
159 $options[$table->getId()] = $table->getTitle();
161 include_once
'./Services/Form/classes/class.ilSelectInputGUI.php';
163 $table_selection->setOptions(
$options);
164 $table_selection->setValue($this->table_id);
166 $this->toolbar->setFormAction($this->ctrl->getFormActionByClass(
"ilDataCollectionFieldListGUI",
"doTableSwitch"));
167 $this->toolbar->addText($this->lng->txt(
"dcl_table"));
168 $this->toolbar->addInputItem($table_selection);
169 $this->toolbar->addFormButton($this->lng->txt(
'change'),
'doTableSwitch');
170 $this->toolbar->addSeparator();
171 $this->toolbar->addButton($this->lng->txt(
"dcl_add_new_table"), $this->ctrl->getLinkTargetByClass(
"ildatacollectiontableeditgui",
"create"));
172 $this->toolbar->addSeparator();
173 $this->ctrl->setParameterByClass(
"ildatacollectiontableeditgui",
"table_id", $this->table_id);
174 $this->toolbar->addButton($this->lng->txt(
"dcl_table_settings"), $this->ctrl->getLinkTargetByClass(
"ildatacollectiontableeditgui",
"edit"));
175 $this->toolbar->addButton($this->lng->txt(
"dcl_delete_table"), $this->ctrl->getLinkTargetByClass(
"ildatacollectiontableeditgui",
"confirmDelete"));
176 $this->toolbar->addButton($this->lng->txt(
"dcl_add_new_field"), $this->ctrl->getLinkTargetByClass(
"ildatacollectionfieldeditgui",
"create"));
181 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionFieldListTableGUI.php');
184 $this->tpl->setContent($list->getHTML());
193 $this->ctrl->setParameterByClass(
"ilObjDataCollectionGUI",
"table_id",
$_POST[
'table_id']);
194 $this->ctrl->redirectByClass(
"ilDataCollectionFieldListGUI",
"listFields");
202 $ref_id = $this->parent_obj->getDataCollectionObject()->getRefId();
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilDataCollectionFieldListTableGUI.
executeCommand()
execute command
Class ilDataCollectionFieldListGUI.
Class ilObjDataCollectionGUI.
static getFieldCache($field_id=0)
if(!is_array($argv)) $options
deleteFields()
Delete multiple fields.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
__construct(ilObjDataCollectionGUI $a_parent_obj, $table_id)
Constructor.
static _hasWriteAccess($ref)
static getTableCache($table_id=0)
Confirmation screen class.