Ejemplo n.º 1
0
 /**
  * Show user agreement
  *
  * @access protected
  * @return
  */
 protected function fillAgreement()
 {
     global $ilUser;
     if (!$this->isRegistrationPossible()) {
         return true;
     }
     include_once 'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
     if (!$this->privacy->confirmationRequired($this->type) and !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId())) {
         return true;
     }
     $this->lng->loadLanguageModule('ps');
     include_once 'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
     $fields_info = ilExportFieldsInfo::_getInstanceByType(ilObject::_lookupType($this->container->getId()));
     if (!count($fields_info->getExportableFields())) {
         return true;
     }
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('usr_agreement'));
     $this->form->addItem($section);
     include_once './Services/Membership/classes/class.ilMemberAgreementGUI.php';
     ilMemberAgreementGUI::addExportFieldInfo($this->form, $this->obj_id, $this->type);
     ilMemberAgreementGUI::addCustomFields($this->form, $this->obj_id, $this->type);
     // Checkbox agreement
     if ($this->privacy->confirmationRequired($this->type)) {
         ilMemberAgreementGUI::addAgreement($this->form, $this->obj_id, $this->type);
     }
     return true;
 }
 /**
  * Init member form
  * @return \ilPropertyFormGUI
  */
 protected function initMemberForm()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($GLOBALS['ilCtrl']->getFormAction($this));
     $title = $this->lng->txt(ilObject::_lookupType($this->getObjId()) . '_cdf_edit_member');
     $name = ilObjUser::_lookupName((int) $_REQUEST['member_id']);
     $title .= ': ' . $name['lastname'] . ', ' . $name['firstname'];
     $form->setTitle($title);
     include_once './Services/Membership/classes/class.ilMemberAgreementGUI.php';
     ilMemberAgreementGUI::addCustomFields($form, $this->getObjId(), ilObject::_lookupType($this->getObjId()), 'edit');
     $form->addCommandButton('saveMember', $this->lng->txt('save'));
     $form->addCommandButton('cancelEditMember', $this->lng->txt('cancel'));
     return $form;
 }