ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPrgUserNotRestartedCronJob Class Reference
+ Inheritance diagram for ilPrgUserNotRestartedCronJob:
+ Collaboration diagram for ilPrgUserNotRestartedCronJob:

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_user_not_restarted'
 
- 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 Attributes

 $user_assignments_db
 
 $log
 
 $lng
 

Additional Inherited Members

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

Detailed Description

Definition at line 8 of file class.ilPrgUserNotRestartedCronJob.php.

Constructor & Destructor Documentation

◆ __construct()

ilPrgUserNotRestartedCronJob::__construct ( )

Definition at line 27 of file class.ilPrgUserNotRestartedCronJob.php.

References $DIC, and ilStudyProgrammeDIC\dic().

28  {
29  global $DIC;
30 
31  $this->user_assignments_db = ilStudyProgrammeDIC::dic()['ilStudyProgrammeUserAssignmentDB'];
32  $this->log = $DIC['ilLog'];
33  $this->lng = $DIC['lng'];
34  }
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ getDefaultScheduleType()

ilPrgUserNotRestartedCronJob::getDefaultScheduleType ( )

Get schedule type.

Returns
int

Definition at line 91 of file class.ilPrgUserNotRestartedCronJob.php.

92  {
93  return self::SCHEDULE_TYPE_IN_DAYS;
94  }

◆ getDefaultScheduleValue()

ilPrgUserNotRestartedCronJob::getDefaultScheduleValue ( )

Get schedule value.

Returns
int|array

Definition at line 101 of file class.ilPrgUserNotRestartedCronJob.php.

102  {
103  return 1;
104  }

◆ getDescription()

ilPrgUserNotRestartedCronJob::getDescription ( )

Get description.

Returns
string

Definition at line 51 of file class.ilPrgUserNotRestartedCronJob.php.

52  {
53  return $this->lng->txt('prg_user_not_restarted_desc');
54  }

◆ getId()

ilPrgUserNotRestartedCronJob::getId ( )

Get id.

Returns
string

Definition at line 61 of file class.ilPrgUserNotRestartedCronJob.php.

62  {
63  return self::ID;
64  }

◆ getTitle()

ilPrgUserNotRestartedCronJob::getTitle ( )

Get title.

Returns
string

Definition at line 41 of file class.ilPrgUserNotRestartedCronJob.php.

42  {
43  return $this->lng->txt('prg_user_not_restarted_title');
44  }

◆ hasAutoActivation()

ilPrgUserNotRestartedCronJob::hasAutoActivation ( )

Is to be activated on "installation".

Returns
boolean

Definition at line 71 of file class.ilPrgUserNotRestartedCronJob.php.

72  {
73  return true;
74  }

◆ hasFlexibleSchedule()

ilPrgUserNotRestartedCronJob::hasFlexibleSchedule ( )

Can the schedule be configured?

Returns
boolean

Definition at line 81 of file class.ilPrgUserNotRestartedCronJob.php.

82  {
83  return true;
84  }

◆ run()

ilPrgUserNotRestartedCronJob::run ( )

Run job.

Returns
ilCronJobResult
Exceptions
Exception

Definition at line 112 of file class.ilPrgUserNotRestartedCronJob.php.

References Vendor\Package\$e, $result, and ilCronJobResult\STATUS_OK.

113  {
114  $result = new ilCronJobResult();
116  foreach ($this->user_assignments_db->getDueToRestartAndMail() as $assignment) {
117  try {
118  $prg = $assignment->getStudyProgramme();
119  $validity_of_qualification = $prg->getValidityOfQualificationSettings();
120  $auto_re_assign = $validity_of_qualification->getRestartPeriod();
121  if ($auto_re_assign == -1) {
122  continue;
123  }
124 
125  $auto_mail_settings = $prg->getAutoMailSettings();
126  $inform_by_days = $auto_mail_settings->getReminderNotRestartedByUserDays();
127  if (is_null($inform_by_days)) {
128  continue;
129  }
130  $restart_date = $assignment->getRestartDate();
131  $restart_date->sub(new DateInterval(('P' . $inform_by_days . 'D')));
132 
133  $assignment->informUserByMailToRestart();
134  } catch (ilException $e) {
135  $this->log->write('an error occured: ' . $e->getMessage());
136  }
137  }
138  return $result;
139  }
$result
Cron job result data container.

Field Documentation

◆ $lng

ilPrgUserNotRestartedCronJob::$lng
protected

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

◆ $log

ilPrgUserNotRestartedCronJob::$log
protected

Definition at line 20 of file class.ilPrgUserNotRestartedCronJob.php.

◆ $user_assignments_db

ilPrgUserNotRestartedCronJob::$user_assignments_db
protected

Definition at line 15 of file class.ilPrgUserNotRestartedCronJob.php.

◆ ID

const ilPrgUserNotRestartedCronJob::ID = 'prg_user_not_restarted'

Definition at line 10 of file class.ilPrgUserNotRestartedCronJob.php.


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