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());
59 parent::__construct($a_parent_obj,
'members');
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)
113 return self::$all_columns;
116 include_once
'./Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
118 self::$all_columns = $ef->getSelectableFieldsInfo($this->
getParentObject()->object->getId());
119 return self::$all_columns;
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);
setFormName($a_formname)
Set Form name.
static getUserListData($a_order_field, $a_order_dir, $a_offset, $a_limit, $a_string_filter="", $a_activation_filter="", $a_last_login_filter=null, $a_limited_access_filter=false, $a_no_courses_filter=false, $a_course_group_filter=0, $a_role_filter=0, $a_user_folder_filter=null, $a_additional_fields='', $a_user_filter=null, $a_first_letter="")
Get data for user administration list.
static _getValuesByObjId($a_obj_id)
Get values by obj_id (for all users)
setExternalSegmentation($a_val)
Set external segmentation.
static getAssignedObjects()
Alway call checkGroupingDependencies before.
static _lookupTitle($a_id)
lookup object title
getOrderDirection()
Get order direction.
getParentObject()
Get parent object.
__construct($a_parent_obj, $show_content=true)
Constructor.
static lookupData($a_user_ids, $a_field_ids)
Lookup data.
static _getInstanceByType($a_type)
Get Singleton Instance.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
addMultiCommand($a_cmd, $a_text)
Add Command button.
enable($a_module_name)
enables particular modules of table
static formatDate(ilDateTime $date)
Format a date public.
GUI class for course/group subscriptions.
getSelectedColumns()
Get selected columns.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static lookupSubscribersData($a_obj_id)
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
getSelectableColumns()
Get selectable columns.
_checkGroupingDependencies(&$container_obj, $a_user_id=null)
disable($a_module_name)
diesables particular modules of table
setFormAction($a_form_action)
Set Form action parameter.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setMaxCount($a_max_count)
set max.
readSubscriberData()
read data