Course/group skill notification.
More...
|
| sendMail ($a_user_id, array $a_achievements, $a_last_run) |
| Send news mail for 1 user and n objects. More...
|
|
| checkSchedule ($a_ts_last_run, $a_schedule_type, $a_schedule_value) |
|
Course/group skill notification.
- Author
- Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..com
Definition at line 10 of file class.ilSkillNotifications.php.
◆ __construct()
ilSkillNotifications::__construct |
( |
| ) |
|
Constructor.
Definition at line 36 of file class.ilSkillNotifications.php.
References $DIC, and user().
40 $this->lng = $DIC->language();
41 if (isset($DIC[
"ilUser"])) {
42 $this->
user = $DIC->user();
44 if (isset($DIC[
"ilClientIniFile"])) {
45 $this->client_ini = $DIC[
"ilClientIniFile"];
47 if (isset($DIC[
"tree"])) {
48 $this->tree = $DIC->repositoryTree();
◆ getDefaultScheduleType()
ilSkillNotifications::getDefaultScheduleType |
( |
| ) |
|
◆ getDefaultScheduleValue()
ilSkillNotifications::getDefaultScheduleValue |
( |
| ) |
|
◆ getDescription()
ilSkillNotifications::getDescription |
( |
| ) |
|
◆ getId()
ilSkillNotifications::getId |
( |
| ) |
|
◆ getTitle()
ilSkillNotifications::getTitle |
( |
| ) |
|
◆ hasAutoActivation()
ilSkillNotifications::hasAutoActivation |
( |
| ) |
|
◆ hasFlexibleSchedule()
ilSkillNotifications::hasFlexibleSchedule |
( |
| ) |
|
◆ run()
ilSkillNotifications::run |
( |
| ) |
|
Definition at line 91 of file class.ilSkillNotifications.php.
References Vendor\Package\$a, $DIC, $lng, $log, $result, ilLoggerFactory\getLogger(), ilBasicSkill\getNewAchievementsPerUser(), sendMail(), ilDatePresentation\setUseRelativeDates(), ilCronJobResult\STATUS_NO_ACTION, ilCronJobResult\STATUS_OK, and ilDatePresentation\useRelativeDates().
95 $lng = $DIC->language();
98 $log->debug(
"===Skill Notifications=== start");
101 $status_details = null;
104 $last_run = $setting->get(get_class($this));
108 $last_run = date(
"Y-m-d H:i:s", strtotime(
"yesterday"));
110 $status_details =
"No previous run found - starting from yesterday.";
112 elseif (strlen($last_run) == 10) {
113 $last_run .=
" 00:00:00";
115 $status_details =
"Switched from daily runs to open schedule.";
129 foreach ($achievements as $user_id =>
$a) {
140 $log->debug(
"save run");
143 $setting->set(get_class($this), date(
"Y-m-d H:i:s"));
148 if ($status_details) {
149 $result->setMessage($status_details);
152 $log->debug(
"===Skill Notifications=== done");
sendMail($a_user_id, array $a_achievements, $a_last_run)
Send news mail for 1 user and n objects.
static setUseRelativeDates($a_status)
set use relative dates
static useRelativeDates()
check if relative dates are used
static getNewAchievementsPerUser(string $a_timestamp, string $a_timestamp_to=null, int $a_user_id=0, int $a_self_eval=0)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
static getLogger($a_component_id)
Get component logger.
Cron job result data container.
◆ sendMail()
ilSkillNotifications::sendMail |
( |
|
$a_user_id, |
|
|
array |
$a_achievements, |
|
|
|
$a_last_run |
|
) |
| |
|
protected |
Send news mail for 1 user and n objects.
- Parameters
-
int | $a_user_id | |
array | $a_objects | |
string | $a_last_run | |
Definition at line 165 of file class.ilSkillNotifications.php.
References $client, $client_ini, $lng, $tree, $txt, $type, ilLink\_getStaticLink(), ilObjUser\_lookupLogin(), ilSkillTreeNode\_lookupTitle(), ANONYMOUS_USER_ID, ilDatePresentation\formatDate(), IL_CAL_DATETIME, IL_CAL_UNIX, and ilBasicSkill\lookupLevelTitle().
Referenced by run().
171 $ntf->setLangModules(array(
"skll"));
174 $lng = $ntf->getUserLanguage($a_user_id);
182 $a_achievements = $vtree->getOrderedNodeset($a_achievements,
"skill_id",
"tref_id");
184 foreach ($a_achievements as $skill_level) {
189 foreach (
$tree->getPathId($skill_level[
"trigger_ref_id"]) as $node) {
192 $path = implode(
"-", $path);
194 $ref_id = $skill_level[
"trigger_ref_id"];
195 $obj_id = $skill_level[
"trigger_obj_id"];
196 $type = $skill_level[
"trigger_obj_type"];
197 $title = $skill_level[
"trigger_title"];
199 if ($skill_level[
"trigger_obj_id"] != $last_obj_id) {
200 $last_obj_id = $skill_level[
"trigger_obj_id"];
212 $ntf->setIntroductionLangId(
"skll_intro_skill_notification_for");
216 $lng->txt(
"skll_new_skill_achievements"),
222 $ntf->addAdditionalInfo(
229 $client = $ilClientIniFile->readVariable(
'client',
'name');
230 $subject = sprintf(
$lng->txt(
"skll_competence_achievements"),
$client);
241 $ntf->composeAndGetMessage($a_user_id, null,
"read",
true),
static _lookupLogin($a_user_id)
lookup login
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
if($_SERVER['argc']< 4) $client
static lookupLevelTitle(int $a_id)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
Wrapper classes for system notifications.
◆ $client_ini
ilSkillNotifications::$client_ini |
|
protected |
◆ $lng
ilSkillNotifications::$lng |
|
protected |
◆ $tree
ilSkillNotifications::$tree |
|
protected |
◆ $user
ilSkillNotifications::$user |
|
protected |
The documentation for this class was generated from the following file: