3 declare(strict_types=1);
38 $this->
lng = $DIC->language();
43 return "mem_min_members";
48 return $this->
lng->txt(
"mem_cron_min_members");
53 return $this->
lng->txt(
"mem_cron_min_members_info");
58 return CronJobScheduleType::SCHEDULE_TYPE_DAILY;
81 $recipients_map = array();
86 if (count($recipients_map)) {
87 foreach ($recipients_map as $reci_id => $items) {
91 $message = count($recipients_map) .
" notifications sent";
95 $result->setStatus($status);
101 protected function getCourses(array &$a_recipients_map): void
104 $too_few = (bool) $item[0];
109 foreach ($item[1] as $reci_id) {
110 $a_recipients_map[$reci_id][] = array(
"crs", $obj_id, $item[0]);
116 protected function getGroups(array &$a_recipients_map): void
119 $too_few = (bool) $item[0];
124 foreach ($item[1] as $reci_id) {
125 $a_recipients_map[$reci_id][] = array(
"grp", $obj_id, $item[0]);
131 protected function sendMessage(
int $a_reci_id, array $a_items): void
134 $ntf->setLangModules(array(
"crs"));
137 $ntf->setReasonLangId(
"mem_cron_min_members_reason");
143 foreach ($a_items as $item) {
144 $obj_type = (string) $item[0];
145 $obj_id = (
int) $item[1];
151 $list[] = $title .
"\n" .
$url .
"\n";
153 $list = implode($ntf->getBlockBorder(), $list);
155 $ntf->addAdditionalInfo(
"mem_cron_min_members_intro", $list,
true);
156 $ntf->addAdditionalInfo(
"mem_cron_min_members_task",
"");
163 $lng->
txt(
"mem_cron_min_members_subject"),
164 $ntf->composeAndGetMessage($a_reci_id, null,
"read",
true),
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getUserLanguage()
Return language of user.
static _getAllReferences(int $id)
get all reference ids for object ID
sendMessage(int $a_reci_id, array $a_items)
Cron for course/group minimum members.
static findGroupsWithNotEnoughMembers()
static _lookupTitle(int $obj_id)
final const STATUS_NO_ACTION
getDefaultScheduleValue()
static findCoursesWithNotEnoughMembers()
getGroups(array &$a_recipients_map)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupLogin(int $a_user_id)
getCourses(array &$a_recipients_map)