24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
49 public function __construct($a_parent_obj,$show_content =
true)
54 $this->lng->loadLanguageModule(
'grp');
55 $this->lng->loadLanguageModule(
'crs');
58 $this->
setId(
'crs_sub_'. $a_parent_obj->object->getId());
62 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj,
'members'));
65 $this->
addColumn($this->lng->txt(
'name'),
'lastname',
'20%');
70 $this->
addColumn($all_cols[$col][
'txt'], $col);
73 $this->
addColumn($this->lng->txt(
'application_date'),
'sub_time',
"10%");
74 $this->
addColumn($this->lng->txt(
'subject'),
'subject',
'15%');
79 $this->
addMultiCommand(
'sendMailToSelectedUsers',$this->lng->txt(
'crs_mem_send_mail'));
84 $this->
setRowTemplate(
"tpl.show_subscribers_row.html",
"Services/Membership");
91 $this->
enable(
'select_all');
111 if(self::$all_columns)
116 include_once
'./Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
118 self::$all_columns = $ef->getSelectableFieldsInfo($this->
getParentObject()->object->getId());
135 include_once
'./Modules/Course/classes/class.ilObjCourseGrouping.php';
140 $this->tpl->setVariable(
'ALERT_MSG',
141 sprintf($this->lng->txt(
$prefix.
'_lim_assigned'),
147 $this->tpl->setVariable(
'VAL_ID',$a_set[
'usr_id']);
148 $this->tpl->setVariable(
'VAL_NAME',$a_set[
'lastname'].
', '.$a_set[
'firstname']);
155 $a_set[
'gender'] = $a_set[
'gender'] ? $this->lng->txt(
'gender_' . $a_set[
'gender']) :
'';
156 $this->tpl->setCurrentBlock(
'custom_fields');
157 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
158 $this->tpl->parseCurrentBlock();
163 $this->tpl->setCurrentBlock(
'custom_fields');
164 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
165 $this->tpl->parseCurrentBlock();
169 $this->tpl->setCurrentBlock(
'custom_fields');
170 $this->tpl->setVariable(
'VAL_CUST', isset($a_set[$field]) ? (
string) $a_set[$field] :
'');
171 $this->tpl->parseCurrentBlock();
179 $this->ctrl->setParameterByClass(get_class($this->
getParentObject()),
'member_id',$a_set[
'usr_id']);
180 $link = $this->ctrl->getLinkTargetByClass(get_class($this->
getParentObject()),
'sendMailToSelectedUsers');
181 $this->tpl->setVariable(
'MAIL_LINK',$link);
182 $this->tpl->setVariable(
'MAIL_TITLE',$this->lng->txt(
'crs_mem_send_mail'));
185 if(strlen($a_set[
'subject']))
187 $this->tpl->setVariable(
'VAL_SUBJECT',
'"'.$a_set[
'subject'].
'"');
201 include_once
'./Services/Membership/classes/class.ilParticipants.php';
206 foreach($sub_data as
$usr_id => $usr_data)
213 include_once
'./Services/User/classes/class.ilUserQuery.php';
216 unset($additional_fields[
"firstname"]);
217 unset($additional_fields[
"lastname"]);
218 unset($additional_fields[
"last_login"]);
219 unset($additional_fields[
"access_until"]);
221 $udf_ids = $usr_data_fields = $odf_ids = array();
222 foreach($additional_fields as $field)
224 if(substr($field, 0, 3) ==
'udf')
226 $udf_ids[] = substr($field, 4);
229 if(substr($field, 0, 3) ==
'odf')
231 $odf_ids[] = substr($field, 4);
235 $usr_data_fields[] = $field;
255 foreach((array) $usr_data[
'set'] as $user)
257 $usr_ids[] = $user[
'usr_id'];
261 $course_user_data = $this->
getParentObject()->readMemberData($usr_ids,$this->type ==
'admin');
262 $a_user_data = array();
263 foreach((array) $usr_data[
'set'] as $ud)
265 $a_user_data[$ud[
'usr_id']] = array_merge($ud,(array) $course_user_data[$ud[
'usr_id']]);
271 include_once
'./Services/User/classes/class.ilUserDefinedData.php';
280 foreach($fields as $field_id => $value)
282 $a_user_data[
$usr_id][
'udf_' . $field_id] = $value;
289 include_once
'./Modules/Course/classes/Export/class.ilCourseUserData.php';
299 foreach($fields as $field_id => $value)
301 $a_user_data[
$usr_id][
'odf_' . $field_id] = $value;
306 foreach($usr_data[
'set'] as $user)
314 foreach($usr_data_fields as $field)
316 $a_user_data[$user[
'usr_id']][$field] = $user[$field] ? $user[$field] :
'';
321 foreach($sub_data as
$usr_id => $usr_data)
323 if(!in_array(
$usr_id, $usr_ids))
327 $a_user_data[
$usr_id][
'sub_time'] = $usr_data[
'time'];
328 $a_user_data[
$usr_id][
'subject'] = $usr_data[
'subject'];
332 return $this->
setData($a_user_data);