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'));
129 if($this->privacy->confirmationRequired($this->type))
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');
191 $options[0] = $this->lng->txt(
'links_select_one');
192 foreach($field_obj->getValues() as $value)
194 $options[$field_obj->getId().
'_'.$value] = $value;
196 $this->tpl->setVariable(
'SEL_SELECT',
ilUtil::formSelect($field_obj->getId().
'_'.$course_user_data->getValue(),
197 'cdf['.$field_obj->getId().
']',
203 $this->tpl->setCurrentBlock(
'txt_row');
204 $this->tpl->setVariable(
'TXT_ROW_NAME',$field_obj->getId());
205 $this->tpl->setVariable(
'TXT_ROW_VALUE',$course_user_data->getValue());
208 if($field_obj->isRequired())
210 $this->show_required_info =
true;
211 $this->tpl->touchBlock(
'cdf_required');
214 $this->tpl->setCurrentBlock(
'cdf_row');
215 $this->tpl->setVariable(
'CDF_FIELD_NAME',$field_obj->getName());
216 $this->tpl->parseCurrentBlock();
218 $this->tpl->setCurrentBlock(
'cdf');
219 $this->tpl->setVariable(
'CDF_TXT',$this->lng->txt($this->type.
'_ps_cdf_info'));
220 $this->tpl->parseCurrentBlock();
233 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
234 include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
236 $all_required =
true;
239 $required_given =
false;
240 switch($field_obj->getType())
244 $tmp_values = explode(
'_', $tmp_values,2);
247 if(isset($tmp_values[1]))
249 $tmp_value = isset($tmp_values[1]) ? $tmp_values[1] :
'';
251 foreach((array) $field_obj->getValues() as $v)
256 $required_given =
true;
265 if(trim($value) !=
"")
267 $required_given =
true;
271 $course_user_data =
new ilCourseUserData($ilUser->getId(),$field_obj->getId());
272 $course_user_data->
setValue($value);
273 $course_user_data->update();
275 if($field_obj->isRequired() and !$required_given)
277 $all_required =
false;
280 return $all_required;
298 if($this->privacy->confirmationRequired($this->type))
319 $this->agreement_required = $this->agreement->agreementRequired();
330 if($this->agreement_required)
332 $message = $this->lng->txt($this->type.
'_ps_agreement_req_info');
334 if(!$this->required_fullfilled)
338 $message .=
'<br />';
340 $message .= $this->lng->txt($this->type.
'_ps_required_info');