4 require_once (
"./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldModel.php");
5 require_once (
"./Modules/DataCollection/classes/Table/class.ilDclTable.php");
6 require_once(
"./Modules/DataCollection/classes/Fields/Base/class.ilDclDatatype.php");
7 require_once (
"./Modules/DataCollection/classes/Helpers/class.ilDclCache.php");
8 require_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
9 require_once(
'./Modules/DataCollection/classes/Fields/class.ilDclFieldListTableGUI.php');
63 $ilToolbar = $DIC[
'ilToolbar'];
65 $ilTabs = $DIC[
'ilTabs'];
66 $locator = $DIC[
'ilLocator'];
68 $table_id =
$_GET[
'table_id'];
70 $this->table_id = $table_id;
71 $this->parent_obj = $a_parent_obj;
72 $this->obj_id = $a_parent_obj->obj_id;
76 $this->tabs = $ilTabs;
77 $this->toolbar = $ilToolbar;
79 $this->ctrl->saveParameter(
'ilDclTableEditGUI',
'table_id');
80 $locator->addItem(
ilDclCache::getTableCache($this->table_id)->getTitle(), $this->ctrl->getLinkTargetByClass(
'ilDclTableEditGUI',
'edit'));
81 $this->tpl->setLocator();
85 $this->ctrl->redirectByClass(
'ildclrecordlistgui',
'listRecords');
95 $cmd = $this->ctrl->getCmd(
'listFields');
110 foreach ($field_ids as $field_id) {
111 $table->deleteField($field_id);
114 $this->ctrl->redirect($this,
'listFields');
120 public function confirmDeleteFields() {
121 $this->tabs->clearSubTabs();
123 $conf->setFormAction($this->ctrl->getFormAction($this));
124 $conf->setHeaderText($this->lng->txt(
'dcl_confirm_delete_fields'));
126 foreach ($field_ids as $field_id) {
129 $conf->addItem(
'dcl_field_ids[]', $field_id, $field->getTitle());
131 $conf->setConfirm($this->lng->txt(
'delete'),
'deleteFields');
132 $conf->setCancel($this->lng->txt(
'cancel'),
'listFields');
133 $this->tpl->setContent($conf->getHTML());
142 $fields = $table->getFields();
146 foreach (array_keys($order) as $field_id) {
147 $order[$field_id] = $val;
152 foreach($fields as $field)
154 $field->setLocked(
$_POST[
'locked'][$field->getId()] ==
"on");
155 $field->setExportable(
$_POST[
'exportable'][$field->getId()] ==
"on");
156 $field->setOrder($order[$field->getId()]);
160 $table->reloadFields();
172 $add_new->setPrimary(
true);
173 $add_new->setCaption(
"dcl_add_new_field");
174 $add_new->setUrl($this->ctrl->getLinkTargetByClass(
'ildclfieldeditgui',
'create'));
175 $this->toolbar->addStickyItem($add_new);
177 $this->toolbar->addSeparator();
180 $tables = $this->parent_obj->getDataCollectionObject()->getTables();
182 foreach($tables as $table)
184 $options[$table->getId()] = $table->getTitle();
186 include_once
'./Services/Form/classes/class.ilSelectInputGUI.php';
188 $table_selection->setOptions(
$options);
189 $table_selection->setValue($this->table_id);
191 $this->toolbar->setFormAction($this->ctrl->getFormActionByClass(
"ilDclFieldListGUI",
"doTableSwitch"));
192 $this->toolbar->addText($this->lng->txt(
"dcl_select"));
193 $this->toolbar->addInputItem($table_selection);
194 $this->toolbar->addFormButton($this->lng->txt(
'change'),
'doTableSwitch');
198 $this->tpl->setContent($list->getHTML());
206 $this->ctrl->setParameterByClass(
"ilObjDataCollectionGUI",
"table_id",
$_POST[
'table_id']);
207 $this->ctrl->redirectByClass(
"ilDclFieldListGUI",
"listFields");
224 return $this->parent_obj->getDataCollectionObject();
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getFieldCache($field_id=0)
static hasAccessToEditTable($ref_id, $table_id)
static getTableCache($table_id=0)
getDataCollectionObject()
if(!is_array($argv)) $options
deleteFields()
Delete multiple fields.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
executeCommand()
execute command
Class ilDclFieldListTableGUI.
__construct(ilDclTableListGUI $a_parent_obj)
Constructor.
Confirmation screen class.