111 'Manual Run is Always Due' => [
114 JobScheduleType::DAILY,
116 JobScheduleType::DAILY,
121 JobScheduleType::DAILY,
125 'Job Without Any Run is Always Due' => [
128 JobScheduleType::DAILY,
130 JobScheduleType::DAILY,
135 JobScheduleType::DAILY,
139 'Daily Schedule / Did not run Today' => [
142 JobScheduleType::DAILY,
144 JobScheduleType::DAILY,
151 return self::$now->modify(
'-1 day');
153 JobScheduleType::DAILY,
157 'Daily Schedule / Did run Today' => [
160 JobScheduleType::DAILY,
162 JobScheduleType::DAILY,
171 JobScheduleType::DAILY,
175 'Weekly Schedule / Did not run this Week' => [
178 JobScheduleType::WEEKLY,
180 JobScheduleType::WEEKLY,
187 return self::$now->modify(
'-1 week');
189 JobScheduleType::WEEKLY,
193 'Weekly Schedule / Did run this Week' => [
196 JobScheduleType::WEEKLY,
198 JobScheduleType::WEEKLY,
205 return self::$now->modify(
'monday this week');
207 JobScheduleType::WEEKLY,
211 'Monthly Schedule / Did not run this Month' => [
214 JobScheduleType::MONTHLY,
216 JobScheduleType::MONTHLY,
223 return self::$now->modify(
'last day of last month');
225 JobScheduleType::MONTHLY,
229 'Monthly Schedule / Did run this Month' => [
232 JobScheduleType::MONTHLY,
234 JobScheduleType::MONTHLY,
241 return self::$now->modify(
'first day of this month');
243 JobScheduleType::MONTHLY,
247 'Yearly Schedule / Did not run this Year' => [
259 return self::$now->modify(
'-1 year');
265 'Yearly Schedule / Did run this Year' => [
277 return self::$now->modify(
'first day of January this year');
283 'Quarterly Schedule / Did not run this Quarter' => [
286 JobScheduleType::QUARTERLY,
288 JobScheduleType::QUARTERLY,
295 $offset = (((
int) self::$now->format(
'n')) - 1) % 3;
296 self::$this_quarter_start = self::$now->modify(
"first day of -$offset month midnight");
298 return self::$this_quarter_start->modify(
'-1 seconds');
300 JobScheduleType::QUARTERLY,
304 'Quarterly Schedule / Did run this Quarter' => [
307 JobScheduleType::QUARTERLY,
309 JobScheduleType::QUARTERLY,
316 $offset = (((
int) self::$now->format(
'n')) - 1) % 3;
317 self::$this_quarter_start = self::$now->modify(
"first day of -$offset month midnight");
319 return self::$this_quarter_start->modify(
'+30 seconds');
321 JobScheduleType::QUARTERLY,
325 'Minutely Schedule / Did not run this Minute' => [
328 JobScheduleType::IN_MINUTES,
330 JobScheduleType::IN_MINUTES,
337 return self::$now->modify(
'-1 minute');
339 JobScheduleType::IN_MINUTES,
343 'Minutely Schedule / Did run this Minute' => [
346 JobScheduleType::IN_MINUTES,
348 JobScheduleType::IN_MINUTES,
355 return self::$now->modify(
'-30 seconds');
357 JobScheduleType::IN_MINUTES,
361 'Hourly Schedule / Did not run this Hour' => [
364 JobScheduleType::IN_HOURS,
366 JobScheduleType::IN_HOURS,
373 return self::$now->modify(
'-7 hours');
375 JobScheduleType::IN_HOURS,
379 'Hourly Schedule / Did run this Hour' => [
382 JobScheduleType::IN_HOURS,
384 JobScheduleType::IN_HOURS,
391 return self::$now->modify(
'-7 hours +30 seconds');
393 JobScheduleType::IN_HOURS,
397 'Every 5 Days Schedule / Did not run for 5 Days' => [
400 JobScheduleType::IN_DAYS,
402 JobScheduleType::IN_DAYS,
409 return self::$now->modify(
'-5 days');
411 JobScheduleType::IN_DAYS,
415 'Every 5 Days Schedule / Did run withing the last 5 Days' => [
418 JobScheduleType::IN_DAYS,
420 JobScheduleType::IN_DAYS,
427 return self::$now->modify(
'-4 days');
429 JobScheduleType::IN_DAYS,
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null