23 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
24 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
64 $this->lng->loadLanguageModule(
'ps');
69 $this->tabs_gui = $ilTabs;
71 $this->obj_id = $a_obj_id;
75 $this->ref_id = end($refs);
88 if(!$ilAccess->checkAccess(
'write',
'',$this->ref_id))
90 $ilErr->raiseError($lng->txt(
'permission_denied'),$ilErr->WARNING);
93 $cmd = $this->ctrl->getCmd();
95 switch($next_class = $this->ctrl->getNextClass($this))
137 $ilToolbar->addButton(
138 $this->lng->txt(
'ps_cdf_add_field'),
139 $this->ctrl->getLinkTarget($this,
'addField')
142 include_once
'./Services/Membership/classes/class.ilObjectCustomUserFieldsTableGUI.php';
145 $this->tpl->setContent($table->getHTML());
155 foreach($fields as $field_obj)
157 $field_obj->enableRequired((
bool) isset(
$_POST[
'required'][$field_obj->getId()]));
158 $field_obj->update();
173 if(!count(
$_POST[
'field_ids']))
179 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
181 $confirm->setFormAction($this->ctrl->getFormAction($this));
182 $confirm->setHeaderText($this->lng->txt(
'ps_cdf_delete_sure'));
184 foreach(
$_POST[
'field_ids'] as $field_id)
188 $confirm->addItem(
'field_ids[]', $field_id, $tmp_field->getName());
191 $confirm->setConfirm($this->lng->txt(
'delete'),
'deleteFields');
192 $confirm->setCancel($this->lng->txt(
'cancel'),
'listFields');
193 $this->tpl->setContent($confirm->getHTML());
202 foreach((array)
$_POST[
'field_ids'] as $field_id)
205 $tmp_field->delete();
223 $this->form->getItemByPostVar(
'va')->setValues(array(
''));
225 $this->tpl->setContent($this->form->getHTML());
235 if($this->form->checkInput())
238 $udf->setName($this->form->getInput(
'na'));
239 $udf->setType($this->form->getInput(
'ty'));
240 $udf->setValues($udf->prepareValues($this->form->getInput(
'va')));
241 $udf->enableRequired($this->form->getInput(
're'));
250 $this->form->setValuesByPost();
251 $this->tpl->setContent($this->form->getHTML());
271 $this->form->getItemByPostVar(
'na')->setValue($udf->getName());
272 $this->form->getItemByPostVar(
'ty')->setValue($udf->getType());
273 $this->form->getItemByPostVar(
're')->setChecked($udf->isRequired());
274 $this->form->getItemByPostVar(
'va')->setValues($udf->getValues());
276 $this->tpl->setContent($this->form->getHTML());
287 if($this->form->checkInput())
290 $udf->setName($this->form->getInput(
'na'));
291 $udf->setType($this->form->getInput(
'ty'));
292 $udf->setValues($udf->prepareValues($this->form->getInput(
'va')));
293 $udf->enableRequired($this->form->getInput(
're'));
304 $this->form->setValuesByPost();
305 $this->tpl->setContent($this->form->getHTML());
319 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
320 $this->form =
new ilPropertyFormGUI();
324 case self::MODE_CREATE:
325 $this->form->setFormAction($this->ctrl->getFormAction($this));
326 $this->form->setTitle($this->lng->txt(
'ps_cdf_add_field'));
327 $this->form->addCommandButton(
'saveField', $this->lng->txt(
'save'));
328 $this->form->addCommandButton(
'listFields', $this->lng->txt(
'cancel'));
331 case self::MODE_UPDATE:
332 $this->ctrl->setParameter($this,
'field_id',(
int)
$_REQUEST[
'field_id']);
333 $this->form->setFormAction($this->ctrl->getFormAction($this));
334 $this->form->setTitle($this->lng->txt(
'ps_cdf_edit_field'));
335 $this->form->addCommandButton(
'updateField', $this->lng->txt(
'save'));
336 $this->form->addCommandButton(
'listFields', $this->lng->txt(
'cancel'));
343 $na->setMaxLength(255);
344 $na->setRequired(
true);
345 $this->form->addItem($na);
350 $this->form->addItem($ty);
354 $ty->addOption($ty_te);
358 $ty->addOption($ty_se);
363 $ty_se_mu->setSize(32);
364 $ty_se_mu->setMaxLength(128);
365 $ty_se->addSubItem($ty_se_mu);
371 $this->form->addItem($re);