23 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
24 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
63 $this->lng->loadLanguageModule(
'ps');
68 $this->tabs_gui = $ilTabs;
70 $this->obj_id = $a_obj_id;
81 $cmd = $this->ctrl->getCmd();
83 switch($next_class = $this->ctrl->getNextClass($this))
125 $ilToolbar->addButton(
126 $this->lng->txt(
'ps_cdf_add_field'),
127 $this->ctrl->getLinkTarget($this,
'addField')
130 include_once
'./Services/Membership/classes/class.ilObjectCustomUserFieldsTableGUI.php';
133 $this->tpl->setContent($table->getHTML());
143 foreach($fields as $field_obj)
145 $field_obj->enableRequired((
bool) isset(
$_POST[
'required'][$field_obj->getId()]));
146 $field_obj->update();
161 if(!count(
$_POST[
'field_ids']))
167 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
169 $confirm->setFormAction($this->ctrl->getFormAction($this));
170 $confirm->setHeaderText($this->lng->txt(
'ps_cdf_delete_sure'));
172 foreach(
$_POST[
'field_ids'] as $field_id)
176 $confirm->addItem(
'field_ids[]', $field_id, $tmp_field->getName());
179 $confirm->setConfirm($this->lng->txt(
'delete'),
'deleteFields');
180 $confirm->setCancel($this->lng->txt(
'cancel'),
'listFields');
181 $this->tpl->setContent($confirm->getHTML());
190 foreach((array)
$_POST[
'field_ids'] as $field_id)
193 $tmp_field->delete();
211 $this->form->getItemByPostVar(
'va')->setValues(array(
''));
213 $this->tpl->setContent($this->form->getHTML());
223 if($this->form->checkInput())
226 $udf->setName($this->form->getInput(
'na'));
227 $udf->setType($this->form->getInput(
'ty'));
228 $udf->setValues($udf->prepareValues($this->form->getInput(
'va')));
229 $udf->enableRequired($this->form->getInput(
're'));
238 $this->form->setValuesByPost();
239 $this->tpl->setContent($this->form->getHTML());
259 $this->form->getItemByPostVar(
'na')->setValue($udf->getName());
260 $this->form->getItemByPostVar(
'ty')->setValue($udf->getType());
261 $this->form->getItemByPostVar(
're')->setChecked($udf->isRequired());
262 $this->form->getItemByPostVar(
'va')->setValues($udf->getValues());
264 $this->tpl->setContent($this->form->getHTML());
275 if($this->form->checkInput())
278 $udf->setName($this->form->getInput(
'na'));
279 $udf->setType($this->form->getInput(
'ty'));
280 $udf->setValues($udf->prepareValues($this->form->getInput(
'va')));
281 $udf->enableRequired($this->form->getInput(
're'));
292 $this->form->setValuesByPost();
293 $this->tpl->setContent($this->form->getHTML());
307 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
308 $this->form =
new ilPropertyFormGUI();
312 case self::MODE_CREATE:
313 $this->form->setFormAction($this->ctrl->getFormAction($this));
314 $this->form->setTitle($this->lng->txt(
'ps_cdf_add_field'));
315 $this->form->addCommandButton(
'saveField', $this->lng->txt(
'save'));
316 $this->form->addCommandButton(
'listFields', $this->lng->txt(
'cancel'));
319 case self::MODE_UPDATE:
320 $this->ctrl->setParameter($this,
'field_id',(
int)
$_REQUEST[
'field_id']);
321 $this->form->setFormAction($this->ctrl->getFormAction($this));
322 $this->form->setTitle($this->lng->txt(
'ps_cdf_edit_field'));
323 $this->form->addCommandButton(
'updateField', $this->lng->txt(
'save'));
324 $this->form->addCommandButton(
'listFields', $this->lng->txt(
'cancel'));
331 $na->setMaxLength(255);
332 $na->setRequired(
true);
333 $this->form->addItem($na);
338 $this->form->addItem($ty);
342 $ty->addOption($ty_te);
346 $ty->addOption($ty_se);
351 $ty_se_mu->setSize(32);
352 $ty_se_mu->setMaxLength(128);
353 $ty_se->addSubItem($ty_se_mu);
359 $this->form->addItem($re);