public function renderWidget($ps_widget_id, &$pa_settings) { parent::renderWidget($ps_widget_id, $pa_settings); $this->opo_view->setVar('request', $this->getRequest()); $this->opo_view->setVar('hours', $pa_settings['hours']); $vo_tq = new TaskQueue(); $qr_completed = $this->opo_db->query("\n\t\t\t\tSELECT tq.*, u.fname, u.lname \n\t\t\t\tFROM ca_task_queue tq \n\t\t\t\tLEFT JOIN ca_users u ON u.user_id = tq.user_id \n\t\t\t\tWHERE tq.completed_on > ? \n\t\t\t\tORDER BY tq.completed_on desc\n\t\t\t", time() - 60 * 60 * $pa_settings['hours']); $va_completed = array(); while ($qr_completed->nextRow()) { $va_row = $qr_completed->getRow(); $va_params = caUnserializeForDatabase($va_row["parameters"]); $va_completed[$va_row["task_id"]]["handler_name"] = $vo_tq->getHandlerName($va_row['handler']); $va_completed[$va_row["task_id"]]["created"] = $va_row["created_on"]; $va_completed[$va_row["task_id"]]["by"] = $va_row["fname"] . ' ' . $va_row['lname']; $va_completed[$va_row["task_id"]]["completed_on"] = $va_row["completed_on"]; $va_completed[$va_row["task_id"]]["error_code"] = $va_row["error_code"]; if ((int) $va_row["error_code"] > 0) { $o_e = new ApplicationError((int) $va_row["error_code"], '', '', '', false, false); $va_row["error_message"] = $o_e->getErrorMessage(); } else { $va_row["error_message"] = ''; } $va_completed[$va_row["task_id"]]["error_message"] = $va_row["error_message"]; if (is_array($va_report = caUnserializeForDatabase($va_row["notes"]))) { $va_completed[$va_row["task_id"]]["processing_time"] = (double) $va_report['processing_time']; } $va_completed[$va_row["task_id"]]["status"] = $vo_tq->getParametersForDisplay($va_row); } $this->opo_view->setVar('jobs_done', $qr_completed->numRows()); $this->opo_view->setVar('jobs_done_data', $va_completed); $qr_qd = $this->opo_db->query("\n\t\t\t\tSELECT * \n\t\t\t\tFROM ca_task_queue tq\n\t\t\t\tLEFT JOIN ca_users AS u ON tq.user_id = u.user_id\n\t\t\t\tWHERE tq.completed_on is NULL\n\t\t\t"); $this->opo_view->setVar('jobs_queued_processing', $qr_qd->numRows()); $va_qd_jobs = array(); $va_pr_jobs = array(); while ($qr_qd->nextRow()) { $va_row = $qr_qd->getRow(); $va_params = caUnserializeForDatabase($va_row["parameters"]); if (!$vo_tq->rowKeyIsBeingProcessed($va_row["row_key"])) { $va_qd_jobs[$va_row["task_id"]]["handler_name"] = $vo_tq->getHandlerName($va_row['handler']); $va_qd_jobs[$va_row["task_id"]]["created"] = $va_row["created_on"]; $va_qd_jobs[$va_row["task_id"]]["by"] = $va_row["fname"] . ' ' . $va_row['lname']; $va_qd_jobs[$va_row["task_id"]]["status"] = $vo_tq->getParametersForDisplay($va_row); } else { $va_pr_jobs[$va_row["task_id"]]["handler_name"] = $vo_tq->getHandlerName($va_row['handler']); $va_pr_jobs[$va_row["task_id"]]["created"] = $va_row["created_on"]; $va_pr_jobs[$va_row["task_id"]]["by"] = $va_row["fname"] . ' ' . $va_row['lname']; $va_pr_jobs[$va_row["task_id"]]["status"] = $vo_tq->getParametersForDisplay($va_row); } } $this->opo_view->setVar('qd_job_data', $va_qd_jobs); $this->opo_view->setVar('pr_job_data', $va_pr_jobs); $this->opo_view->setVar('update_frequency', ($vn_freq = (int) $this->opo_config->get('update_frequency')) ? $vn_freq : 60); return $this->opo_view->render('main_html.php'); }
function Show() { $o_purify = new HTMLPurifier(); $va_nums = explode(';', $this->request->getParameter('n', pString)); $va_error_messages = array(); if (is_array($va_nums)) { $o_err = new ApplicationError(0, '', '', '', false, false); foreach ($va_nums as $vn_error_number) { $o_err->setError($vn_error_number, '', '', false, false); $va_error_messages[] = $o_err->getErrorMessage(); } } $this->view->setVar('error_messages', $va_error_messages); $this->view->setVar('referrer', $o_purify->purify($this->request->getParameter('r', pString))); $this->render('error_html.php'); }
public function postError($pn_num, $ps_message, $ps_context, $ps_source = '') { $o_error = new ApplicationError(); $o_error->setErrorOutput($this->error_output); $o_error->setError($pn_num, $ps_message, $ps_context, $ps_source); if (!$this->errors) { $this->errors = array(); } array_push($this->errors, $o_error); if (($app = AppController::getInstance()) && ($o_request = $app->getRequest()) && defined('__CA_ENABLE_DEBUG_OUTPUT__') && __CA_ENABLE_DEBUG_OUTPUT__) { $va_trace = debug_backtrace(); array_shift($va_trace); $vs_stacktrace = ''; while ($va_source = array_shift($va_trace)) { $vs_stacktrace .= " [{$va_source['file']}:{$va_source['line']}]"; } $o_notification = new NotificationManager($o_request); $o_notification->addNotification("[{$pn_num}] {$ps_message} ({$ps_context}" . ($ps_source ? "; {$ps_source}" : '') . $vs_stacktrace); } return true; }
/** * Adds a new error * * @param int $pn_num * @param string $ps_message * @param string $ps_context */ function postError($pn_num, $ps_message, $ps_context, $ps_source = '') { $o_error = new ApplicationError(); $o_error->setErrorOutput($this->opb_die_on_error); $o_error->setHaltOnError($this->opb_die_on_error); $o_error->setError($pn_num, $ps_message, $ps_context, $ps_source); array_push($this->errors, $o_error); return true; }