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');
190 $options[0] = $this->lng->txt(
'links_select_one');
191 foreach($field_obj->getValues() as $value)
193 $options[$field_obj->getId().
'_'.$value] = $value;
195 $this->tpl->setVariable(
'SEL_SELECT',
ilUtil::formSelect($field_obj->getId().
'_'.$course_user_data->getValue(),
196 'cdf['.$field_obj->getId().
']',
202 $this->tpl->setCurrentBlock(
'txt_row');
203 $this->tpl->setVariable(
'TXT_ROW_NAME',$field_obj->getId());
204 $this->tpl->setVariable(
'TXT_ROW_VALUE',$course_user_data->getValue());
207 if($field_obj->isRequired())
209 $this->show_required_info =
true;
210 $this->tpl->touchBlock(
'cdf_required');
213 $this->tpl->setCurrentBlock(
'cdf_row');
214 $this->tpl->setVariable(
'CDF_FIELD_NAME',$field_obj->getName());
215 $this->tpl->parseCurrentBlock();
217 $this->tpl->setCurrentBlock(
'cdf');
218 $this->tpl->setVariable(
'CDF_TXT',$this->lng->txt($this->type.
'_ps_cdf_info'));
219 $this->tpl->parseCurrentBlock();
232 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
233 include_once(
'Modules/Course/classes/Export/class.ilCourseUserData.php');
235 $all_required =
true;
238 $required_given =
false;
239 switch($field_obj->getType())
243 $tmp_values = explode(
'_', $tmp_values,2);
246 if(isset($tmp_values[1]))
248 $tmp_value = isset($tmp_values[1]) ? $tmp_values[1] :
'';
250 foreach((array) $field_obj->getValues() as $v)
255 $required_given =
true;
266 $required_given =
true;
270 $course_user_data =
new ilCourseUserData($ilUser->getId(),$field_obj->getId());
271 $course_user_data->
setValue($value);
272 $course_user_data->update();
274 if($field_obj->isRequired() and !$required_given)
276 $all_required =
false;
279 return $all_required;
318 $this->agreement_required = $this->agreement->agreementRequired();
329 if($this->agreement_required)
331 $message = $this->lng->txt($this->type.
'_ps_agreement_req_info');
333 if(!$this->required_fullfilled)
337 $message .=
'<br />';
339 $message .= $this->lng->txt($this->type.
'_ps_required_info');