17 require_once SQ_SYSTEM_ROOT.
'/core/hipo/hipo_job.inc';
57 public static function paintConfig(&$o, $class, $write_access)
60 $o->openField(translate(
'report_regeneration_threshold'));
63 text_box($class.
'[SQ_HIPO_REGENERATE_REPORT_THRESHOLD]', SQ_HIPO_REGENERATE_REPORT_THRESHOLD, 5);
65 echo SQ_HIPO_REGENERATE_REPORT_THRESHOLD;
67 echo
' '.translate(
'assets');
83 'SQ_HIPO_REGENERATE_REPORT_THRESHOLD' => Array(
'editable' => 1,
'default' => 1),
99 if (SQ_HIPO_REGENERATE_REPORT_THRESHOLD == 0)
return 0;
100 if (!isset($this->_running_vars[
'todo']))
return 0;
101 if (!is_array($this->_running_vars[
'todo']))
return 0;
102 return (((count($this->_running_vars[
'todo']) + 1) / SQ_HIPO_REGENERATE_REPORT_THRESHOLD) * 100);
120 return parent::getCodeName().
'-'.$this->_running_vars[
'assetid'];
133 return translate(
'hipo_name_generate_report');
149 'name' => translate(
'hipo_generating_report'),
150 'function_call' => Array(
151 'process_function' =>
'processReport',
153 'running_mode' =>
'server',
155 'allow_cancel' => TRUE,
173 while (empty($this->_running_vars[
'complete']) && !empty($this->_running_vars[
'assetid'])) {
174 if (!$this->
processReport($this->_steps[0], get_class_lower($this))) {
191 if (empty($this->_running_vars[
'assetid'])) {
192 trigger_localised_error(
'HIPO0008', E_USER_WARNING);
196 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($this->_running_vars[
'assetid']);
197 $this->_running_vars[
'type_code'] = $asset->type();
198 $this->_running_vars[
'complete'] = FALSE;
199 return parent::prepare();
217 if ($step_data[
'complete']) {
218 $this->_running_vars[
'complete'] = TRUE;
220 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($this->_running_vars[
'assetid'], $this->_running_vars[
'type_code']);
221 $edit_fns = $asset->getEditFns();
223 return $edit_fns->generateReport($this, $step_data, $prefix);