ILIAS  release_7 Revision v7.30-3-g800a261c036
ilPrgUpdateProgressCronJob Class Reference

This will set progresses to FAILED, if they are past the deadline (and not successful, yet) More...

+ Inheritance diagram for ilPrgUpdateProgressCronJob:
+ Collaboration diagram for ilPrgUpdateProgressCronJob:

Public Member Functions

 __construct ()
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 getId ()
 Get id. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 run ()
 Run job. More...
 
- Public Member Functions inherited from ilCronJob
 isActive ($a_ts_last_run, $a_schedule_type, $a_schedule_value, $a_manual=false)
 Is job currently active? More...
 
 getScheduleType ()
 Get current schedule type (if flexible) More...
 
 getScheduleValue ()
 Get current schedule value (if flexible) More...
 
 setSchedule ($a_type, $a_value)
 Update current schedule (if flexible) More...
 
 getAllScheduleTypes ()
 Get all available schedule types. More...
 
 getScheduleTypesWithValues ()
 
 getValidScheduleTypes ()
 Returns a collection of all valid schedule types for a specific job. More...
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 isManuallyExecutable ()
 Defines whether or not a cron job can be started manually. More...
 
 hasCustomSettings ()
 Has cron job any custom setting which can be edited? More...
 
 addCustomSettingsToForm (ilPropertyFormGUI $a_form)
 Add custom settings to form. More...
 
 saveCustomSettings (ilPropertyFormGUI $a_form)
 Save custom settings. More...
 
 addToExternalSettingsForm ($a_form_id, array &$a_fields, $a_is_active)
 Add external settings to form. More...
 
 activationWasToggled ($a_currently_active)
 Cron job status was changed. More...
 
 getId ()
 Get id. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 run ()
 Run job. More...
 

Data Fields

const ID = 'prg_update_progress'
 
- Data Fields inherited from ilCronJob
const SCHEDULE_TYPE_DAILY = 1
 
const SCHEDULE_TYPE_IN_MINUTES = 2
 
const SCHEDULE_TYPE_IN_HOURS = 3
 
const SCHEDULE_TYPE_IN_DAYS = 4
 
const SCHEDULE_TYPE_WEEKLY = 5
 
const SCHEDULE_TYPE_MONTHLY = 6
 
const SCHEDULE_TYPE_QUARTERLY = 7
 
const SCHEDULE_TYPE_YEARLY = 8
 

Protected Member Functions

 getProgressRepository ()
 
 getActingUserId ()
 
- Protected Member Functions inherited from ilCronJob
 checkSchedule ($a_ts_last_run, $a_schedule_type, $a_schedule_value)
 

Protected Attributes

 $dic
 
 $lng
 

Detailed Description

This will set progresses to FAILED, if they are past the deadline (and not successful, yet)

Definition at line 11 of file class.ilPrgUpdateProgressCronJob.php.

Constructor & Destructor Documentation

◆ __construct()

ilPrgUpdateProgressCronJob::__construct ( )

Definition at line 25 of file class.ilPrgUpdateProgressCronJob.php.

26 {
27 global $DIC;
28
29 $this->lng = $DIC['lng'];
30 $this->lng->loadLanguageModule('prg');
31 $this->dic = ilStudyProgrammeDIC::dic();
32 }
global $DIC
Definition: goto.php:24

References $DIC, and ilStudyProgrammeDIC\dic().

+ Here is the call graph for this function:

Member Function Documentation

◆ getActingUserId()

ilPrgUpdateProgressCronJob::getActingUserId ( )
protected

Definition at line 88 of file class.ilPrgUpdateProgressCronJob.php.

88 : int
89 {
90 return $this->dic['current_user']->getId();
91 }

Referenced by run().

+ Here is the caller graph for this function:

◆ getDefaultScheduleType()

ilPrgUpdateProgressCronJob::getDefaultScheduleType ( )

Get schedule type.

Returns
int

Reimplemented from ilCronJob.

Definition at line 59 of file class.ilPrgUpdateProgressCronJob.php.

60 {
62 }
const SCHEDULE_TYPE_IN_DAYS

References ilCronJob\SCHEDULE_TYPE_IN_DAYS.

◆ getDefaultScheduleValue()

ilPrgUpdateProgressCronJob::getDefaultScheduleValue ( )

Get schedule value.

Returns
int|array

Reimplemented from ilCronJob.

Definition at line 64 of file class.ilPrgUpdateProgressCronJob.php.

65 {
66 return 1;
67 }

◆ getDescription()

ilPrgUpdateProgressCronJob::getDescription ( )

Get description.

Returns
string

Reimplemented from ilCronJob.

Definition at line 39 of file class.ilPrgUpdateProgressCronJob.php.

40 {
41 return $this->lng->txt('prg_update_progress_description');
42 }

◆ getId()

ilPrgUpdateProgressCronJob::getId ( )

Get id.

Returns
string

Reimplemented from ilCronJob.

Definition at line 44 of file class.ilPrgUpdateProgressCronJob.php.

References ID.

◆ getProgressRepository()

ilPrgUpdateProgressCronJob::getProgressRepository ( )
protected

Definition at line 84 of file class.ilPrgUpdateProgressCronJob.php.

85 {
86 return $this->dic['ilStudyProgrammeUserProgressDB'];
87 }

Referenced by run().

+ Here is the caller graph for this function:

◆ getTitle()

ilPrgUpdateProgressCronJob::getTitle ( )

Get title.

Returns
string

Reimplemented from ilCronJob.

Definition at line 34 of file class.ilPrgUpdateProgressCronJob.php.

35 {
36 return $this->lng->txt('prg_update_progress_title');
37 }

◆ hasAutoActivation()

ilPrgUpdateProgressCronJob::hasAutoActivation ( )

Is to be activated on "installation".

Returns
boolean

Reimplemented from ilCronJob.

Definition at line 49 of file class.ilPrgUpdateProgressCronJob.php.

50 {
51 return true;
52 }

◆ hasFlexibleSchedule()

ilPrgUpdateProgressCronJob::hasFlexibleSchedule ( )

Can the schedule be configured?

Returns
boolean

Reimplemented from ilCronJob.

Definition at line 54 of file class.ilPrgUpdateProgressCronJob.php.

55 {
56 return true;
57 }

◆ run()

ilPrgUpdateProgressCronJob::run ( )

Run job.

Returns
ilCronJobResult

Reimplemented from ilCronJob.

Definition at line 69 of file class.ilPrgUpdateProgressCronJob.php.

70 {
73 $acting_user = $this->getActingUserId();
74 foreach ($this->getProgressRepository()->getPassedDeadline() as $progress) {
75 if ($progress->getStatus() === ilStudyProgrammeProgress::STATUS_IN_PROGRESS) {
76 $programme = ilObjStudyProgramme::getInstanceByObjId($progress->getNodeId());
77 $programme->markFailed($progress->getId(), $acting_user);
79 }
80 }
81 return $result;
82 }
$result
Cron job result data container.

References $result, getActingUserId(), ilObjStudyProgramme\getInstanceByObjId(), getProgressRepository(), ilStudyProgrammeProgress\STATUS_IN_PROGRESS, ilCronJobResult\STATUS_NO_ACTION, and ilCronJobResult\STATUS_OK.

+ Here is the call graph for this function:

Field Documentation

◆ $dic

ilPrgUpdateProgressCronJob::$dic
protected

Definition at line 18 of file class.ilPrgUpdateProgressCronJob.php.

◆ $lng

ilPrgUpdateProgressCronJob::$lng
protected

Definition at line 23 of file class.ilPrgUpdateProgressCronJob.php.

◆ ID

const ilPrgUpdateProgressCronJob::ID = 'prg_update_progress'

Definition at line 13 of file class.ilPrgUpdateProgressCronJob.php.

Referenced by getId().


The documentation for this class was generated from the following file: