5include_once 
"Services/Cron/classes/class.ilCronJob.php";
 
   42        $this->lng = 
$DIC->language();
 
   43        if (isset(
$DIC[
"ilUser"])) {
 
   44            $this->
user = $DIC->user();
 
   46        if (isset(
$DIC[
"ilClientIniFile"])) {
 
   47            $this->client_ini = 
$DIC[
"ilClientIniFile"];
 
   49        if (isset(
$DIC[
"tree"])) {
 
   50            $this->tree = 
$DIC->repositoryTree();
 
   56        return "skll_notification";
 
   62        $lng->loadLanguageModule(
"skll");
 
   63        return $lng->txt(
"skll_skill_notification");
 
   69        $lng->loadLanguageModule(
"skll");
 
   70        return $lng->txt(
"skll_skill_notification_desc");
 
  100        $log->debug(
"===Skill Notifications=== start");
 
  103        $status_details = 
null;
 
  106        $last_run = $setting->get(get_class($this));
 
  110            $last_run = date(
"Y-m-d H:i:s", strtotime(
"yesterday"));
 
  112            $status_details = 
"No previous run found - starting from yesterday.";
 
  114        elseif (strlen($last_run) == 10) {
 
  115            $last_run .= 
" 00:00:00";
 
  117            $status_details = 
"Switched from daily runs to open schedule.";
 
  129        include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
 
  132        foreach ($achievements as $user_id => $a) {
 
  133            $this->
sendMail($user_id, $a, $last_run);
 
  143        $log->debug(
"save run");
 
  146        $setting->set(get_class($this), date(
"Y-m-d H:i:s"));
 
  151        if ($status_details) {
 
  152            $result->setMessage($status_details);
 
  155        $log->debug(
"===Skill Notifications=== done");
 
  168    protected function sendMail($a_user_id, array $a_achievements, $a_last_run)
 
  175        include_once 
"./Services/Notification/classes/class.ilSystemNotification.php";
 
  177        $ntf->setLangModules(array(
"skll"));
 
  180        $lng = $ntf->getUserLanguage($a_user_id);
 
  182        include_once 
'./Services/Locator/classes/class.ilLocatorGUI.php';
 
  183        require_once 
"./Services/UICore/classes/class.ilTemplate.php";
 
  184        require_once 
"./Services/Link/classes/class.ilLink.php";
 
  192        include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
 
  194        $a_achievements = $vtree->getOrderedNodeset($a_achievements, 
"skill_id", 
"tref_id");
 
  196        foreach ($a_achievements as $skill_level) {
 
  201            foreach (
$tree->getPathId($skill_level[
"trigger_ref_id"]) as $node) {
 
  206            $ref_id = $skill_level[
"trigger_ref_id"];
 
  207            $obj_id = $skill_level[
"trigger_obj_id"];
 
  208            $type = $skill_level[
"trigger_obj_type"];
 
  209            $title = $skill_level[
"trigger_title"];
 
  211            if ($skill_level[
"trigger_obj_id"] != $last_obj_id) {
 
  212                $last_obj_id = $skill_level[
"trigger_obj_id"];
 
  214                if (
$tree->isInTree($ref_id)) {
 
  224        $ntf->setIntroductionLangId(
"skll_intro_skill_notification_for");
 
  228            $lng->txt(
"skll_new_skill_achievements"),
 
  234        $ntf->addAdditionalInfo(
 
  241        $client = $ilClientIniFile->readVariable(
'client', 
'name');
 
  242        $subject = sprintf(
$lng->txt(
"skll_competence_achievements"), 
$client);
 
  247        $mail = 
new ilMail(ANONYMOUS_USER_ID);
 
  248        $mail->enableSOAP(
false); 
 
  254            $ntf->composeAndGetMessage($a_user_id, 
null, 
"read", 
true),
 
An exception for terminatinating execution or to throw for unit testing.
static lookupLevelTitle($a_id)
Lookup level title.
static getNewAchievementsPerUser($a_timestamp, $a_timestamp_to=null, $a_user_id=0, $a_self_eval=0)
Get new achievements.
Cron job result data container.
Cron job application base class.
const SCHEDULE_TYPE_DAILY
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
static useRelativeDates()
check if relative dates are used
@classDescription Date and time handling
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static getLogger($a_component_id)
Get component logger.
static _lookupLogin($a_user_id)
lookup login
Course/group skill notification.
hasFlexibleSchedule()
Can the schedule be configured?
sendMail($a_user_id, array $a_achievements, $a_last_run)
Send news mail for 1 user and n objects.
__construct()
Constructor.
getDefaultScheduleValue()
Get schedule value.
getDefaultScheduleType()
Get schedule type.
hasAutoActivation()
Is to be activated on "installation".
getDescription()
Get description.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
Wrapper classes for system notifications.
if($_SERVER['argc']< 4) $client