24 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
25 include_once(
'Modules/Course/classes/class.ilCourseAgreement.php');
26 include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
27 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
61 $this->ref_id = $a_ref_id;
62 $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
66 $this->lng->loadLanguageModule(
'ps');
81 $next_class = $this->ctrl->getNextClass($this);
82 $cmd = $this->ctrl->getCmd();
89 $cmd =
'showAgreement';
105 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_user_agreement.html',
'Modules/Course');
106 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
114 include_once(
'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
117 foreach($fields_info->getExportableFields() as $field)
119 $this->tpl->setCurrentBlock(
'field');
120 $this->tpl->setVariable(
'FIELD_NAME',$this->lng->txt($field));
121 $this->tpl->parseCurrentBlock();
124 $this->tpl->setVariable(
'AGREEMENT_HEADER',$this->lng->txt(
'crs_agreement_header'));
125 $this->tpl->setVariable(
'TXT_AGREEMENT',$this->lng->txt(
'crs_user_agreement'));
126 $this->tpl->setVariable(
'TXT_INFO_AGREEMENT',$this->lng->txt(
'crs_info_agreement'));
130 $this->tpl->setCurrentBlock(
'agreement');
132 $this->tpl->setVariable(
'INFO_AGREE',$this->lng->txt(
'crs_info_agree'));
133 $this->tpl->setVariable(
'TXT_AGREE',$this->lng->txt(
'crs_agree'));
134 $this->tpl->parseCurrentBlock();
136 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
160 $this->agreement->setAccepted(
true);
161 $this->agreement->setAcceptanceTime(time());
162 $this->agreement->save();
164 $this->ctrl->returnToParent($this);
171 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
172 include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
179 foreach($cdf_fields as $field_obj)
181 $course_user_data =
new ilCourseUserData($ilUser->getId(),$field_obj->getId());
183 switch($field_obj->getType())
186 $this->tpl->setCurrentBlock(
'sel_row');
187 $this->tpl->setVariable(
'SEL_SELECT',
ilUtil::formSelect($course_user_data->getValue(),
188 'cdf['.$field_obj->getId().
']',
189 $field_obj->prepareSelectBox(),
194 $this->tpl->setCurrentBlock(
'txt_row');
195 $this->tpl->setVariable(
'TXT_ROW_NAME',$field_obj->getId());
196 $this->tpl->setVariable(
'TXT_ROW_VALUE',$course_user_data->getValue());
199 if($field_obj->isRequired())
201 $this->show_required_info =
true;
202 $this->tpl->touchBlock(
'cdf_required');
205 $this->tpl->setCurrentBlock(
'cdf_row');
206 $this->tpl->setVariable(
'CDF_FIELD_NAME',$field_obj->getName());
207 $this->tpl->parseCurrentBlock();
209 $this->tpl->setCurrentBlock(
'cdf');
210 $this->tpl->setVariable(
'CDF_TXT',$this->lng->txt(
'ps_cdf_info'));
211 $this->tpl->parseCurrentBlock();
224 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
225 include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
227 $all_required =
true;
230 switch($field_obj->getType())
240 $course_user_data =
new ilCourseUserData($ilUser->getId(),$field_obj->getId());
241 $course_user_data->
setValue($value);
242 $course_user_data->update();
244 if($field_obj->isRequired() and !strlen($value))
246 $all_required =
false;
249 return $all_required;
288 $this->agreement_required = $this->agreement->agreementRequired();
299 if($this->agreement_required)
301 $message = $this->lng->txt(
'ps_agreement_req_info');
303 if(!$this->required_fullfilled)
307 $message .=
'<br />';
309 $message .= $this->lng->txt(
'ps_required_info');