5include_once 
"Services/Cron/classes/class.ilCronManager.php";
 
   22        $lng->loadLanguageModule(
"cron");
 
   24        $cmd = 
$ilCtrl->getCmd(
"render");
 
   34        if (
$ilSetting->get(
'last_cronjob_start_ts')) {
 
   37            $tstamp = 
$lng->txt(
'cronjob_last_start_unknown');
 
   41        include_once 
"Services/Cron/classes/class.ilCronManagerTableGUI.php";
 
   50        $id = $_REQUEST[
"jid"];
 
   52            $ilCtrl->redirect($this, 
"render");
 
   59        $tpl->setContent($a_form->getHTML());
 
   68            $ilCtrl->redirect($this, 
"render");
 
   71        $ilCtrl->setParameter($this, 
"jid", $a_job_id);
 
   75        include_once(
"Services/Cron/classes/class.ilCronJob.php");
 
   76        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
   78        $form->setFormAction(
$ilCtrl->getFormAction($this, 
"update"));
 
   79        $form->setTitle(
$lng->txt(
"cron_action_edit") . 
': "' . $job->getTitle() . 
'"');
 
   81        if ($job->hasFlexibleSchedule()) {
 
   83            $type->setRequired(
true);
 
   92                sprintf(
$lng->txt(
"cron_schedule_in_minutes"), 
"x"),
 
   96            $mini->setRequired(
true);
 
   99                $mini->setValue(
$data[
"schedule_value"]);
 
  101            $min->addSubItem($mini);
 
  102            $type->addOption($min);
 
  109            $hri->setRequired(
true);
 
  112                $hri->setValue(
$data[
"schedule_value"]);
 
  114            $hr->addSubItem($hri);
 
  115            $type->addOption($hr);
 
  122            $dyi->setRequired(
true);
 
  125                $dyi->setValue(
$data[
"schedule_value"]);
 
  127            $dy->addSubItem($dyi);
 
  128            $type->addOption($dy);
 
  133        if ($job->hasCustomSettings()) {
 
  134            $job->addCustomSettingsToForm(
$form);
 
  137        $form->addCommandButton(
"update", 
$lng->txt(
"save"));
 
  138        $form->addCommandButton(
"render", 
$lng->txt(
"cancel"));
 
  147        $id = $_REQUEST[
"jid"];
 
  149            $ilCtrl->redirect($this, 
"render");
 
  153        if (
$form->checkInput()) {
 
  157                if ($job->hasCustomSettings() &&
 
  158                    !$job->saveCustomSettings(
$form)) {
 
  162                if (
$valid && $job->hasFlexibleSchedule()) {
 
  166                            $value = 
$form->getInput(
"smini");
 
  170                            $value = 
$form->getInput(
"shri");
 
  174                            $value = 
$form->getInput(
"sdyi");
 
  185                    $ilCtrl->redirect($this, 
"render");
 
  190        $form->setValuesByPost();
 
  196        $this->confirm(
"run");
 
  203        $job_id = 
$_GET[
"jid"];
 
  212        $ilCtrl->redirect($this, 
"render");
 
  217        $this->confirm(
"activate");
 
  226            foreach ($jobs as $job) {
 
  236        $ilCtrl->redirect($this, 
"render");
 
  241        $this->confirm(
"deactivate");
 
  250            foreach ($jobs as $job) {
 
  259        $ilCtrl->redirect($this, 
"render");
 
  264        $this->confirm(
"reset");
 
  273            foreach ($jobs as $job) {
 
  281        $ilCtrl->redirect($this, 
"render");
 
  288        if ($_REQUEST[
"jid"]) {
 
  289            $job_id = trim($_REQUEST[
"jid"]);
 
  292                $res[$job_id] = $job;
 
  294        } elseif (is_array($_REQUEST[
"mjid"])) {
 
  295            foreach ($_REQUEST[
"mjid"] as $job_id) {
 
  298                    $res[$job_id] = $job;
 
  306    protected function confirm($a_action)
 
  312            $ilCtrl->redirect($this, 
"render");
 
  315        if (
'run' == $a_action) {
 
  317            $jobs = array_filter($jobs, 
function ($job) {
 
  321                return $job->isManuallyExecutable();
 
  324            if (0 == count($jobs)) {
 
  326                $ilCtrl->redirect($this, 
'render');
 
  330        include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  333        if (
sizeof($jobs) == 1) {
 
  334            $job_id = array_pop(array_keys($jobs));
 
  335            $job = array_pop($jobs);
 
  336            $title = $job->getTitle();
 
  338                $title = preg_replace(
"[^A-Za-z0-9_\-]", 
"", $job->getId());
 
  342                $lng->txt(
"cron_action_" . $a_action . 
"_sure"),
 
  346            $ilCtrl->setParameter($this, 
"jid", $job_id);
 
  348            $cgui->setHeaderText(
$lng->txt(
"cron_action_" . $a_action . 
"_sure_multi"));
 
  350            foreach ($jobs as $job_id => $job) {
 
  351                $cgui->addItem(
"mjid[]", $job_id, $job->getTitle());
 
  355        $cgui->setFormAction(
$ilCtrl->getFormAction($this, 
"confirmed" . ucfirst($a_action)));
 
  356        $cgui->setCancel(
$lng->txt(
"cancel"), 
"render");
 
  357        $cgui->setConfirm(
$lng->txt(
"cron_action_" . $a_action), 
"confirmed" . ucfirst($a_action));
 
  359        $tpl->setContent($cgui->getHTML());
 
  367        foreach (
$data as $item) {
 
  375            if (method_exists($job, 
"addToExternalSettingsForm")) {
 
  376                $job->addToExternalSettingsForm($a_form_id, $fields, $item[
"job_status"]);
 
  380        if (
sizeof($fields)) {
 
  381            return array(
"cron_jobs"=>array(
"jumpToCronJobs", $fields));
 
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
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, $a_skip_day=false, $a_include_wd=false)
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(!array_key_exists('StateId', $_REQUEST)) $id
if(isset($_POST['submit'])) $form
foreach($_POST as $key=> $value) $res