24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
56 $this->lng->loadLanguageModule(
'grp');
57 $this->lng->loadLanguageModule(
'crs');
62 $this->
setId(
'crs_sub_'. $a_parent_obj->object->getId());
66 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj,
'members'));
69 $this->
addColumn($this->lng->txt(
'name'),
'lastname',
'20%');
74 $this->
addColumn($all_cols[$col][
'txt'], $col);
77 $this->
addColumn($this->lng->txt(
'application_date'),
'sub_time',
"10%");
80 $this->
addColumn($this->lng->txt(
'subject'),
'subject',
'15%');
84 $this->
addMultiCommand(
'confirmAssignSubscribers',$this->lng->txt(
'assign'));
85 $this->
addMultiCommand(
'confirmRefuseSubscribers',$this->lng->txt(
'refuse'));
86 $this->
addMultiCommand(
'sendMailToSelectedUsers',$this->lng->txt(
'crs_mem_send_mail'));
91 $this->
setRowTemplate(
"tpl.show_subscribers_row.html",
"Services/Membership");
98 $this->
enable(
'select_all');
111 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
122 if(self::$all_columns)
127 include_once
'./Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
129 self::$all_columns = $ef->getSelectableFieldsInfo($this->
getParentObject()->object->getId());
146 include_once
'./Modules/Course/classes/class.ilObjCourseGrouping.php';
151 $this->tpl->setVariable(
'ALERT_MSG',
152 sprintf($this->lng->txt(
$prefix.
'_lim_assigned'),
158 $this->tpl->setVariable(
'VAL_ID',$a_set[
'usr_id']);
159 $this->tpl->setVariable(
'VAL_NAME',$a_set[
'lastname'].
', '.$a_set[
'firstname']);
166 $a_set[
'gender'] = $a_set[
'gender'] ? $this->lng->txt(
'gender_' . $a_set[
'gender']) :
'';
167 $this->tpl->setCurrentBlock(
'custom_fields');
168 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
169 $this->tpl->parseCurrentBlock();
174 $this->tpl->setCurrentBlock(
'custom_fields');
175 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
176 $this->tpl->parseCurrentBlock();
179 case 'odf_last_update':
180 $this->tpl->setVariable(
'VAL_CUST',(
string) $a_set[
'odf_info_txt']);
185 $this->tpl->setCurrentBlock(
'custom_fields');
186 $this->tpl->setVariable(
'VAL_CUST', isset($a_set[$field]) ? (
string) $a_set[$field] :
'');
187 $this->tpl->parseCurrentBlock();
202 if(strlen($a_set[
'subject']))
204 $this->tpl->setCurrentBlock(
'subject');
205 $this->tpl->setVariable(
'VAL_SUBJECT',
'"'.$a_set[
'subject'].
'"');
206 $this->tpl->parseCurrentBlock();
210 $this->tpl->touchBlock(
'subject');
222 if(!self::$has_odf_definitions)
224 $this->ctrl->setParameterByClass(get_class($this->
getParentObject()),
'member_id',$a_set[
'usr_id']);
225 $link = $this->ctrl->getLinkTargetByClass(get_class($this->
getParentObject()),
'sendMailToSelectedUsers');
226 $this->tpl->setVariable(
'MAIL_LINK',$link);
227 $this->tpl->setVariable(
'MAIL_TITLE',$this->lng->txt(
'crs_mem_send_mail'));
232 include_once
'./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
234 $list->setSelectionHeaderClass(
'small');
235 $list->setItemLinkClass(
'small');
236 $list->setId(
'actl_'.$a_set[
'usr_id'].
'_'.$this->
getId());
237 $list->setListTitle($this->lng->txt(
'actions'));
239 $this->ctrl->setParameterByClass(get_class($this->
getParentObject()),
'member_id',$a_set[
'usr_id']);
240 $this->ctrl->setParameter($this->parent_obj,
'member_id', $a_set[
'usr_id']);
241 $trans = $this->lng->txt($this->
getParentObject()->object->getType().
'_mem_send_mail');
242 $link = $this->ctrl->getLinkTargetByClass(get_class($this->
getParentObject()),
'sendMailToSelectedUsers');
243 $list->addItem($trans,
'', $link,
'sendMailToSelectedUsers');
245 $this->ctrl->setParameterByClass(
'ilobjectcustomuserfieldsgui',
'member_id',$a_set[
'usr_id']);
246 $trans = $this->lng->txt($this->
getParentObject()->object->getType().
'_cdf_edit_member');
247 $list->addItem($trans,
'', $this->ctrl->getLinkTargetByClass(
'ilobjectcustomuserfieldsgui',
'editMember'));
249 $this->tpl->setVariable(
'ACTION_USER',$list->getHTML());
263 include_once
'./Services/Membership/classes/class.ilParticipants.php';
268 foreach($sub_data as $usr_id => $usr_data)
270 $sub_ids[] = $usr_id;
275 include_once
'./Services/User/classes/class.ilUserQuery.php';
278 unset($additional_fields[
"firstname"]);
279 unset($additional_fields[
"lastname"]);
280 unset($additional_fields[
"last_login"]);
281 unset($additional_fields[
"access_until"]);
283 $udf_ids = $usr_data_fields = $odf_ids = array();
284 foreach($additional_fields as $field)
286 if(substr($field, 0, 3) ==
'udf')
288 $udf_ids[] = substr($field, 4);
291 if(substr($field, 0, 3) ==
'odf')
293 $odf_ids[] = substr($field, 4);
297 $usr_data_fields[] = $field;
317 foreach((array) $usr_data[
'set'] as $user)
319 $usr_ids[] = $user[
'usr_id'];
323 $course_user_data = $this->
getParentObject()->readMemberData($usr_ids,$this->type ==
'admin');
324 $a_user_data = array();
325 foreach((array) $usr_data[
'set'] as $ud)
327 $a_user_data[$ud[
'usr_id']] = array_merge($ud,(array) $course_user_data[$ud[
'usr_id']]);
333 include_once
'./Services/User/classes/class.ilUserDefinedData.php';
335 foreach(
$data as $usr_id => $fields)
342 foreach($fields as $field_id => $value)
344 $a_user_data[$usr_id][
'udf_' . $field_id] = $value;
351 include_once
'./Modules/Course/classes/Export/class.ilCourseUserData.php';
353 foreach(
$data as $usr_id => $fields)
361 foreach($fields as $field_id => $value)
363 $a_user_data[$usr_id][
'odf_' . $field_id] = $value;
368 include_once
'./Services/Membership/classes/class.ilObjectCustomUserFieldHistory.php';
371 if(!isset($a_user_data[$usr_id]))
376 include_once
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
377 if($usr_id == $edit_info[
'update_user'])
379 $a_user_data[$usr_id][
'odf_last_update'] =
'';
380 $a_user_data[$usr_id][
'odf_info_txt'] =
$GLOBALS[
'lng']->txt(
'cdf_edited_by_self');
383 $a_user_data[$usr_id][
'odf_last_update'] .= (
'_'.$edit_info[
'editing_time']->get(
IL_CAL_UNIX));
384 $a_user_data[$usr_id][
'odf_info_txt'] .= (
', '.ilDatePresentation::formatDate($edit_info[
'editing_time']));
389 $a_user_data[$usr_id][
'odf_last_update'] = $edit_info[
'update_user'];
390 $a_user_data[$usr_id][
'odf_last_update'] .= (
'_'.$edit_info[
'editing_time']->get(
IL_CAL_UNIX));
393 $a_user_data[$usr_id][
'odf_info_txt'] = ($name[
'firstname'].
' '.$name[
'lastname'].
', '.
ilDatePresentation::formatDate($edit_info[
'editing_time']));
398 foreach($usr_data[
'set'] as $user)
406 foreach($usr_data_fields as $field)
408 $a_user_data[$user[
'usr_id']][$field] = $user[$field] ? $user[$field] :
'';
413 foreach($sub_data as $usr_id => $usr_data)
415 if(!in_array($usr_id, $usr_ids))
419 $a_user_data[$usr_id][
'sub_time'] = $usr_data[
'time'];
420 $a_user_data[$usr_id][
'subject'] = $usr_data[
'subject'];
424 return $this->
setData($a_user_data);
434 $this->show_subject = (bool)$a_value;