/** * Job 1 */ function oqc_sendReminders() { $GLOBALS['log']->error('----->Scheduler fired job of type oqc_sendReminders<-----'); //global $dictionary; //global $app_strings; require_once 'modules/oqc_Task/oqc_Task.php'; $task = new oqc_Task(); $overdueTasks = $task->getOverdueTasks(); foreach ($overdueTasks as $dueTaskId) { $dueTask = new oqc_Task(); $lazyUsers = array(); if ($dueTask->retrieve($dueTaskId)) { $lazyUsers = $dueTask->getLazyUsers(); if (!empty($lazyUsers)) { $dueTask->sendNotifications($lazyUsers, 'overdue'); } else { $dueTask->sendNotifications(array($dueTask->assigned_user_id), 'overdue'); } } } return true; }