5include_once 
"Services/Cron/classes/class.ilCronManager.php";
 
   22                $lng->loadLanguageModule(
"cron");
 
   40                        $tstamp = 
$lng->txt(
'cronjob_last_start_unknown');
 
   44                include_once 
"Services/Cron/classes/class.ilCronManagerTableGUI.php";
 
   56                        $ilCtrl->redirect($this, 
"render");
 
   64                $tpl->setContent($a_form->getHTML());
 
   74                        $ilCtrl->redirect($this, 
"render");
 
   77                $ilCtrl->setParameter($this, 
"jid", $a_job_id);
 
   81                include_once(
"Services/Cron/classes/class.ilCronJob.php");
 
   82                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
   84                $form->setFormAction(
$ilCtrl->getFormAction($this, 
"update"));
 
   85                $form->setTitle(
$lng->txt(
"cron_action_edit").
': "'.$job->getTitle().
'"');              
 
   87                if($job->hasFlexibleSchedule())
 
   90                        $type->setRequired(
true);
 
   91                        $type->setValue(
$data[
"schedule_type"]);
 
  101                        $mini->setRequired(
true);
 
  105                                $mini->setValue(
$data[
"schedule_value"]);
 
  107                        $min->addSubItem($mini);
 
  108                        $type->addOption($min);
 
  113                        $hri->setRequired(
true);
 
  117                                $hri->setValue(
$data[
"schedule_value"]);
 
  119                        $hr->addSubItem($hri);
 
  120                        $type->addOption($hr);
 
  125                        $dyi->setRequired(
true);
 
  129                                $dyi->setValue(
$data[
"schedule_value"]);
 
  131                        $dy->addSubItem($dyi);          
 
  132                        $type->addOption($dy);
 
  134                        $form->addItem($type);
 
  137                if($job->hasCustomSettings())
 
  139                        $job->addCustomSettingsToForm($form);           
 
  142                $form->addCommandButton(
"update", 
$lng->txt(
"save"));
 
  143                $form->addCommandButton(
"render", 
$lng->txt(
"cancel"));
 
  155                        $ilCtrl->redirect($this, 
"render");
 
  159                if($form->checkInput())
 
  165                                if($job->hasCustomSettings() &&
 
  166                                        !$job->saveCustomSettings($form))
 
  171                                if(
$valid && $job->hasFlexibleSchedule())
 
  173                                        $type = $form->getInput(
"type");
 
  177                                                        $value = $form->getInput(
"smini");
 
  181                                                        $value = $form->getInput(
"shri");
 
  185                                                        $value = $form->getInput(
"sdyi");
 
  197                                        $ilCtrl->redirect($this, 
"render");
 
  202                $form->setValuesByPost();
 
  208                $this->confirm(
"run");
 
  215                $job_id = 
$_GET[
"jid"];
 
  228                $ilCtrl->redirect($this, 
"render");
 
  233                $this->confirm(
"activate");
 
  243                        foreach($jobs as $job)
 
  255                $ilCtrl->redirect($this, 
"render");
 
  260                $this->confirm(
"deactivate");
 
  270                        foreach($jobs as $job)
 
  281                $ilCtrl->redirect($this, 
"render");
 
  286                $this->confirm(
"reset");
 
  293                $job_id = 
$_GET[
"jid"];
 
  305                $ilCtrl->redirect($this, 
"render");
 
  318                                $res[$job_id] = $job;
 
  328                                        $res[$job_id] = $job;
 
  336        protected function confirm($a_action)
 
  343                        $ilCtrl->redirect($this, 
"render");
 
  346                if(
'run' == $a_action)
 
  349                        $jobs = array_filter($jobs, 
function ($job) {
 
  353                                return $job->isManuallyExecutable();
 
  356                        if(0 == count($jobs))
 
  359                                $ilCtrl->redirect($this, 
'render');
 
  363                include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  366                if(
sizeof($jobs) == 1)
 
  368                        $job_id = array_pop(array_keys($jobs));
 
  369                        $job = array_pop($jobs);                                
 
  370                        $title = $job->getTitle();
 
  373                                $title = preg_replace(
"[^A-Za-z0-9_\-]", 
"", $job->getId());
 
  376                        $cgui->setHeaderText(sprintf(
$lng->txt(
"cron_action_".$a_action.
"_sure"), 
 
  379                        $ilCtrl->setParameter($this, 
"jid", $job_id);
 
  383                        $cgui->setHeaderText(
$lng->txt(
"cron_action_".$a_action.
"_sure_multi"));
 
  385                        foreach($jobs as $job_id => $job)
 
  387                                $cgui->addItem(
"mjid[]", $job_id, $job->getTitle());
 
  391                $cgui->setFormAction(
$ilCtrl->getFormAction($this, 
"confirmed".ucfirst($a_action)));
 
  392                $cgui->setCancel(
$lng->txt(
"cancel"), 
"render");
 
  393                $cgui->setConfirm(
$lng->txt(
"cron_action_".$a_action), 
"confirmed".ucfirst($a_action));
 
  395                $tpl->setContent($cgui->getHTML());             
 
  403                foreach(
$data as $item)
 
  406                                $item[
"component"], $item[
"class"], $item[
"path"]);
 
  408                        if(method_exists($job, 
"addToExternalSettingsForm"))
 
  410                                $job->addToExternalSettingsForm($a_form_id, $fields, $item[
"job_status"]);                                                                                                      
 
  416                        return array(
"cron_jobs"=>array(
"jumpToCronJobs", $fields));
 
Confirmation screen class.
const SCHEDULE_TYPE_IN_DAYS
const SCHEDULE_TYPE_IN_HOURS
const SCHEDULE_TYPE_IN_MINUTES
const SCHEDULE_TYPE_WEEKLY
const SCHEDULE_TYPE_YEARLY
const SCHEDULE_TYPE_DAILY
const SCHEDULE_TYPE_QUARTERLY
const SCHEDULE_TYPE_MONTHLY
addToExternalSettingsForm($a_form_id)
edit(ilPropertyFormGUI $a_form=null)
List all active cron jobs.
static getCronJobData($a_id=null, $a_include_inactive=true)
Get cron job configuration/execution data.
static isJobInactive($a_job_id)
Check if given job is currently inactive.
static getJobInstanceById($a_job_id)
Get job instance (by job id)
static runJobManual($a_job_id)
Run single job manually.
static activateJob(ilCronJob $a_job, $a_manual=false)
Activate cron job.
static getJobInstance($a_id, $a_component, $a_class, $a_path=null)
Get job instance (by job data)
static isJobActive($a_job_id)
Check if given job is currently active.
static deactivateJob(ilCronJob $a_job, $a_manual=false)
Deactivate cron job.
static resetJob(ilCronJob $a_job)
Reset job.
static updateJobSchedule(ilCronJob $a_job, $a_schedule_type, $a_schedule_value)
Update job schedule.
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
This class represents an option in a radio group.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']