5 require_once
'./Services/User/classes/class.ilObjUser.php';
6 require_once
'Services/Mail/classes/class.ilMailbox.php';
7 require_once
'Services/Mail/classes/class.ilFormatMail.php';
8 require_once
'Services/Contact/classes/class.ilAddressbook.php';
35 $this->ctrl->saveParameter($this,
"mobj_id");
38 include_once
"Services/Mail/classes/class.ilMail.php";
40 $this->mailing_allowed = $rbacsystem->checkAccess(
'mail_visible',$mail->getMailObjectReferenceId());
48 $forward_class = $this->ctrl->getNextClass($this);
49 switch($forward_class)
52 if (!(
$cmd = $this->ctrl->getCmd()))
54 $cmd =
"showMyGroups";
67 if (
$_GET[
"view"] ==
"mygroups")
69 $ids = ((int)
$_GET[
'search_grp']) ? array((
int)
$_GET[
'search_grp']) :
$_POST[
'search_grp'];
80 else if (
$_GET[
"view"] ==
"grp_members")
82 $ids = ((int)
$_GET[
'search_members']) ? array((
int)
$_GET[
'search_members']) :
$_POST[
'search_members'];
101 global $ilUser,
$lng, $rbacreview;
105 if (!is_array($old_mail_data = $this->umail->getSavedData()))
107 $this->umail->savePostData(
121 require_once
'classes/class.ilObject.php';
122 $ids = ((int)
$_GET[
'search_grp']) ? array((
int)
$_GET[
'search_grp']) :
$_POST[
'search_grp'];
123 foreach ($ids as $grp_id)
128 $roles = $rbacreview->getAssignableChildRoles($ref_id);
129 foreach ($roles as $role)
131 if (substr($role[
'title'], 0, 14) ==
'il_grp_member_' ||
132 substr($role[
'title'], 0, 13) ==
'il_grp_admin_')
134 if(isset($old_mail_data[
'rcp_to']) &&
135 trim($old_mail_data[
'rcp_to']) !=
'')
137 $rcpt = $rbacreview->getRoleMailboxAddress($role[
'obj_id']);
139 if(!$this->umail->doesRecipientStillExists($rcpt, $old_mail_data[
'rcp_to']))
140 array_push($members, $rcpt);
146 array_push($members, $rbacreview->getRoleMailboxAddress($role[
'obj_id']));
154 $mail_data = $this->umail->appendSearchResult($members,
'to');
156 $mail_data = $this->umail->getSavedData();
158 $this->umail->savePostData(
159 $mail_data[
"user_id"],
160 $mail_data[
"attachments"],
161 $mail_data[
"rcp_to"],
162 $mail_data[
"rcp_cc"],
163 $mail_data[
"rcp_bcc"],
164 $mail_data[
"m_type"],
165 $mail_data[
"m_email"],
166 $mail_data[
"m_subject"],
167 $mail_data[
"m_message"],
168 $mail_data[
"use_placeholders"]
178 if (!is_array($this->umail->getSavedData()))
180 $this->umail->savePostData(
194 $ids = ((int)
$_GET[
'search_members']) ? array((
int)
$_GET[
'search_members']) :
$_POST[
'search_members'];
196 foreach ($ids as $member)
199 array_push($members, $login);
201 $mail_data = $this->umail->appendSearchResult($members,
"to");
203 $this->umail->savePostData(
204 $mail_data[
"user_id"],
205 $mail_data[
"attachments"],
206 $mail_data[
"rcp_to"],
207 $mail_data[
"rcp_cc"],
208 $mail_data[
"rcp_bcc"],
209 $mail_data[
"m_type"],
210 $mail_data[
"m_email"],
211 $mail_data[
"m_subject"],
212 $mail_data[
"m_message"],
213 $mail_data[
"use_placeholders"]
226 $ids = ((int)
$_GET[
'search_members']) ? array((
int)
$_GET[
'search_members']) :
$_POST[
'search_members'];
232 foreach ($ids as $member)
236 if (!$this->abook->checkEntry($login))
244 $this->abook->addEntry(
267 if (
$_GET[
"view"] ==
"mygroups" &&
268 $_GET[
"ref"] ==
"mail")
270 $this->ctrl->returnToParent($this);
283 global
$lng, $ilUser, $ilObjDataCache, $tree;
285 include_once
'Modules/Group/classes/class.ilGroupParticipants.php';
287 $this->tpl->setVariable(
'HEADER', $this->lng->txt(
'mail'));
289 $searchTpl =
new ilTemplate(
'tpl.mail_search_template.html',
true,
true,
'Services/Contact');
291 $_GET[
'view'] =
'mygroups';
293 $lng->loadLanguageModule(
'crs');
295 $this->ctrl->setParameter($this,
'view',
'mygroups');
297 include_once
'Services/Contact/classes/class.ilMailSearchCoursesTableGUI.php';
299 $table->setId(
'search_grps_tbl');
303 $tableData = array();
304 if (is_array($grp_ids) &&
308 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
309 foreach($grp_ids as $grp_id)
314 $grp_members = $oGroupParticipants->getParticipants();
316 foreach ($grp_members as $key => $member)
320 if($tmp_usr->checkTimeLimit()==
false || $tmp_usr->getActive() == false )
322 unset($grp_members[$key]);
329 $path_arr = $tree->getPathFull(
$ref_id, $tree->getRootId());
332 foreach($path_arr as
$data)
338 $path .= $data[
'title'];
343 $current_selection_list->setListTitle($this->lng->txt(
"actions"));
344 $current_selection_list->setId(
"act_".$counter);
346 $this->ctrl->setParameter($this,
'search_grp', $grp_id);
347 $this->ctrl->setParameter($this,
'view',
'mygroups');
349 if ($this->mailing_allowed)
350 $current_selection_list->addItem($this->lng->txt(
"mail_members"),
'', $this->ctrl->getLinkTarget($this,
"mail"));
351 $current_selection_list->addItem($this->lng->txt(
"mail_list_members"),
'', $this->ctrl->getLinkTarget($this,
"showMembers"));
353 $this->ctrl->clearParameters($this);
358 'CRS_NAME' => $ilObjDataCache->lookupTitle($grp_id),
359 'CRS_NO_MEMBERS' => count($grp_members),
361 'COMMAND_SELECTION_LIST' => $current_selection_list->getHTML()
364 $tableData[] = $rowData;
368 $table->setData($tableData);
371 $this->tpl->setVariable(
'TXT_MARKED_ENTRIES',$lng->txt(
'marked_entries'));
374 $searchTpl->setVariable(
'TABLE', $table->getHtml());
375 $this->tpl->setContent($searchTpl->get());
384 global
$lng, $ilUser;
386 if (
$_GET[
"search_grp"] !=
"")
388 $_POST[
"search_grp"] = explode(
",",
$_GET[
"search_grp"]);
391 if (!is_array(
$_POST[
"search_grp"]) ||
392 count(
$_POST[
"search_grp"]) == 0)
399 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"mail"));
400 include_once
'Services/Contact/classes/class.ilMailSearchCoursesMembersTableGUI.php';
402 $table->setId(
'show_grps_mmbrs_tbl');
403 $lng->loadLanguageModule(
'crs');
406 $tableData = array();
407 $searchTpl =
new ilTemplate(
'tpl.mail_search_template.html',
true,
true,
'Services/Contact');
409 foreach(
$_POST[
"search_grp"] as $grp_id)
416 $grp_members = $group_obj->getGroupMemberData($group_obj->getGroupMemberIds());
418 foreach($grp_members as $member)
421 if($tmp_usr->checkTimeLimit()==
false || $tmp_usr->getActive() == false )
430 $fullname = $member[
'lastname'].
', '.$member[
'firstname'];
433 'MEMBERS_ID' => $member[
"id"],
434 'MEMBERS_LOGIN' => $member[
"login"],
435 'MEMBERS_NAME' => $fullname,
436 'MEMBERS_CRS_GRP' => $group_obj->getTitle(),
437 'MEMBERS_IN_ADDRESSBOOK' => $this->abook->checkEntryByLogin($member[
"login"]) ? $lng->txt(
"yes") : $lng->txt(
"no"),
438 'search_grp' => $grp_id
440 $tableData[] = $rowData;
444 $table->setData($tableData);
445 if (count($tableData))
449 $searchTpl->setVariable(
"TXT_MARKED_ENTRIES",$lng->txt(
"marked_entries"));
451 $searchTpl->setVariable(
'TABLE', $table->getHtml());
452 $this->tpl->setContent($searchTpl->get());