function uninstall(){ Loader::model("job"); $jobObj=Job::getByID( intval($_REQUEST['jID']) ); if( $jobObj && !$jobObj->jNotUninstallable ){ $jobObj->uninstall(); } $this->redirect('/dashboard/system/jobs'); }
function uninstall($job_id = null) { if ($job_id) { Loader::model("job"); $job = Job::getByID((int) $job_id); if ($job) { if (!$job->jNotUninstallable) { $job->uninstall(); $this->set('message', t('Job succesfully uninstalled.')); } else { $this->error->add(t('This job cannot be uninstalled.')); } } else { $this->error->add(t('Job not found.')); } } else { $this->error->add(t('No job specified.')); } $this->view(); }
public static function exportList($xml) { $jl = self::getList(); if ($jl->numRows() > 0) { $jx = $xml->addChild('jobs'); while ($r = $jl->FetchRow()) { $j = Job::getByID($r['jID']); $ch = $jx->addChild('job'); $ch->addAttribute('handle', $j->getJobHandle()); $ch->addAttribute('package', $j->getPackageHandle()); } } }
public function update_job_schedule() { $jID = $this->post('jID'); $J = Job::getByID($jID); $J->setSchedule($this->post('isScheduled'), $this->post('unit'), max(0, (int) $this->post('value'))); $this->redirect('/dashboard/system/optimization/jobs', 'job_scheduled'); }
<?php defined('C5_EXECUTE') or die("Access Denied."); if (!ini_get('safe_mode')) { @set_time_limit(0); } $json = Loader::helper('json'); if (Job::authenticateRequest($_REQUEST['auth'])) { if (strlen($_REQUEST['jHandle']) > 0 || intval($_REQUEST['jID']) > 0) { if ($_REQUEST['jHandle']) { $job = Job::getByHandle($_REQUEST['jHandle']); } else { $job = Job::getByID(intval($_REQUEST['jID'])); } } } if (is_object($job)) { if ($job->supportsQueue()) { $q = $job->getQueueObject(); if ($_POST['process']) { $obj = new stdClass(); $js = Loader::helper('json'); try { $messages = $q->receive($job->getJobQueueBatchSize()); foreach ($messages as $key => $p) { $job->processQueueItem($p); $q->deleteMessage($p); } $totalItems = $q->count(); $obj->totalItems = $totalItems; if ($q->count() == 0) {
public static function getList($scheduledOnly = false){ $db = Loader::db(); if($scheduledOnly) { $q = "SELECT jID FROM Jobs WHERE isScheduled = 1 ORDER BY jDateLastRun"; } else { $q = "SELECT jID FROM Jobs ORDER BY jDateLastRun"; } $r = $db->Execute($q); $jobs = array(); while ($row = $r->FetchRow()) { $j = Job::getByID($row['jID']); if (is_object($j)) { $jobs[] = $j; } } return $jobs; }
public function getJobs() { $db = Loader::db(); $r = $db->Execute('select jID from JobSetJobs where jsID = ? order by jID asc', $this->getJobSetId()); $jobs = array(); while ($row = $r->FetchRow()) { $j = Job::getByID($row['jID']); if (is_object($j)) { $jobs[] = $j; } } return $jobs; }
<?php defined('C5_EXECUTE') or die("Access Denied."); if (!ini_get('safe_mode')) { @set_time_limit(0); } $json = Loader::helper('json'); $r = new stdClass(); $r->results = array(); if (Job::authenticateRequest($_REQUEST['auth'])) { // Legacy if ($_REQUEST['jID']) { $j = Job::getByID($_REQUEST['jID']); $obj = $j->executeJob(); print $json->encode($obj); exit; } if ($_REQUEST['jHandle']) { $j = Job::getByHandle($_REQUEST['jHandle']); $obj = $j->executeJob(); print $json->encode($obj); exit; } if ($_REQUEST['jsID']) { $js = JobSet::getByID($_REQUEST['jsID']); } else { // default set legacy support $js = JobSet::getDefault(); } if (is_object($js)) { $jobs = $js->getJobs();