19 require_once SQ_DATA_PATH.
'/private/conf/hipo.inc';
42 var $source_code_name =
'';
54 var $last_updated = 0;
68 var $is_prepared = FALSE;
77 var $uses_trans = TRUE;
83 var $_hipo_vars = Array(
86 'initialise_mode' =>
'',
90 'server_taskid' =>
'',
101 var $_options = Array(
102 'on_complete_url' =>
'',
103 'auto_complete' => TRUE,
110 var $_running_vars = Array();
116 var $_current_mode =
'web';
155 var $_steps = Array();
166 $this->_current_mode = (SQ_PHP_CLI) ?
'server' :
'web';
167 if (!empty($code_name)) $this->
load($code_name);
180 return strtolower(get_class($this));
197 return $this->hipo_name;
216 return $this->_steps;
229 return ($this->_hipo_vars[
'current_step'] >= count($this->_steps) || $this->_hipo_vars[
'aborted']);
242 return (
int) $this->_hipo_vars[
'percent_done'];
255 return $this->_running_vars;
270 if (!is_array($vars)) {
271 trigger_localised_error(
'HIPO0045', E_USER_WARNING);
274 $this->_running_vars =& $vars;
290 if (!isset($this->_options[$name])) {
291 trigger_localised_error(
'HIPO0044', E_USER_WARNING, $name);
294 $this->_options[$name] = $value;
309 if (!isset($this->_options[$name])) {
310 trigger_localised_error(
'HIPO0044', E_USER_WARNING, $name);
313 return $this->_options[$name];
329 if (!isset($this->_hipo_vars[$name])) {
330 trigger_localised_error(
'HIPO0044', E_USER_WARNING, $name);
333 $this->_hipo_vars[$name] = $value;
348 if (!isset($this->_hipo_vars[$name])) {
349 trigger_localised_error(
'HIPO0044', E_USER_WARNING, $name);
352 return $this->_hipo_vars[$name];
370 $error = trim($error);
371 if (!empty($error)) {
372 $this->_hipo_vars[
'errors'][] = Array(
375 'warning' => $warning,
390 return $this->_hipo_vars[
'errors'];
404 $this->is_prepared = TRUE;
425 if (!$this->is_prepared) {
426 if (!$this->
prepare())
return FALSE;
429 $this->_hipo_vars[
'initialise_mode'] = $this->_current_mode;
430 $this->_hipo_vars[
'running_mode'] = $this->_current_mode;
432 if (empty($source_code_name)) {
433 $source_initialise_mode = $this->_current_mode;
435 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
436 $source_job = $hh->getJob($source_code_name);
437 if (is_null($source_job) || ($source_job->source_code_name != $source_job->code_name)) {
440 $source_initialise_mode = $source_job->getInitialiseMode();
446 for ($i = 0; $i < count($init_steps); $i++) {
449 if ($source_initialise_mode ==
'server' && $init_steps[$i][
'running_mode'] ==
'web') {
450 trigger_localised_error(
'HIPO0043', E_USER_WARNING);
454 }
else if ($this->_current_mode ==
'web' && !SQ_HIPO_USE_SERVER) {
455 $init_steps[$i][
'running_mode'] =
'web';
457 }
else if ($init_steps[$i][
'running_mode'] ==
'server' && empty($init_steps[$i][
'auto_step'])) {
458 trigger_localised_error(
'HIPO0042', E_USER_WARNING);
459 $init_steps[$i][
'auto_step'] = TRUE;
465 $this->_steps = $init_steps;
467 $steps = serialize($this->_steps);
468 $vars = serialize($this->_running_vars);
469 $options = serialize($this->_options);
470 $hipo_vars = serialize($this->_hipo_vars);
474 if (empty($source_code_name)) {
475 $source_code_name = $code_name;
478 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db3');
479 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
483 $bind_vars[
'code_name'] = $code_name;
485 $existing = array_get_index($result, 0, Array());
486 }
catch (Exception $e) {
487 throw new Exception(
'Unable to get HIPO job code name: '.$code_name.
' due to database error: '.$e->getMessage());
490 if (!empty($existing)) {
491 $user = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($existing[
'userid']);
492 trigger_localised_error(
'HIPO0041', E_USER_WARNING, $user->name, $user->id, $GLOBALS[
'SQ_SYSTEM']->datetime(iso8601_ts($existing[
'last_updated'])));
493 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
494 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
502 'code_name' => $code_name,
503 'job_type' => get_class($this),
504 'userid' => $GLOBALS[
'SQ_SYSTEM']->currentUserId(),
506 'source_code_name' => $source_code_name,
507 'hipo_vars' => $hipo_vars,
508 'options' => $options,
510 'running_vars' => $vars,
511 'last_updated' => ts_iso8601($now),
515 }
catch (Exception $e) {
516 throw new Exception(
'Unable to insert new HIPO job due to database error: '.$e->getMessage());
521 }
catch (Exception $e) {
522 throw new Exception(
'Unable to get HIPO job code name: '.$code_name.
' due to database error: '.$e->getMessage());
525 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
526 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
528 $this->userid = $GLOBALS[
'SQ_SYSTEM']->currentUserId();
529 $this->last_updated = $now;
584 if (empty($config_vars))
return 1;
585 foreach ($config_vars as $name => $value) {
586 if (strpos($name,
'THRESHOLD') !== FALSE) {
587 return constant($name);
631 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db3');
632 $db = $GLOBALS[
'SQ_SYSTEM']->db;
635 $bind_vars[
'code_name'] = $code_name;
637 $result = $result[0];
638 }
catch (Exception $e) {
639 throw new Exception(
'Unable to load the HIPO vars for: '.$code_name.
' due to database error: '.$e->getMessage());
642 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
644 if (empty($result))
return FALSE;
646 if ($result[
'job_type'] != get_class($this)) {
647 trigger_localised_error(
'HIPO0040', E_USER_WARNING, $result[
'job_type'], get_class($this));
651 $this->code_name = $code_name;
652 $this->source_code_name = $result[
'source_code_name'];
653 $this->userid = $result[
'userid'];
654 $this->_hipo_vars = unserialize($result[
'hipo_vars']);
655 $this->_options = unserialize($result[
'options']);
656 $this->_steps = unserialize($result[
'steps']);
657 $this->_running_vars = unserialize($result[
'running_vars']);
658 $this->last_updated = iso8601_ts($result[
'last_updated']);
661 $prev_last_updated = array_get_index($this->_hipo_vars,
'timeout_prev_last_updated', $this->last_updated);
664 $running_at_server = isset($this->_steps[$this->_hipo_vars[
'current_step']]) && isset($this->_steps[$this->_hipo_vars[
'current_step']][
'running_mode']) && $this->_steps[$this->_hipo_vars[
'current_step']][
'running_mode'] ==
'server';
666 if ($this->_current_mode !=
'server' && $running_at_server && SQ_HIPO_USE_SERVER) {
667 if ($this->last_updated > $prev_last_updated) {
669 $prev_last_updated = $this->last_updated;
672 $time_since_update = time() - $prev_last_updated;
676 if ($time_since_update > SQ_HIPO_SERVER_STATUS_CHECK_THRESHOLD) {
680 if (empty($this->_hipo_vars[
'server_taskid'])) {
684 require_once SQ_SYSTEM_ROOT.
'/core/server/squiz_server_client_mysource3.inc';
687 'command' =>
'alive',
688 'userid' => $GLOBALS[
'SQ_SYSTEM']->currentUserId(),
689 'source_code_name' => $this->source_code_name,
690 'taskid' => $this->_hipo_vars[
'server_taskid'],
695 if ($client->connect()) {
696 if ($client->write(
'HIPO_Job', $data)) {
697 $ack = $client->read();
698 if (!is_null($ack)) {
699 switch ($ack[
'result']) {
702 $prev_last_updated = $this->last_updated;
709 trigger_localised_error(
'HIPO0048', E_USER_WARNING, $ack[
'msg'].
' (TaskID #'.$this->_hipo_vars[
'server_taskid'].
')');
713 trigger_localised_error(
'HIPO0047', E_USER_WARNING, print_r($ack, TRUE).
' (TaskID #'.$this->_hipo_vars[
'server_taskid'].
')');
717 $client->disconnect();
729 $this->_hipo_vars[
'timeout_prev_last_update'] = $prev_last_updated;
747 function save($ignore_running_mode=FALSE)
749 if ((!$GLOBALS[
'SQ_SYSTEM']->userRoot()) && (!$GLOBALS[
'SQ_SYSTEM']->userSystemAdmin()) && ($this->userid != $GLOBALS[
'SQ_SYSTEM']->currentUserId())) {
750 trigger_localised_error(
'HIPO0039', E_USER_WARNING, $this->code_name);
755 if (!$ignore_running_mode && $this->_current_mode != $this->_hipo_vars[
'running_mode']) {
764 if ($this->_hipo_vars[
'aborted']) {
769 if ($this->_current_mode ==
'web') {
777 if ($this->code_name != $this->source_code_name || $this->_hipo_vars[
'initialise_mode'] !=
'web') {
787 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db3');
788 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
794 $bind_vars[
'code_name'] = $this->code_name;
796 }
catch (Exception $e) {
797 throw new Exception(
'Unable to delete HIPO job with code name: '.$code_name.
' due to database error: '.$e->getMessage());
803 'hipo_vars' => serialize($this->_hipo_vars),
804 'options' => serialize($this->_options),
805 'steps' => serialize($this->_steps),
806 'running_vars' => serialize($this->_running_vars),
807 'last_updated' => ts_iso8601($now),
808 'code_name' => $this->code_name,
811 }
catch (Exception $e) {
812 throw new Exception(
'Unable to update HIPO job vars due to database error: '.$e->getMessage());
817 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
818 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
819 $this->last_updated = $now;
836 $step = $this->_hipo_vars[
'current_step'];
838 $prev_step_per = ($step / count($this->_steps)) * 100;
839 $this_step_per = ($this->
complete()) ? 0 : ((1 / count($this->_steps)) * $this->_steps[$step][
'percent_done']);
840 $this->_hipo_vars[
'percent_done'] = round($prev_step_per + $this_step_per, 2);
842 if (!empty($this->_steps[$step][
'complete'])) {
850 $this->_hipo_vars[
'running_mode'] = $this->_hipo_vars[
'initialise_mode'];
867 if (is_null($new_time)) $new_time = time();
869 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db3');
870 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
871 $db = $GLOBALS[
'SQ_SYSTEM']->db;
876 last_updated = :new_time
878 code_name = :code_name';
885 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
886 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
900 $step = $this->_hipo_vars[
'current_step'];
901 if (isset($this->_steps[$step])) {
902 if (!empty($this->_steps[$step][
'hipo_job']) && !empty($this->_steps[$step][
'hipo_job'][
'code_name']) && !empty($this->_steps[$step][
'hipo_job'][
'job_type'])) {
903 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
904 $job = $hh->getJob($this->_steps[$step][
'hipo_job'][
'code_name']);
923 return $this->_hipo_vars[
'initialise_mode'];
940 if ($mode !=
'web' && $mode !=
'server') {
945 if (!is_null($sub_job)) {
946 if (!$sub_job->setRunningMode($mode))
return FALSE;
949 $this->_hipo_vars[
'running_mode'] = $mode;
950 $this->_hipo_vars[
'server_taskid'] = $server_taskid;
951 if ($this->
save(TRUE)) {
968 return $this->_hipo_vars[
'running_mode'];
981 $step = $this->_hipo_vars[
'current_step'];
984 if (!empty($this->_hipo_vars[
'errors'])) {
987 return $this->_options[
'auto_complete'];
990 }
else if (!empty($this->_steps[$step][
'function_call'])) {
991 return $this->_steps[$step][
'auto_step'];
993 }
else if (!empty($this->_steps[$step][
'hipo_job'])) {
997 if (!is_null($sub_job)) {
998 return $sub_job->autoStep();
1002 return $this->_steps[$step][
'auto_step'];
1021 $this->_hipo_vars[
'current_step']++;
1022 for ($i = $this->_hipo_vars[
'current_step']; $i < count($this->_steps); $i++) {
1023 if (isset($this->_steps[$i][
'skip_step']) && $this->_steps[$i][
'skip_step']) {
1024 $this->_steps[$i][
'complete'] = TRUE;
1025 $this->_steps[$i][
'percent_done'] = 100;
1026 $this->_hipo_vars[
'current_step']++;
1034 return $this->_hipo_vars[
'current_step'];
1049 if (!isset($this->_steps[$stepid]))
return FALSE;
1050 $this->_steps[$stepid][
'skip_step'] = TRUE;
1071 if ($this->_current_mode !=
'web') {
1072 trigger_localised_error(
'HIPO0038', E_USER_WARNING);
1076 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
1077 $step = $this->_hipo_vars[
'current_step'];
1078 $step_data = (isset($this->_steps[$step])) ? $this->_steps[$step] : Array();
1081 if ($nested && count($this->_steps) > 1) {
1083 $status_msg = $this->_steps[$step][
'name'];
1086 $status_msg = ($this->
complete()) ? translate(
'completed') : translate(
'unknown_error_occurred');
1090 $o->openField(
' ');
1097 if ($this->
complete() && !empty($this->_hipo_vars[
'errors'])) {
1105 if (!empty($this->_steps[$step][
'function_call'])) {
1106 $fn = (empty($this->_steps[$step][
'function_call'][
'paint_function'])) ?
'paintStepDefault' : $this->_steps[$step][
'function_call'][
'paint_function'];
1107 $prefix = $this->code_name.
'step'.$step;
1108 $this->$fn($this->_steps[$step], $o, $prefix);
1109 }
else if (!empty($step_data[
'hipo_job'])) {
1111 if (!is_null($sub_job)) {
1113 $sub_job->paint($o, TRUE);
1117 trigger_localised_error(
'HIPO0037', E_USER_WARNING, $this->_hipo_vars[
'current_step']);
1138 if ((!$GLOBALS[
'SQ_SYSTEM']->userRoot()) && (!$GLOBALS[
'SQ_SYSTEM']->userSystemAdmin()) && ($this->userid != $GLOBALS[
'SQ_SYSTEM']->currentUserId())) {
1139 trigger_localised_error(
'HIPO0036', E_USER_WARNING);
1145 if ($this->_current_mode != $this->_hipo_vars[
'running_mode']) {
1152 $step = $this->_hipo_vars[
'current_step'];
1153 if ($this->_steps[$step][
'running_mode'] == $this->_hipo_vars[
'running_mode']) {
1156 if ($this->_hipo_vars[
'running_mode'] ==
'web') {
1158 set_error_handler(Array(&$this,
'_errorHandler'));
1159 $max_assets_to_process = max($this->
getThreshold(), 1);
1162 while (($i < $max_assets_to_process) && (!$this->_steps[$step][
'complete'])) {
1163 $prefix = $this->code_name.
'step'.$step;
1164 $ret_val = $ret_val && $this->
processWeb($this->_steps[$step], $prefix);
1167 restore_error_handler();
1172 $prefix = $this->code_name.
'step'.$step;
1173 set_error_handler(Array(&$this,
'_errorHandler'));
1174 $ret_val = $this->
processServer($this->_steps[$step], $prefix);
1175 restore_error_handler();
1180 }
else if (SQ_HIPO_USE_SERVER) {
1182 switch ($this->_steps[$step][
'running_mode']) {
1187 require_once SQ_SYSTEM_ROOT.
'/core/server/squiz_server_client_mysource3.inc';
1190 'command' =>
'start',
1191 'userid' => $GLOBALS[
'SQ_SYSTEM']->currentUserId(),
1192 'source_code_name' => $this->source_code_name,
1197 if ($client->connect()) {
1198 if ($client->write(
'HIPO_Job', $data)) {
1199 $ack = $client->read();
1200 if (!is_null($ack)) {
1201 switch ($ack[
'result']) {
1207 trigger_localised_error(
'HIPO0054', E_USER_WARNING, $ack[
'msg']);
1211 trigger_localised_error(
'HIPO0053', E_USER_WARNING, print_r($ack, TRUE));
1217 $client->disconnect();
1231 log_error(
'The Squiz Server reset the running mode to WEB for User ID #'.$GLOBALS[
'SQ_SYSTEM']->currentUserId().
' and Job '.$this->source_code_name);
1236 trigger_localised_error(
'HIPO0052', E_USER_WARNING, $this->_steps[$step][
'running_mode']);
1244 trigger_localised_error(
'HIPO0051', E_USER_ERROR);
1264 $process_ok = FALSE;
1265 if (!empty($step_data[
'function_call'])) {
1266 $fn = $step_data[
'function_call'][
'process_function'];
1267 $process_ok = $this->$fn($step_data, $prefix);
1269 }
else if (!empty($step_data[
'hipo_job'])) {
1270 if (empty($step_data[
'hipo_job'][
'code_name']) || empty($step_data[
'hipo_job'][
'job_type'])) {
1271 $fn = $step_data[
'hipo_job'][
'init_details_function'];
1274 $running_vars = Array();
1276 $hipo_vars = Array();
1277 $this->$fn($job_type, $running_vars, $options, $hipo_vars);
1280 if (empty($job_type)) {
1284 if (empty($hipo_vars)) {
1285 require_once SQ_SYSTEM_ROOT.
'/core/hipo/jobs/'.$job_type.
'.inc';
1287 require_once $hipo_vars[
'job_dir'].
'/'.$job_type.
'.inc';
1290 $init_hipo =
new $job_type();
1292 $init_hipo->setRunningVars($running_vars);
1293 foreach ($options as $k => $v) {
1294 $init_hipo->setOption($k, $v);
1296 foreach ($hipo_vars as $k => $v) {
1297 $init_hipo->setHipoVar($k, $v);
1300 $code_name = $init_hipo->initialise($this->source_code_name);
1302 $step_data[
'hipo_job'][
'code_name'] = $code_name;
1303 $step_data[
'hipo_job'][
'job_type'] = $job_type;
1310 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
1311 $hipo = $hh->getJob($step_data[
'hipo_job'][
'code_name']);
1312 if (!is_null($hipo) && $hipo->process()) {
1313 $step_data[
'running_mode'] = $hipo->getRunningMode();
1314 $step_data[
'percent_done'] = $hipo->percentDone();
1315 $step_data[
'complete'] = $hipo->complete();
1322 trigger_localised_error(
'HIPO0050', E_USER_WARNING, $this->_hipo_vars[
'current_step']);
1326 $save_ok = $this->
save();
1327 return ($process_ok && $save_ok);
1347 if (!empty($step_data[
'function_call'])) {
1348 $fn = $step_data[
'function_call'][
'process_function'];
1349 $prev_percent = (int) $this->_hipo_vars[
'percent_done'];
1350 while (!$step_data[
'complete']) {
1351 if (!$this->$fn($step_data, $prefix)) {
1356 $current_percent = (int) $this->_hipo_vars[
'percent_done'];
1357 if ((($current_percent != $prev_percent) && ($current_percent % 3 == 0)) || $step_data[
'complete']) {
1360 $prev_percent = $current_percent;
1368 }
else if (!empty($step_data[
'hipo_job'])) {
1370 $fn = $step_data[
'hipo_job'][
'init_details_function'];
1374 $running_vars = Array();
1376 $hipo_vars = Array();
1377 $this->$fn($job_type, $running_vars, $options, $hipo_vars);
1379 if (empty($job_type))
return FALSE;
1381 if (empty($hipo_vars)) {
1382 require_once SQ_SYSTEM_ROOT.
'/core/hipo/jobs/'.$job_type.
'.inc';
1384 require_once $hipo_vars[
'job_dir'].
'/'.$job_type.
'.inc';
1387 $init_hipo =
new $job_type();
1389 $init_hipo->setRunningVars($running_vars);
1390 foreach ($options as $k => $v) {
1391 $init_hipo->setOption($k, $v);
1394 $code_name = $init_hipo->initialise($this->source_code_name);
1395 if (!$code_name)
return FALSE;
1398 $step_data[
'hipo_job'][
'code_name'] = $code_name;
1399 $step_data[
'hipo_job'][
'job_type'] = $job_type;
1402 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
1403 $hipo = $hh->getJob($code_name, $job_type);
1404 if (is_null($hipo))
return FALSE;
1406 while (!$step_data[
'complete'] && $step_data[
'running_mode'] ==
'server') {
1407 if (!$hipo->process())
return FALSE;
1408 $step_data[
'running_mode'] = $hipo->getRunningMode();
1409 $step_data[
'percent_done'] = $hipo->percentDone();
1410 $step_data[
'complete'] = $hipo->complete();
1417 trigger_localised_error(
'HIPO0050', E_USER_WARNING, $this->_hipo_vars[
'current_step']);
1434 function abort($abort_source=TRUE, $abort_dependant=TRUE)
1438 if ($abort_source && $this->source_code_name != $this->code_name) {
1439 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
1440 $source_job = $hh->getJob($this->source_code_name);
1441 if (is_null($source_job) || ($source_job->source_code_name != $source_job->code_name)) {
1444 $source_job->abort(TRUE, FALSE);
1447 if ($abort_dependant) {
1449 if (!is_null($dependant_job)) {
1450 $dependant_job->abort(FALSE, TRUE);
1455 if ($this->_current_mode ==
'web' && $this->_hipo_vars[
'running_mode'] ==
'server') {
1458 if (empty($this->_hipo_vars[
'server_taskid'])) {
1462 require_once SQ_SYSTEM_ROOT.
'/core/server/squiz_server_client_mysource3.inc';
1465 'command' =>
'abort',
1466 'userid' => $GLOBALS[
'SQ_SYSTEM']->currentUserId(),
1467 'source_code_name' => $this->source_code_name,
1468 'taskid' => $this->_hipo_vars[
'server_taskid'],
1473 if ($client->connect()) {
1474 if ($client->write(
'HIPO_Job', $data)) {
1475 $ack = $client->read();
1476 if (!is_null($ack)) {
1477 switch ($ack[
'result']) {
1483 trigger_localised_error(
'HIPO0048', E_USER_WARNING, $ack[
'msg'].
' (TaskID #'.$this->_hipo_vars[
'server_taskid'].
')');
1487 trigger_localised_error(
'HIPO0047', E_USER_WARNING, print_r($ack, TRUE).
' (TaskID #'.$this->_hipo_vars[
'server_taskid'].
')');
1494 $client->disconnect();
1497 if ($ret_val)
return TRUE;
1499 trigger_localised_error(
'HIPO0046', E_USER_WARNING);
1508 if (!is_null($sub_job)) $sub_job->jobAborted();
1523 $this->
setOption(
'auto_complete', TRUE);
1524 $this->_hipo_vars[
'aborted'] = TRUE;
1525 return $this->
save();
1538 require_once SQ_FUDGE_PATH.
'/general/datetime.inc';
1541 <div align=
"center">
1542 <table border=
"0" cellspacing=
"1" cellpadding=
"1" bgcolor=
"#000000" width=
"95%">
1544 <td bgcolor=
"#412F49" align=
"center" width=
"100%">
1545 <span style=
"color: #FFFFFF;"><b><?php echo translate(
'hipo_error_report', $this->
getHipoName());?></b><br />
1546 <span style=
"font-size: 80%;">
1547 <?php echo translate(
'hipo_herder_completion', (!$this->
complete()) ? translate(
'not') :
''); ?>
1553 <td bgcolor=
"#9E86AA" width=
"100%">
1554 <table border=
"0" width=
"100%" cellspacing=
"2" cellpadding=
"1">
1556 foreach ($this->_hipo_vars[
'errors'] as $error) {
1557 $err_type = ($error[
'warning']) ? translate(
'warning').
': ' : translate(
'error').
': ';
1560 <td align=
"left" valign=
"top">
1562 <?php echo $err_type; ?>
1564 <?php echo $error[
'message']; ?>
1566 <span
class=
"sq-hipo-small"><?php echo translate(
'reported'); ?> <?php echo readable_datetime($error[
'time']);?></span>
1577 <td bgcolor=
"#412F49" align=
"right">
1578 <b><a style=
"color: #FFFFFF; text-decoration: none;" href=
"<?php echo $this->_options['on_complete_url']; ?>"><?php echo translate(
'continue'); ?> >> </a>
1600 $o->openSection($step_data[
'name']);
1601 $o->openField(
' ');
1602 $this->
paintProgressBar($step_data[
'percent_done'], $step_data[
'message']);
1623 public static function paintProgressBar($percent_done, $message=
'', $label_class=
'sq-hipo-progress-bar-label', $percent_class=
'sq-hipo-progress-bar-percent', $bar_main_class=
'sq-hipo-progress-bar-main', $bar_done_class=
'sq-hipo-progress-bar-done')
1626 <table width=
"100%" border=
"0" cellspacing=
"0" cellpadding=
"0">
1628 <td
class=
"<?php echo $label_class; ?>"><b><?php echo nl2br($message); ?></b></td>
1629 <td
class=
"<?php echo $percent_class; ?>"><b><?php echo round($percent_done); ?>%</b></td>
1632 <td colspan=
"2"><img src=
"<?php echo sq_web_path('lib').'/web/images/blank.gif'; ?>" width=
"1" height=
"10" alt=
"blank" /></td>
1634 <td colspan=
"2" width=
"100%">
1635 <table width=
"100%" cellspacing=
"0" cellpadding=
"0" border=
"0">
1637 <td
class=
"<?php echo $bar_main_class; ?>" width=
"100%">
1638 <table width=
"<?php echo ($percent_done) ? round($percent_done) : '1'; ?>%" cellspacing=
"0" cellpadding=
"0" border=
"0">
1640 <td
class=
"<?php echo $bar_done_class; ?>"><img src=
"<?php echo sq_web_path('lib').'/web/images/blank.gif'; ?>" width=
"1" height=
"8" alt=
"blank" /></td>
1668 $terminate = ((E_USER_ERROR | E_ERROR) & $err_no);
1671 if (defined(
'E_RECOVERABLE_ERROR') && ($err_no == E_RECOVERABLE_ERROR)) {
1677 if ((error_reporting() & $err_no) || $terminate) {
1679 $err_file = hide_system_root($err_file);
1680 $err_msg = hide_system_root($err_msg);
1682 $text_msg = strip_tags(preg_replace(Array(
'/<br\\/?>/i',
'/<p[^>]*>/i'), Array(
"\n",
"\n\n"), $err_msg));
1685 if (ini_get(
'log_errors')) {
1686 log_error($text_msg, $err_no, $err_file, $err_line);
1690 if (SQ_CONF_DEBUG & 1) {
1691 $msg .=
' ('.$err_file.
':'.$err_line.
')';
1696 if ($terminate) $this->
save();
1711 $dependant_job = NULL;
1712 if (!empty($this->_running_vars[
'dependant_hipo_job'])) {
1713 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
1714 $dependant_job = $hh->getJob($this->_running_vars[
'dependant_hipo_job']);
1717 return $dependant_job;