23 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
24 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
66 $ilTabs = $DIC[
'ilTabs'];
69 $this->lng->loadLanguageModule(
'ps');
74 $this->tabs_gui = $ilTabs;
76 $this->obj_id = $a_obj_id;
80 $this->ref_id = end($refs);
94 $ilAccess = $DIC[
'ilAccess'];
97 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
101 $cmd = $this->ctrl->getCmd();
103 switch ($next_class = $this->ctrl->getNextClass($this)) {
142 $ilToolbar = $DIC[
'ilToolbar'];
144 $ilToolbar->addButton(
145 $this->lng->txt(
'ps_cdf_add_field'),
146 $this->ctrl->getLinkTarget($this,
'addField')
149 include_once
'./Services/Membership/classes/class.ilObjectCustomUserFieldsTableGUI.php';
152 $this->tpl->setContent(
$table->getHTML());
162 foreach ($fields as $field_obj) {
163 $field_obj->enableRequired((
bool) isset(
$_POST[
'required'][$field_obj->getId()]));
164 $field_obj->update();
168 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
179 if (!count(
$_POST[
'field_ids'])) {
184 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
186 $confirm->setFormAction($this->ctrl->getFormAction($this));
187 $confirm->setHeaderText($this->lng->txt(
'ps_cdf_delete_sure'));
189 foreach (
$_POST[
'field_ids'] as $field_id) {
192 $confirm->addItem(
'field_ids[]', $field_id, $tmp_field->getName());
195 $confirm->setConfirm($this->lng->txt(
'delete'),
'deleteFields');
196 $confirm->setCancel($this->lng->txt(
'cancel'),
'listFields');
197 $this->tpl->setContent($confirm->getHTML());
206 foreach ((array)
$_POST[
'field_ids'] as $field_id) {
208 $tmp_field->delete();
213 ilUtil::sendSuccess($this->lng->txt(
'ps_cdf_deleted'));
226 $this->form->getItemByPostVar(
'va')->setValues(array(
''));
228 $this->tpl->setContent($this->form->getHTML());
239 if ($this->form->checkInput()) {
241 $udf->setName($this->form->getInput(
'na'));
242 $udf->setType($this->form->getInput(
'ty'));
243 $udf->setValues($udf->prepareValues($this->form->getInput(
'va')));
244 $udf->setValueOptions($this->form->getItemByPostVar(
'va')->getOpenAnswerIndexes());
245 $udf->enableRequired($this->form->getInput(
're'));
248 ilUtil::sendSuccess($this->lng->txt(
'ps_cdf_added_field'));
256 $this->form->setValuesByPost();
257 $this->tpl->setContent($this->form->getHTML());
268 if (!$_REQUEST[
'field_id']) {
276 $this->form->getItemByPostVar(
'na')->setValue($udf->getName());
277 $this->form->getItemByPostVar(
'ty')->setValue($udf->getType());
278 $this->form->getItemByPostVar(
're')->setChecked($udf->isRequired());
279 $this->form->getItemByPostVar(
'va')->setValues($udf->getValues());
280 $this->form->getItemByPostVar(
'va')->setOpenAnswerIndexes($udf->getValueOptions());
282 $this->tpl->setContent($this->form->getHTML());
293 if ($this->form->checkInput()) {
295 $udf->setName($this->form->getInput(
'na'));
296 $udf->setType($this->form->getInput(
'ty'));
297 $prepared = $udf->prepareValues($this->form->getInput(
'va'));
298 $udf->setValues($prepared);
299 $udf->setValueOptions($this->form->getItemByPostVar(
'va')->getOpenAnswerIndexes());
300 $udf->enableRequired($this->form->getInput(
're'));
305 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
311 $this->form->setValuesByPost();
312 $this->tpl->setContent($this->form->getHTML());
325 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
326 $this->form =
new ilPropertyFormGUI();
329 case self::MODE_CREATE:
330 $this->form->setFormAction($this->ctrl->getFormAction($this));
331 $this->form->setTitle($this->lng->txt(
'ps_cdf_add_field'));
332 $this->form->addCommandButton(
'saveField', $this->lng->txt(
'save'));
333 $this->form->addCommandButton(
'listFields', $this->lng->txt(
'cancel'));
336 case self::MODE_UPDATE:
337 $this->ctrl->setParameter($this,
'field_id', (
int) $_REQUEST[
'field_id']);
338 $this->form->setFormAction($this->ctrl->getFormAction($this));
339 $this->form->setTitle($this->lng->txt(
'ps_cdf_edit_field'));
340 $this->form->addCommandButton(
'updateField', $this->lng->txt(
'save'));
341 $this->form->addCommandButton(
'listFields', $this->lng->txt(
'cancel'));
348 $na->setMaxLength(255);
349 $na->setRequired(
true);
350 $this->form->addItem($na);
355 $this->form->addItem($ty);
357 if ($a_mode == self::MODE_UPDATE) {
358 $ty->setDisabled(
true);
363 $ty->addOption($ty_te);
367 $ty->addOption($ty_se);
370 include_once
'./Services/Form/classes/class.ilSelectBuilderInputGUI.php';
373 $ty_se_mu->setRequired(
true);
374 $ty_se_mu->setSize(32);
375 $ty_se_mu->setMaxLength(128);
376 $ty_se->addSubItem($ty_se_mu);
381 $this->form->addItem($re);
390 $GLOBALS[
'DIC'][
'ilCtrl']->saveParameter($this,
'member_id');
392 $GLOBALS[
'DIC'][
'ilTabs']->clearTargets();
393 $GLOBALS[
'DIC'][
'ilTabs']->clearSubTabs();
394 $GLOBALS[
'DIC'][
'ilTabs']->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'cancelEditMember'));
413 $GLOBALS[
'DIC'][
'ilCtrl']->returnToParent($this);
422 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
424 $form->setFormAction(
$GLOBALS[
'DIC'][
'ilCtrl']->getFormAction($this));
430 include_once
'./Services/Membership/classes/class.ilMemberAgreementGUI.php';
433 $form->addCommandButton(
'saveMember', $this->lng->txt(
'save'));
434 $form->addCommandButton(
'cancelEditMember', $this->lng->txt(
'cancel'));
445 $GLOBALS[
'DIC'][
'ilCtrl']->saveParameter($this,
'member_id');
448 if (
$form->checkInput()) {
450 include_once
'./Services/Membership/classes/class.ilObjectCustomUserFieldHistory.php';
453 $history->setUpdateUser(
$ilUser->getId());
457 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
458 $GLOBALS[
'DIC'][
'ilCtrl']->returnToParent($this);
462 $form->setValuesByPost();
updateField()
Update field definition.
setAllowMove($a_allow_move)
Set allow move.
static _lookupName($a_user_id)
lookup user name
This class represents an option in a radio group.
editMember(ilPropertyFormGUI $form=null)
Edit Member.
initFieldForm($a_mode)
Init/create property form for fields.
addField()
Show field creation form.
Editing history for object custom user fields.
static addCustomFields($form, $a_obj_id, $a_type, $a_mode='user')
Add custom course fields.
deleteFields()
Delete selected fields.
initMemberForm()
Init member form.
static _getAllReferences($a_id)
get all reference ids of object
Table presentation of course/group relevant user data fields
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
editField()
Edit one field.
__construct($a_obj_id)
Constructor.
saveFields()
Save Field settings (currently only required status)
setSize($a_size)
Set Size.
This class represents a text property in a property form.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _hasAgreementsByObjId($a_obj_id)
Check if there is any user agreement.
static saveCourseDefinedFields(ilPropertyFormGUI $form, $a_obj_id, $a_usr_id=0)
Save course defined fields.
listFields()
List existing custom fields.
cancelEditMember()
Cancel editing.
executeCommand()
Execute Command.
confirmDeleteFields()
Show delete confirmation screen.
getObjId()
Get obj_id of container.
static setCourseDefinedFieldValues(ilPropertyFormGUI $form, $a_obj_id, $a_usr_id=0)
if(empty($password)) $table
show()
Show list of custom fields.
static _deleteByObjId($a_obj_id)
Delete all entries by obj_id.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Confirmation screen class.
static _getFields($a_container_id, $a_sort=IL_CDF_SORT_NAME)
Get all fields of a container.