24 require_once
'./Services/User/classes/class.ilObjUser.php';
25 require_once
'Services/Mail/classes/class.ilMailbox.php';
26 require_once
'Services/Mail/classes/class.ilFormatMail.php';
27 require_once
'Services/Contact/classes/class.ilAddressbook.php';
54 $this->ctrl->saveParameter($this,
"mobj_id");
57 include_once
"Services/Mail/classes/class.ilMail.php";
59 $this->mailing_allowed = $rbacsystem->checkAccess(
'mail_visible',$mail->getMailObjectReferenceId());
67 $forward_class = $this->ctrl->getNextClass($this);
68 switch($forward_class)
71 if (!(
$cmd = $this->ctrl->getCmd()))
73 $cmd =
"showMyGroups";
86 if (
$_GET[
"view"] ==
"mygroups")
88 $ids = ((int)
$_GET[
'search_grp']) ? array((
int)
$_GET[
'search_grp']) :
$_POST[
'search_grp'];
99 else if (
$_GET[
"view"] ==
"grp_members")
101 $ids = ((int)
$_GET[
'search_members']) ? array((
int)
$_GET[
'search_members']) :
$_POST[
'search_members'];
120 global $ilUser,
$lng, $rbacreview;
124 if (!is_array($old_mail_data = $this->umail->getSavedData()))
126 $this->umail->savePostData(
140 require_once
'classes/class.ilObject.php';
141 $ids = ((int)
$_GET[
'search_grp']) ? array((
int)
$_GET[
'search_grp']) :
$_POST[
'search_grp'];
142 foreach ($ids as $grp_id)
147 $roles = $rbacreview->getAssignableChildRoles($ref_id);
148 foreach ($roles as $role)
150 if (substr($role[
'title'], 0, 14) ==
'il_grp_member_' ||
151 substr($role[
'title'], 0, 13) ==
'il_grp_admin_')
153 if(isset($old_mail_data[
'rcp_to']) &&
154 trim($old_mail_data[
'rcp_to']) !=
'')
156 $rcpt = $rbacreview->getRoleMailboxAddress($role[
'obj_id']);
158 if(!$this->umail->doesRecipientStillExists($rcpt, $old_mail_data[
'rcp_to']))
159 array_push($members, $rcpt);
165 array_push($members, $rbacreview->getRoleMailboxAddress($role[
'obj_id']));
173 $mail_data = $this->umail->appendSearchResult($members,
'to');
175 $mail_data = $this->umail->getSavedData();
177 $this->umail->savePostData(
178 $mail_data[
"user_id"],
179 $mail_data[
"attachments"],
180 $mail_data[
"rcp_to"],
181 $mail_data[
"rcp_cc"],
182 $mail_data[
"rcp_bcc"],
183 $mail_data[
"m_type"],
184 $mail_data[
"m_email"],
185 $mail_data[
"m_subject"],
186 $mail_data[
"m_message"],
187 $mail_data[
"use_placeholders"]
197 if (!is_array($this->umail->getSavedData()))
199 $this->umail->savePostData(
213 $ids = ((int)
$_GET[
'search_members']) ? array((
int)
$_GET[
'search_members']) :
$_POST[
'search_members'];
215 foreach ($ids as $member)
218 array_push($members,
$login);
220 $mail_data = $this->umail->appendSearchResult($members,
"to");
222 $this->umail->savePostData(
223 $mail_data[
"user_id"],
224 $mail_data[
"attachments"],
225 $mail_data[
"rcp_to"],
226 $mail_data[
"rcp_cc"],
227 $mail_data[
"rcp_bcc"],
228 $mail_data[
"m_type"],
229 $mail_data[
"m_email"],
230 $mail_data[
"m_subject"],
231 $mail_data[
"m_message"],
232 $mail_data[
"use_placeholders"]
245 $ids = ((int)
$_GET[
'search_members']) ? array((
int)
$_GET[
'search_members']) :
$_POST[
'search_members'];
251 foreach ($ids as $member)
255 if (!$this->abook->checkEntry(
$login))
263 $this->abook->addEntry(
286 if (
$_GET[
"view"] ==
"mygroups" &&
287 $_GET[
"ref"] ==
"mail")
289 $this->ctrl->returnToParent($this);
302 global
$lng, $ilUser, $ilObjDataCache, $tree;
304 include_once
'Modules/Group/classes/class.ilGroupParticipants.php';
306 $this->tpl->setVariable(
'HEADER', $this->lng->txt(
'mail'));
308 $searchTpl =
new ilTemplate(
'tpl.mail_search_template.html',
true,
true,
'Services/Contact');
310 $_GET[
'view'] =
'mygroups';
312 $lng->loadLanguageModule(
'crs');
314 $this->ctrl->setParameter($this,
'view',
'mygroups');
316 include_once
'Services/Contact/classes/class.ilMailSearchCoursesTableGUI.php';
318 $table->setId(
'search_grps_tbl');
322 $tableData = array();
323 if (is_array($grp_ids) &&
327 include_once(
"./Services/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
328 foreach($grp_ids as $grp_id)
333 $grp_members = $oGroupParticipants->getParticipants();
335 foreach ($grp_members as
$key => $member)
339 if($tmp_usr->checkTimeLimit()==
false || $tmp_usr->getActive() == false )
341 unset($grp_members[
$key]);
348 $path_arr = $tree->getPathFull(
$ref_id, $tree->getRootId());
351 foreach($path_arr as
$data)
357 $path .= $data[
'title'];
359 $path = $this->lng->txt(
'path').
': '.$path;
362 $current_selection_list->setListTitle($this->lng->txt(
"actions"));
363 $current_selection_list->setId(
"act_".$counter);
365 $this->ctrl->setParameter($this,
'search_grp', $grp_id);
366 $this->ctrl->setParameter($this,
'view',
'mygroups');
368 if ($this->mailing_allowed)
369 $current_selection_list->addItem($this->lng->txt(
"mail_members"),
'', $this->ctrl->getLinkTarget($this,
"mail"));
370 $current_selection_list->addItem($this->lng->txt(
"mail_list_members"),
'', $this->ctrl->getLinkTarget($this,
"showMembers"));
372 $this->ctrl->clearParameters($this);
377 'CRS_NAME' => $ilObjDataCache->lookupTitle($grp_id),
378 'CRS_NO_MEMBERS' => count($grp_members),
380 'COMMAND_SELECTION_LIST' => $current_selection_list->getHTML()
383 $tableData[] = $rowData;
387 $table->setData($tableData);
390 $this->tpl->setVariable(
'TXT_MARKED_ENTRIES',$lng->txt(
'marked_entries'));
393 $searchTpl->setVariable(
'TABLE', $table->getHtml());
394 $this->tpl->setContent($searchTpl->get());
403 global
$lng, $ilUser;
405 if (
$_GET[
"search_grp"] !=
"")
407 $_POST[
"search_grp"] = explode(
",",
$_GET[
"search_grp"]);
410 if (!is_array(
$_POST[
"search_grp"]) ||
411 count(
$_POST[
"search_grp"]) == 0)
418 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"mail"));
419 include_once
'Services/Contact/classes/class.ilMailSearchCoursesMembersTableGUI.php';
421 $table->setId(
'show_grps_mmbrs_tbl');
422 $lng->loadLanguageModule(
'crs');
425 $tableData = array();
426 $searchTpl =
new ilTemplate(
'tpl.mail_search_template.html',
true,
true,
'Services/Contact');
428 foreach(
$_POST[
"search_grp"] as $grp_id)
435 $grp_members = $group_obj->getGroupMemberData($group_obj->getGroupMemberIds());
437 foreach($grp_members as $member)
440 if($tmp_usr->checkTimeLimit()==
false || $tmp_usr->getActive() == false )
449 $fullname = $member[
'lastname'].
', '.$member[
'firstname'];
452 'MEMBERS_ID' => $member[
"id"],
453 'MEMBERS_LOGIN' => $member[
"login"],
454 'MEMBERS_NAME' => $fullname,
455 'MEMBERS_CRS_GRP' => $group_obj->getTitle(),
456 'MEMBERS_IN_ADDRESSBOOK' => $this->abook->checkEntryByLogin($member[
"login"]) ? $lng->txt(
"yes") : $lng->txt(
"no"),
457 'search_grp' => $grp_id
459 $tableData[] = $rowData;
463 $table->setData($tableData);
464 if (count($tableData))
468 $searchTpl->setVariable(
"TXT_MARKED_ENTRIES",$lng->txt(
"marked_entries"));
470 $searchTpl->setVariable(
'TABLE', $table->getHtml());
471 $this->tpl->setContent($searchTpl->get());