18 require_once SQ_CORE_PACKAGE_PATH.
'/system/cron/cron_job/cron_job_edit_fns.inc';
42 parent::__construct();
60 if (!is_null($asset)) {
61 echo $asset->readableWhen();
64 if (is_null($asset) || $asset->writeAccess(
'attributes')) {
65 $cron_mgr = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'cron_manager');
69 $edit_fns = $cron_job->getEditFns();
71 echo
'<br />'.translate(
'cron_job_send_submission_log_at').
' ';
72 $edit_fns->_paintWhenBox($cron_job, $o, $prefix, is_null($asset) ?
'' : $asset->attr(
'first_run'));
76 $cron_job_repeat->setAttrValue(
'type',
'repeating');
77 echo
'<br />'.translate(
'cron_job_regenerate_report_repeat');
78 $this->
_paintWhenBox($cron_job_repeat, $o, $prefix, is_null($asset) ?
'' : $asset->attr(
'when'));
80 require_once SQ_FUDGE_PATH.
'/general/datetime.inc';
82 echo translate(
'cron_manager_next_run', $cron_mgr->readableRefreshTime(), readable_datetime($cron_mgr->timeOfNextRun()));
103 $edit_fns = $cron_job->getEditFns();
105 $when_oo = $edit_fns->_processWhenBox($cron_job, $o, $prefix);
108 trigger_localised_error(
'CMS0122', E_USER_WARNING);
112 if ($_REQUEST[$prefix.
'_when_interval_mins'] ==
'--'
113 && $_REQUEST[$prefix.
'_when_interval_hours'] ==
'--'
114 && $_REQUEST[$prefix.
'_when_interval_days'] ==
'-') {
116 trigger_localised_error(
'CMS0119', E_USER_WARNING);
122 trigger_localised_error(
'CRON0050', E_USER_WARNING, $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($asset->type(),
'name'));
128 if (!@$cron_job->setAttrValue(
'when', $when_oo)) {
129 $cron_mgr = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'cron_manager');
130 trigger_localised_error(
'CRON0048', E_USER_WARNING, $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($asset->type(),
'name'), easy_datetime($cron_mgr->timeOfNextRun()));
133 $when_oo_str = $cron_job->attr(
'when');
136 $asset->setAttrValue(
'first_run', $when_oo_str);
139 $start_time = $cron_job->getNextRun($when_oo_str);
145 $cron_job_repeat->setAttrValue(
'type',
'repeating');
147 $when_ti_arr = explode(
',', $when_ti);
148 $when_ti_arr[0] =
'TI='.$start_time;
149 $when_ti_str = implode(
',', $when_ti_arr);
150 $asset->setAttrValue(
'when', $when_ti_str);