4include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
 
    5include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
 
    6include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
 
    7include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
 
   45        $this->ref_id = $a_ref_id;
 
   46        $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
 
   51        $this->lng->loadLanguageModule(
'ps');
 
   66        $next_class = $this->ctrl->getNextClass($this);
 
   67        $cmd = $this->ctrl->getCmd();
 
   69        switch ($next_class) {
 
   71                if (!$cmd or $cmd == 
'view') {
 
   72                    $cmd = 
'showAgreement';
 
  110        $this->tpl->setContent(
$form->getHTML());
 
  118        include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
  120        $form->setTitle($this->lng->txt($this->type . 
'_agreement_header'));
 
  121        $form->setFormAction(
$GLOBALS[
'ilCtrl']->getFormAction($this));
 
  122        $form->addCommandButton(
'save', $this->lng->txt(
'save'));
 
  127        if ($this->
getPrivacy()->confirmationRequired($this->type)) {
 
  146        include_once(
'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
 
  150        $tpl = 
new ilTemplate(
'tpl.agreement_form.html', 
true, 
true, 
'Services/Membership');
 
  151        $tpl->setVariable(
'TXT_INFO_AGREEMENT', 
$lng->txt(
$a_type . 
'_info_agreement'));
 
  152        foreach ($fields_info->getExportableFields() as $field) {
 
  153            $tpl->setCurrentBlock(
'field_item');
 
  154            $tpl->setVariable(
'FIELD_NAME', 
$lng->txt($field));
 
  155            $tpl->parseCurrentBlock();
 
  160        include_once(
'Services/User/classes/class.ilUserDefinedFields.php');
 
  162            $tpl->setCurrentBlock(
'field_item');
 
  163            $tpl->setVariable(
'FIELD_NAME', $field[
'field_name']);
 
  164            $tpl->parseCurrentBlock();
 
  167        $fields->setHtml(
$tpl->get());
 
  168        $form->addItem($fields);
 
  202        include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
 
  203        include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
 
  209        if ($a_mode == 
'user') {
 
  211            $cdf->setValue(
$lng->txt(
$a_type . 
'_ps_cdf_info'));
 
  212            $cdf->setRequired(
true);
 
  215        foreach ($cdf_fields as $field_obj) {
 
  216            switch ($field_obj->getType()) {
 
  219                    if ($field_obj->getValueOptions()) {
 
  222                        if ($field_obj->isRequired()) {
 
  223                            $option_radios->setRequired(
true);
 
  226                        $open_answer_indexes = (array) $field_obj->getValueOptions();
 
  227                        foreach ($field_obj->getValues() as 
$key => $val) {
 
  231                            if (in_array(
$key, $open_answer_indexes)) {
 
  232                                $open_answer = 
new ilTextInputGUI(
$lng->txt(
"form_open_answer"), 
'cdf_oa_' . $field_obj->getId() . 
'_' . 
$key);
 
  233                                $open_answer->setRequired(
true);
 
  234                                $option_radio->addSubItem($open_answer);
 
  237                            $option_radios->addOption($option_radio);
 
  239                        if ($a_mode == 
'user') {
 
  240                            $cdf->addSubItem($option_radios);
 
  242                            $form->addItem($option_radios);
 
  245                        $select = 
new ilSelectInputGUI($field_obj->getName(), 
'cdf_' . $field_obj->getId());
 
  246                        #$select->setValue(ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()])); 
  247                        $select->setOptions($field_obj->prepareSelectBox());
 
  248                        if ($field_obj->isRequired()) {
 
  249                            $select->setRequired(
true);
 
  251                        if ($a_mode == 
'user') {
 
  252                            $cdf->addSubItem($select);
 
  254                            $form->addItem($select);
 
  261                    #$text->setValue(ilUtil::stripSlashes($_POST['cdf'][$field_obj->getId()])); 
  263                    $text->setMaxLength(255);
 
  264                    if ($field_obj->isRequired()) {
 
  265                        $text->setRequired(
true);
 
  267                    if ($a_mode == 
'user') {
 
  268                        $cdf->addSubItem(
$text);
 
  275        if ($a_mode == 
'user') {
 
  276            $form->addItem($cdf);
 
  304            include_once 
'./Services/Membership/classes/class.ilObjectCustomUserFieldHistory.php';
 
  306            $history->setUpdateUser(
$ilUser->getId());
 
  310            $this->ctrl->returnToParent($this);
 
  313            $form->setValuesByPost();
 
  318            $form->setValuesByPost();
 
  335            $current_value = $ud[$a_usr_id][$field_obj->getId()];
 
  336            if (!$current_value) {
 
  340            switch ($field_obj->getType()) {
 
  343                    $id = $field_obj->getIdByValue($current_value);
 
  346                        $item = 
$form->getItemByPostVar(
'cdf_' . $field_obj->getId());
 
  347                        $item->setValue($field_obj->getId() . 
'_' . 
$id);
 
  350                        $open_answer_indexes = $field_obj->getValueOptions();
 
  351                        $open_answer_index = end($open_answer_indexes);
 
  352                        $item = 
$form->getItemByPostVar(
'cdf_' . $field_obj->getId());
 
  353                        $item->setValue($field_obj->getId() . 
'_' . $open_answer_index);
 
  354                        $item_txt = 
$form->getItemByPostVar(
'cdf_oa_' . $field_obj->getId() . 
'_' . $open_answer_index);
 
  356                            $item_txt->setValue($current_value);
 
  362                    $item = 
$form->getItemByPostVar(
'cdf_' . $field_obj->getId());
 
  363                    $item->setValue($current_value);
 
  383            switch ($field_obj->getType()) {
 
  387                    list($field_id, $option_id) = explode(
'_', 
$form->getInput(
'cdf_' . $field_obj->getId()));
 
  388                    $open_answer_indexes = (array) $field_obj->getValueOptions();
 
  389                    if (in_array($option_id, $open_answer_indexes)) {
 
  390                        $value = 
$form->getInput(
'cdf_oa_' . $field_obj->getId() . 
'_' . $option_id);
 
  392                        $value = $field_obj->getValueById($option_id);
 
  397                    $value = 
$form->getInput(
'cdf_' . $field_obj->getId());
 
  402            $course_user_data->setValue($value);
 
  403            $course_user_data->update();
 
  418        if (
$_POST[
'agreement']) {
 
  421        if ($this->privacy->confirmationRequired($this->type)) {
 
  440        $this->agreement_required = $this->
getAgreement()->agreementRequired();
 
  451        if ($this->agreement_required) {
 
  452            $message = $this->lng->txt($this->type . 
'_ps_agreement_req_info');
 
  454        if (!$this->required_fullfilled) {
 
  458            $message .= $this->lng->txt($this->type . 
'_ps_required_info');
 
An exception for terminatinating execution or to throw for unit testing.
static _getFields($a_container_id, $a_sort=IL_CDF_SORT_NAME)
Get all fields of a container.
static _getValuesByObjId($a_obj_id)
Get values by obj_id (for all users)
static _checkRequired($a_usr_id, $a_obj_id)
Check required fields.
@classDescription Date and time handling
static _getInstanceByType($a_type)
Get Singleton Instance.
static addExportFieldInfo($form, $a_obj_id, $a_type)
Add export field info to form @global type $lng.
static setCourseDefinedFieldValues(ilPropertyFormGUI $form, $a_obj_id, $a_usr_id=0)
static addCustomFields($form, $a_obj_id, $a_type, $a_mode='user')
Add custom course fields.
static addAgreement($form, $a_obj_id, $a_type)
Add agreement to form.
showAgreement(ilPropertyFormGUI $form=null)
Show agreement form.
__construct($a_ref_id)
Constructor.
sendInfoMessage()
Send info message.
getPrivacy()
Get privycy settings.
executeCommand()
Execute Command.
checkAgreement()
Check Agreement.
static saveCourseDefinedFields(ilPropertyFormGUI $form, $a_obj_id, $a_usr_id=0)
Save course defined fields.
This class represents a non editable value in a property form.
Editing history for object custom user fields.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getInstance()
Get instance of ilPrivacySettings.
This class represents an option in a radio group.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static _getInstance()
Get instance.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(!array_key_exists('StateId', $_REQUEST)) $id
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
catch(Exception $e) $message
if(isset($_POST['submit'])) $form