18 require_once SQ_CORE_PACKAGE_PATH.
'/system/cron/cron_job/cron_job.inc';
43 parent::__construct($assetid);
60 return translate(
'squid_cron_name', $this->
attr(
'ownerid'));
74 $links = parent::_getAllowedLinks();
77 if (empty($links[SQ_LINK_NOTICE][
'asset'])) {
78 $links[SQ_LINK_NOTICE][
'asset'] = Array(
'card' => 1);
97 if (parent::canDelete())
return TRUE;
100 if ($this->
attr(
'read_only'))
return FALSE;
103 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($this->
attr(
'ownerid'));
104 if (!is_null($asset))
return $asset->adminAccess(
'');
124 $assetid = $this->
attr(
'ownerid');
126 'assetid' => $assetid,
127 'cascade' => $this->
attr(
'cascade'),
128 'repopulate' => $this->
attr(
'repopulate'),
131 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
132 $status_errors = $hh->freestyleHipo(
'hipo_job_tool_clear_squid_cache', $vars, SQ_PACKAGES_PATH.
'/squid/hipo_jobs');
134 if (empty($status_errors)) {
135 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid);
136 $msg = translate(
'squid_cron_done_msg', $asset->name, $assetid);
137 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($asset);
139 if ($this->
attr(
'type') ==
'one_off') {
141 return SQ_CRON_JOB_COMPLETED | SQ_CRON_JOB_REMOVE;
142 }
else if ($this->
attr(
'type') ==
'repeating') {
144 return SQ_CRON_JOB_COMPLETED;
148 trigger_localised_error(
'SQUID0002', E_USER_WARNING);
152 return SQ_CRON_JOB_ERROR | SQ_CRON_JOB_REMOVE;
166 $cm = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'cron_manager');
167 return $cm->getJobs(
'cron_job_squid_cache_purge');