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)) {
89 $ilErr->raiseError($lng->txt(
'permission_denied'), $ilErr->WARNING);
92 $cmd = $this->ctrl->getCmd();
94 switch ($next_class = $this->ctrl->getNextClass($this)) {
133 $ilToolbar->addButton(
134 $this->lng->txt(
'ps_cdf_add_field'),
135 $this->ctrl->getLinkTarget($this,
'addField')
138 include_once
'./Services/Membership/classes/class.ilObjectCustomUserFieldsTableGUI.php';
141 $this->tpl->setContent(
$table->getHTML());
151 foreach ($fields as $field_obj) {
152 $field_obj->enableRequired((
bool) isset(
$_POST[
'required'][$field_obj->getId()]));
153 $field_obj->update();
168 if (!count(
$_POST[
'field_ids'])) {
173 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
175 $confirm->setFormAction($this->ctrl->getFormAction($this));
176 $confirm->setHeaderText($this->lng->txt(
'ps_cdf_delete_sure'));
178 foreach (
$_POST[
'field_ids'] as $field_id) {
181 $confirm->addItem(
'field_ids[]', $field_id, $tmp_field->getName());
184 $confirm->setConfirm($this->lng->txt(
'delete'),
'deleteFields');
185 $confirm->setCancel($this->lng->txt(
'cancel'),
'listFields');
186 $this->tpl->setContent($confirm->getHTML());
195 foreach ((
array)
$_POST[
'field_ids'] as $field_id) {
197 $tmp_field->delete();
215 $this->form->getItemByPostVar(
'va')->setValues(
array(
''));
217 $this->tpl->setContent($this->form->getHTML());
226 $GLOBALS[
'ilLog']->write(__METHOD__ .
': ' . print_r(
$_POST,
true));
229 if ($this->form->checkInput()) {
231 $udf->setName($this->form->getInput(
'na'));
232 $udf->setType($this->form->getInput(
'ty'));
233 $udf->setValues($udf->prepareValues($this->form->getInput(
'va')));
234 $udf->setValueOptions($this->form->getItemByPostVar(
'va')->getOpenAnswerIndexes());
235 $udf->enableRequired($this->form->getInput(
're'));
246 $this->form->setValuesByPost();
247 $this->tpl->setContent($this->form->getHTML());
258 if (!$_REQUEST[
'field_id']) {
266 $this->form->getItemByPostVar(
'na')->setValue($udf->getName());
267 $this->form->getItemByPostVar(
'ty')->setValue($udf->getType());
268 $this->form->getItemByPostVar(
're')->setChecked($udf->isRequired());
269 $this->form->getItemByPostVar(
'va')->setValues($udf->getValues());
270 $this->form->getItemByPostVar(
'va')->setOpenAnswerIndexes($udf->getValueOptions());
272 $this->tpl->setContent($this->form->getHTML());
281 $GLOBALS[
'ilLog']->write(__METHOD__ .
': ' . print_r(
$_POST,
true));
285 if ($this->form->checkInput()) {
287 $udf->setName($this->form->getInput(
'na'));
288 $udf->setType($this->form->getInput(
'ty'));
289 $prepared = $udf->prepareValues($this->form->getInput(
'va'));
290 $udf->setValues($prepared);
291 $udf->setValueOptions($this->form->getItemByPostVar(
'va')->getOpenAnswerIndexes());
292 $udf->enableRequired($this->form->getInput(
're'));
303 $this->form->setValuesByPost();
304 $this->tpl->setContent($this->form->getHTML());
317 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
318 $this->form =
new ilPropertyFormGUI();
321 case self::MODE_CREATE:
322 $this->form->setFormAction($this->ctrl->getFormAction($this));
323 $this->form->setTitle($this->lng->txt(
'ps_cdf_add_field'));
324 $this->form->addCommandButton(
'saveField', $this->lng->txt(
'save'));
325 $this->form->addCommandButton(
'listFields', $this->lng->txt(
'cancel'));
328 case self::MODE_UPDATE:
329 $this->ctrl->setParameter($this,
'field_id', (
int) $_REQUEST[
'field_id']);
330 $this->form->setFormAction($this->ctrl->getFormAction($this));
331 $this->form->setTitle($this->lng->txt(
'ps_cdf_edit_field'));
332 $this->form->addCommandButton(
'updateField', $this->lng->txt(
'save'));
333 $this->form->addCommandButton(
'listFields', $this->lng->txt(
'cancel'));
340 $na->setMaxLength(255);
341 $na->setRequired(
true);
342 $this->form->addItem($na);
347 $this->form->addItem($ty);
349 if ($a_mode == self::MODE_UPDATE) {
350 $ty->setDisabled(
true);
355 $ty->addOption($ty_te);
359 $ty->addOption($ty_se);
362 include_once
'./Services/Form/classes/class.ilSelectBuilderInputGUI.php';
365 $ty_se_mu->setRequired(
true);
366 $ty_se_mu->setSize(32);
367 $ty_se_mu->setMaxLength(128);
368 $ty_se->addSubItem($ty_se_mu);
373 $this->form->addItem($re);
382 $GLOBALS[
'ilCtrl']->saveParameter($this,
'member_id');
386 $GLOBALS[
'ilTabs']->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'cancelEditMember'));
405 $GLOBALS[
'ilCtrl']->returnToParent($this);
414 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
416 $form->setFormAction(
$GLOBALS[
'ilCtrl']->getFormAction($this));
422 include_once
'./Services/Membership/classes/class.ilMemberAgreementGUI.php';
425 $form->addCommandButton(
'saveMember', $this->lng->txt(
'save'));
426 $form->addCommandButton(
'cancelEditMember', $this->lng->txt(
'cancel'));
435 $GLOBALS[
'ilCtrl']->saveParameter($this,
'member_id');
438 if (
$form->checkInput()) {
440 include_once
'./Services/Membership/classes/class.ilObjectCustomUserFieldHistory.php';
443 $history->setUpdateUser($ilUser->getId());
448 $GLOBALS[
'ilCtrl']->returnToParent($this);
452 $form->setValuesByPost();
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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.
Create styles array
The data for the language used.
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.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
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.
Confirmation screen class.
static _getFields($a_container_id, $a_sort=IL_CDF_SORT_NAME)
Get all fields of a container.