24 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
25 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
26 include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
27 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
62 $this->ref_id = $a_ref_id;
63 $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
68 $this->lng->loadLanguageModule(
'ps');
83 $next_class = $this->ctrl->getNextClass($this);
84 $cmd = $this->ctrl->getCmd();
91 $cmd =
'showAgreement';
107 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_user_agreement.html',
'Modules/Course');
108 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
116 include_once(
'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
119 foreach($fields_info->getExportableFields() as $field)
121 $this->tpl->setCurrentBlock(
'field');
122 $this->tpl->setVariable(
'FIELD_NAME',$this->lng->txt($field));
123 $this->tpl->parseCurrentBlock();
126 $this->tpl->setVariable(
'AGREEMENT_HEADER',$this->lng->txt($this->type.
'_agreement_header'));
127 $this->tpl->setVariable(
'TXT_AGREEMENT',$this->lng->txt($this->type.
'_user_agreement'));
128 $this->tpl->setVariable(
'TXT_INFO_AGREEMENT',$this->lng->txt($this->type.
'_info_agreement'));
131 $this->tpl->setCurrentBlock(
'agreement');
133 $this->tpl->setVariable(
'INFO_AGREE',$this->lng->txt($this->type.
'_info_agree'));
134 $this->tpl->setVariable(
'TXT_AGREE',$this->lng->txt($this->type.
'_agree'));
135 $this->tpl->parseCurrentBlock();
137 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
161 $this->agreement->setAccepted(
true);
162 $this->agreement->setAcceptanceTime(time());
163 $this->agreement->save();
165 $this->ctrl->returnToParent($this);
172 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
173 include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
180 foreach($cdf_fields as $field_obj)
182 $course_user_data =
new ilCourseUserData($ilUser->getId(),$field_obj->getId());
184 switch($field_obj->getType())
187 $this->tpl->setCurrentBlock(
'sel_row');
188 $this->tpl->setVariable(
'SEL_SELECT',
ilUtil::formSelect($course_user_data->getValue(),
189 'cdf['.$field_obj->getId().
']',
190 $field_obj->prepareSelectBox(),
195 $this->tpl->setCurrentBlock(
'txt_row');
196 $this->tpl->setVariable(
'TXT_ROW_NAME',$field_obj->getId());
197 $this->tpl->setVariable(
'TXT_ROW_VALUE',$course_user_data->getValue());
200 if($field_obj->isRequired())
202 $this->show_required_info =
true;
203 $this->tpl->touchBlock(
'cdf_required');
206 $this->tpl->setCurrentBlock(
'cdf_row');
207 $this->tpl->setVariable(
'CDF_FIELD_NAME',$field_obj->getName());
208 $this->tpl->parseCurrentBlock();
210 $this->tpl->setCurrentBlock(
'cdf');
211 $this->tpl->setVariable(
'CDF_TXT',$this->lng->txt($this->type.
'_ps_cdf_info'));
212 $this->tpl->parseCurrentBlock();
225 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
226 include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
228 $all_required =
true;
231 switch($field_obj->getType())
236 foreach((array) $field_obj->getValues() as $v)
250 $course_user_data =
new ilCourseUserData($ilUser->getId(),$field_obj->getId());
251 $course_user_data->
setValue($value);
252 $course_user_data->update();
254 if($field_obj->isRequired() and !$value)
256 $all_required =
false;
259 return $all_required;
298 $this->agreement_required = $this->agreement->agreementRequired();
309 if($this->agreement_required)
311 $message = $this->lng->txt($this->type.
'_ps_agreement_req_info');
313 if(!$this->required_fullfilled)
317 $message .=
'<br />';
319 $message .= $this->lng->txt($this->type.
'_ps_required_info');