19 declare(strict_types=1);
53 $this->
ctrl = $DIC[
'ilCtrl'];
54 $this->tpl = $DIC[
'tpl'];
55 $this->
lng = $DIC[
'lng'];
56 $this->
access = $DIC[
'ilAccess'];
57 $this->httpRequest = $DIC->http()->request();
59 $this->
lng->loadLanguageModule(
'mail');
60 $this->
lng->loadLanguageModule(
'search');
66 $this->mail_roles = $objMailMemberRoles->
getMailRoles($ref_id);
72 $next_class = $this->
ctrl->getNextClass($this);
73 $cmd = $this->
ctrl->getCmd();
75 $this->
ctrl->setReturn($this,
'');
78 case 'sendMailToSelectedUsers':
82 case 'showSelectableUsers':
95 if (isset($this->httpRequest->getQueryParams()[
'returned_from_mail']) && $this->httpRequest->getQueryParams()[
'returned_from_mail'] ===
'1') {
115 $back_link = $this->
ctrl->getParentReturn($this);
117 if (isset($this->httpRequest->getServerParams()[
'HTTP_REFERER'])) {
118 $referer = $this->httpRequest->getServerParams()[
'HTTP_REFERER'];
119 $urlParts = parse_url($referer);
121 if (isset($urlParts[
'path'])) {
122 $url = ltrim(basename($urlParts[
'path']),
'/');
123 if (isset($urlParts[
'query'])) {
124 $url .=
'?' . $urlParts[
'query'];
148 if ($form->checkInput()) {
149 if ($form->getInput(
'mail_member_type') ===
'mail_member_roles') {
150 if (is_array($form->getInput(
'roles')) && count($form->getInput(
'roles')) > 0) {
151 $role_mail_boxes = [];
152 $roles = $form->getInput(
'roles');
153 foreach ($roles as $role_id) {
154 $mailbox = $this->objMailMemberRoles->getMailboxRoleAddress((
int) $role_id);
155 $role_mail_boxes[] = $mailbox;
166 'rcp_to' => implode(
',', $role_mail_boxes),
167 'sig' => $this->gui->createMailSignature()
172 $form->setValuesByPost();
173 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'));
183 $form->setValuesByPost();
189 $contextParameters = [];
195 if ($this->
access->checkAccess(
'write',
'', $this->ref_id)) {
196 $contextParameters = [
206 if (
'crs' ===
$type) {
213 if ($this->
access->checkAccess(
'write',
'', $this->ref_id)) {
214 $contextParameters = [
223 return $contextParameters;
228 $this->tpl->loadStandardTemplate();
233 $this->tpl->setContent($tbl->getHTML());
239 if (!isset($this->httpRequest->getParsedBody()[
'user_ids']) || !is_array($this->httpRequest->getParsedBody()[
'user_ids']) || 0 === count($this->httpRequest->getParsedBody()[
'user_ids'])) {
240 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"));
246 foreach ($this->httpRequest->getParsedBody()[
'user_ids'] as $usr_id) {
250 if (!count(array_filter($rcps))) {
251 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"));
264 'sig' => $this->gui->createMailSignature(),
275 $this->tpl->setContent($form->getHTML());
295 $this->
lng->loadLanguageModule(
'mail');
298 $form->setTitle($this->
lng->txt(
'mail_members'));
300 $form->setFormAction($this->
ctrl->getFormAction($this,
'nextMailForm'));
304 $form->addItem($radio_grp);
305 $form->addCommandButton(
'nextMailForm', $this->
lng->txt(
'mail_members_search_continue'));
306 $form->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
326 $radio_sel_users =
new ilRadioOption($this->
lng->txt(
'mail_sel_users'),
'mail_sel_users');
328 $radio_roles =
new ilRadioOption($this->objMailMemberRoles->getRadioOptionTitle(),
'mail_member_roles');
329 foreach ($mail_roles as $role) {
330 $chk_role =
new ilCheckboxInputGUI($role[
'form_option_title'],
'roles[' . $role[
'role_id'] .
']');
332 if (isset($role[
'default_checked']) && $role[
'default_checked'] ===
true) {
333 $chk_role->setChecked(
true);
335 $chk_role->setValue((
string) $role[
'role_id']);
336 $chk_role->setInfo($role[
'mailbox']);
340 $radio_grp->setValue(
'mail_member_roles');
342 $radio_grp->addOption($radio_sel_users);
343 $radio_grp->addOption($radio_roles);
static get(string $a_var)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
ilAbstractMailMemberRoles $objMailMemberRoles
const PROP_CONTEXT_SUBJECT_PREFIX
Class ilMailMemberSearchGUI.
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
static _lookupObjId(int $ref_id)
const EXTERNAL_MAIL_PREFIX
ilParticipants $objParticipants
sendMailToSelectedUsers()
redirectToParentReferer()
setObjParticipants(ilParticipants $objParticipants)
Base class for course and group participants.
__construct(object $gui, int $ref_id, ilAbstractMailMemberRoles $objMailMemberRoles)
ilMailMemberSearchGUI constructor.
Class ilMailMemberSearchDataProvider.
static _lookupType(int $id, bool $reference=false)
Class ilAbstractMailMemberRoles.
static set(string $a_var, $a_val)
Set a value.
ServerRequestInterface $httpRequest
getMailRoles(int $ref_id)
static _lookupLogin(int $a_user_id)