19 declare(strict_types=1);
40 ILIAS\
HTTP\Wrapper\WrapperFactory $http_wrapper,
43 protected int $context_prg_obj_id,
54 $this->
lng->loadLanguageModule(
'mail');
55 $this->
lng->loadLanguageModule(
'search');
75 $this->back_target = $target;
80 $cmd = $this->
ctrl->getCmd();
82 $this->
ctrl->setReturn($this,
'');
85 case 'showSelectableUsers':
89 case 'sendMailToSelectedUsers':
101 throw new Exception(
'Unknown command ' . $cmd);
107 $this->tpl->loadStandardTemplate();
111 $this->tpl->setContent($tbl->getHTML());
119 $usr_id = $assignment->getUserId();
122 $publicName = $name[
'lastname'] .
', ' . $name[
'firstname'];
124 'user_id' => $usr_id,
126 'name' => $publicName,
127 'root_id' => $assignment->getRootId()
129 $usr_ids[] = $usr_id;
132 $allowed_user_ids = $this->permission_helper->filterUserIds(
133 array_unique($usr_ids),
138 $foreign = $this->messages->getMessageCollection(
'mails_foreign_assignment');
140 foreach(
$data as $entry) {
141 if($entry[
'root_id'] === $this->context_prg_obj_id) {
142 $ret[$entry[
'user_id']] = $entry;
144 $foreign->add(
false,
'foreign_assignment', $entry[
'name']);
148 if($foreign->hasErrors()) {
149 $this->messages->showMessages($foreign);
164 if ($this->http_wrapper->post()->has(
"user_ids")) {
165 $user_ids = $this->http_wrapper->post()->retrieve(
176 if (!count($user_ids)) {
177 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_checkbox"));
183 foreach ($user_ids as $usr_id) {
187 if (!count(array_filter($rcps))) {
188 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_checkbox"));
217 $context_array = array(
225 return $context_array;
231 if (is_null($back_target)) {
232 throw new LogicException(
"Can't redirect. No back target given.");
235 $this->
ctrl->redirectToURL($back_target);
240 $link = chr(13) . chr(10) . chr(13) . chr(10);
241 $link .= $this->
lng->txt(
'prg_mail_permanent_link');
242 $link .= chr(13) . chr(10) . chr(13) . chr(10);
244 return rawurlencode(base64_encode($link));
250 $assignment = array_shift($assignments);
257 $assignment = array_shift($assignments);
258 return (
int) $assignment->getRootId();
ILIAS HTTP Wrapper WrapperFactory $http_wrapper
setAssignments(array $assignments)
sendMailToSelectedUsers()
Util around ilPRGMessageCollection factors and output collections.
Interface Observer Contains several chained tasks and infos about them.
ILIAS Refinery Factory $refinery
static _lookupName(int $a_user_id)
lookup user name
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setBackTarget(string $target)
ilPRGPermissionsHelper $permission_helper
ilObjStudyProgrammeMembersGUI: ilStudyProgrammeRepositorySearchGUI ilObjStudyProgrammeMembersGUI: il...
__construct(ilCtrl $ctrl, ilGlobalTemplateInterface $tpl, ilLanguage $lng, ilAccessHandler $access, ILIAS\HTTP\Wrapper\WrapperFactory $http_wrapper, ILIAS\Refinery\Factory $refinery, ilPRGPermissionsHelper $permission_helper, protected int $context_prg_obj_id, protected ilPRGMessagePrinter $messages,)
Both role and OrgU-based permissions are relevant in many places of the PRG.
ilGlobalTemplateInterface $tpl
static getRefIdFor(int $obj_id)
static _lookupType(int $id, bool $reference=false)
static _lookupLogin(int $a_user_id)