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']))
143 array_push($members,
'#'.$role[
'title']);
152 array_push($members,
'#'.$role[
'title']);
160 $mail_data = $this->umail->appendSearchResult($members,
'to');
162 $mail_data = $this->umail->getSavedData();
164 $this->umail->savePostData(
165 $mail_data[
"user_id"],
166 $mail_data[
"attachments"],
167 $mail_data[
"rcp_to"],
168 $mail_data[
"rcp_cc"],
169 $mail_data[
"rcp_bcc"],
170 $mail_data[
"m_type"],
171 $mail_data[
"m_email"],
172 $mail_data[
"m_subject"],
173 $mail_data[
"m_message"],
174 $mail_data[
"use_placeholders"]
186 if (!is_array($this->umail->getSavedData()))
188 $this->umail->savePostData(
202 $ids = ((int)
$_GET[
'search_members']) ? array((
int)
$_GET[
'search_members']) :
$_POST[
'search_members'];
204 foreach ($ids as $member)
207 array_push($members, $login);
209 $mail_data = $this->umail->appendSearchResult($members,
"to");
211 $this->umail->savePostData(
212 $mail_data[
"user_id"],
213 $mail_data[
"attachments"],
214 $mail_data[
"rcp_to"],
215 $mail_data[
"rcp_cc"],
216 $mail_data[
"rcp_bcc"],
217 $mail_data[
"m_type"],
218 $mail_data[
"m_email"],
219 $mail_data[
"m_subject"],
220 $mail_data[
"m_message"],
221 $mail_data[
"use_placeholders"]
234 $ids = ((int)
$_GET[
'search_members']) ? array((
int)
$_GET[
'search_members']) :
$_POST[
'search_members'];
240 foreach ($ids as $member)
244 if (!$this->abook->checkEntry($login))
252 $this->abook->addEntry(
275 if (
$_GET[
"view"] ==
"mygroups" &&
276 $_GET[
"ref"] ==
"mail")
278 $this->ctrl->returnToParent($this);
291 global
$lng, $ilUser, $ilObjDataCache, $tree;
293 include_once
'Modules/Group/classes/class.ilGroupParticipants.php';
295 $this->tpl->setVariable(
'HEADER', $this->lng->txt(
'mail'));
297 $searchTpl =
new ilTemplate(
'tpl.mail_search_template.html',
true,
true,
'Services/Contact');
299 $_GET[
'view'] =
'mygroups';
301 $lng->loadLanguageModule(
'crs');
303 $this->ctrl->setParameter($this,
'view',
'mygroups');
305 include_once
'Services/Contact/classes/class.ilMailSearchCoursesTableGUI.php';
307 $table->setId(
'search_grps_tbl');
311 $tableData = array();
312 if (is_array($grp_ids) &&
316 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
317 foreach($grp_ids as $grp_id)
322 $grp_members = $oGroupParticipants->getParticipants();
324 foreach ($grp_members as $key => $member)
328 if($tmp_usr->checkTimeLimit()==
false || $tmp_usr->getActive() == false )
330 unset($grp_members[$key]);
337 $path_arr = $tree->getPathFull(
$ref_id, $tree->getRootId());
340 foreach($path_arr as
$data)
346 $path .= $data[
'title'];
351 $current_selection_list->setListTitle($this->lng->txt(
"actions"));
352 $current_selection_list->setId(
"act_".$counter);
354 $this->ctrl->setParameter($this,
'search_grp', $grp_id);
355 $this->ctrl->setParameter($this,
'view',
'mygroups');
357 if ($this->mailing_allowed)
358 $current_selection_list->addItem($this->lng->txt(
"mail_members"),
'', $this->ctrl->getLinkTarget($this,
"mail"));
359 $current_selection_list->addItem($this->lng->txt(
"mail_list_members"),
'', $this->ctrl->getLinkTarget($this,
"showMembers"));
361 $this->ctrl->clearParameters($this);
366 'CRS_NAME' => $ilObjDataCache->lookupTitle($grp_id),
367 'CRS_NO_MEMBERS' => count($grp_members),
369 'COMMAND_SELECTION_LIST' => $current_selection_list->getHTML()
372 $tableData[] = $rowData;
376 $table->setData($tableData);
379 $this->tpl->setVariable(
'TXT_MARKED_ENTRIES',$lng->txt(
'marked_entries'));
382 $searchTpl->setVariable(
'TABLE', $table->getHtml());
383 $this->tpl->setContent($searchTpl->get());
392 global
$lng, $ilUser;
394 if (
$_GET[
"search_grp"] !=
"")
396 $_POST[
"search_grp"] = explode(
",",
$_GET[
"search_grp"]);
399 if (!is_array(
$_POST[
"search_grp"]) ||
400 count(
$_POST[
"search_grp"]) == 0)
407 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"mail"));
408 include_once
'Services/Contact/classes/class.ilMailSearchCoursesMembersTableGUI.php';
410 $table->setId(
'show_grps_mmbrs_tbl');
411 $lng->loadLanguageModule(
'crs');
414 $tableData = array();
415 $searchTpl =
new ilTemplate(
'tpl.mail_search_template.html',
true,
true,
'Services/Contact');
417 foreach(
$_POST[
"search_grp"] as $grp_id)
424 $grp_members = $group_obj->getGroupMemberData($group_obj->getGroupMemberIds());
426 foreach($grp_members as $member)
429 if($tmp_usr->checkTimeLimit()==
false || $tmp_usr->getActive() == false )
438 $fullname = $member[
'lastname'].
', '.$member[
'firstname'];
441 'MEMBERS_ID' => $member[
"id"],
442 'MEMBERS_LOGIN' => $member[
"login"],
443 'MEMBERS_NAME' => $fullname,
444 'MEMBERS_CRS_GRP' => $group_obj->getTitle(),
445 'MEMBERS_IN_ADDRESSBOOK' => $this->abook->checkEntryByLogin($member[
"login"]) ? $lng->txt(
"yes") : $lng->txt(
"no"),
446 'search_grp' => $grp_id
448 $tableData[] = $rowData;
452 $table->setData($tableData);
453 if (count($tableData))
457 $searchTpl->setVariable(
"TXT_MARKED_ENTRIES",$lng->txt(
"marked_entries"));
459 $searchTpl->setVariable(
'TABLE', $table->getHtml());
460 $this->tpl->setContent($searchTpl->get());