function updateTaskList($ID, $name, $activeflag) { $conn = getConnection(); $Obj = getTaskList($ID); $Obj->setName($name); $Obj->setActiveFlag($activeflag); $result = $Obj->update(); if ($result) { $message = "Task Updated Successfully "; } else { $message = "Task Updation Failed : "; } return $message; }
// Get the list of tasks due to be run from the database function getTaskList() { $now = date('Y-m-d H:i:s'); //time(); $query = "SELECT * FROM scheduler_tasks WHERE is_complete = 0 AND run_time < '{$now}' AND status != 'disabled'"; $result = DBUtil::getResultArray($query); if (PEAR::isError($result)) { return false; } return $result; } /* ** Scheduler script ** */ $default->log->debug('Scheduler: starting'); // Get task list $aList = getTaskList(); if (empty($aList)) { $default->log->debug('Scheduler: stopping - nothing to do'); return; } // Loop through tasks and run foreach ($aList as $item) { $aUpdate = array(); $iEnd = 0; $iStart = 0; $iDuration = 0; $sFreq = ''; $sParameters = ''; $retval = TRUE; // Set up start variables $sTask = $item['task'];
function getBestDisplay() { $temp = $this->name; if ($this->type == 1) { $temp .= ' >> ' . getTaskList(getStructureTask($this->structure_taskID)->getListID())->getName(); } return $temp; }