19 declare(strict_types=1);
48 $this->
ctrl = $DIC[
'ilCtrl'];
49 $this->tpl = $DIC[
'tpl'];
50 $this->
lng = $DIC[
'lng'];
51 $this->
access = $DIC[
'ilAccess'];
52 $this->httpRequest = $DIC->http()->request();
54 $this->
lng->loadLanguageModule(
'mail');
55 $this->
lng->loadLanguageModule(
'search');
56 $this->mail_roles = $objMailMemberRoles->getMailRoles($ref_id);
62 $cmd = $this->
ctrl->getCmd();
64 $this->
ctrl->setReturn($this,
'');
67 case 'sendMailToSelectedUsers':
71 case 'showSelectableUsers':
84 if (isset($this->httpRequest->getQueryParams()[
'returned_from_mail']) && $this->httpRequest->getQueryParams()[
'returned_from_mail'] ===
'1') {
103 $back_link = $this->
ctrl->getParentReturn($this);
105 if (isset($this->httpRequest->getServerParams()[
'HTTP_REFERER'])) {
106 $referer = $this->httpRequest->getServerParams()[
'HTTP_REFERER'];
107 $urlParts = parse_url($referer);
109 if (isset($urlParts[
'path'])) {
110 $url = ltrim(basename($urlParts[
'path']),
'/');
111 if (isset($urlParts[
'query'])) {
112 $url .=
'?' . $urlParts[
'query'];
136 if ($form->checkInput()) {
137 if ($form->getInput(
'mail_member_type') ===
'mail_member_roles') {
138 if (is_array($form->getInput(
'roles')) && $form->getInput(
'roles') !== []) {
139 $role_mail_boxes = [];
140 $roles = $form->getInput(
'roles');
141 foreach ($roles as $role_id) {
142 $mailbox = $this->objMailMemberRoles->getMailboxRoleAddress((
int) $role_id);
143 $role_mail_boxes[] = $mailbox;
154 'rcp_to' => implode(
',', $role_mail_boxes),
155 'sig' => $this->gui->createMailSignature()
160 $form->setValuesByPost();
161 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'));
171 $form->setValuesByPost();
177 $contextParameters = [];
183 if ($this->
access->checkAccess(
'write',
'', $this->ref_id)) {
184 $contextParameters = [
194 if (
'crs' === $type) {
201 if ($this->
access->checkAccess(
'write',
'', $this->ref_id)) {
202 $contextParameters = [
211 return $contextParameters;
216 $this->tpl->loadStandardTemplate();
221 $this->tpl->setContent($tbl->getHTML());
227 if (!isset($this->httpRequest->getParsedBody()[
'user_ids']) || !is_array($this->httpRequest->getParsedBody()[
'user_ids']) || [] === $this->httpRequest->getParsedBody()[
'user_ids']) {
228 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"));
234 foreach ($this->httpRequest->getParsedBody()[
'user_ids'] as $usr_id) {
238 if (array_filter($rcps) === []) {
239 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"));
252 'sig' => $this->gui->createMailSignature(),
263 $this->tpl->setContent($form->getHTML());
280 $this->
lng->loadLanguageModule(
'mail');
283 $form->setTitle($this->
lng->txt(
'mail_members'));
285 $form->setFormAction($this->
ctrl->getFormAction($this,
'nextMailForm'));
289 $form->addItem($radio_grp);
290 $form->addCommandButton(
'nextMailForm', $this->
lng->txt(
'mail_members_search_continue'));
291 $form->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
311 $radio_sel_users =
new ilRadioOption($this->
lng->txt(
'mail_sel_users'),
'mail_sel_users');
313 $radio_roles =
new ilRadioOption($this->objMailMemberRoles->getRadioOptionTitle(),
'mail_member_roles');
314 foreach ($mail_roles as $role) {
315 $chk_role =
new ilCheckboxInputGUI($role[
'form_option_title'],
'roles[' . $role[
'role_id'] .
']');
317 if (isset($role[
'default_checked']) && $role[
'default_checked']) {
318 $chk_role->setChecked(
true);
320 $chk_role->setValue((
string) $role[
'role_id']);
321 $chk_role->setInfo($role[
'mailbox']);
325 $radio_grp->setValue(
'mail_member_roles');
327 $radio_grp->addOption($radio_sel_users);
328 $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...
readonly ilCtrlInterface $ctrl
const PROP_CONTEXT_SUBJECT_PREFIX
Class ilMailMemberSearchGUI.
readonly ilAccessHandler $access
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()
readonly ilGlobalTemplateInterface $tpl
redirectToParentReferer()
setObjParticipants(ilParticipants $objParticipants)
Base class for course and group participants.
readonly array $mail_roles
readonly ServerRequestInterface $httpRequest
Class ilMailMemberSearchDataProvider.
static _lookupType(int $id, bool $reference=false)
Class ilAbstractMailMemberRoles.
static set(string $a_var, $a_val)
Set a value.
__construct(private readonly object $gui, public int $ref_id, private readonly ilAbstractMailMemberRoles $objMailMemberRoles)
ilMailMemberSearchGUI constructor.
static _lookupLogin(int $a_user_id)