8 define(
"TITLE_DASHBOARD_STATISTICS", _(
"Statistics Dashboard"));
21 $this->Name =
"dashboard-statistics";
22 $this->Title = TITLE_DASHBOARD_STATISTICS;
23 $this->MenuList =
"Admin::Dashboards::Statistics";
25 parent::__construct();
26 $this->
dbManager = $GLOBALS[
'container']->get(
'db.manager');
34 $query =
"SELECT ag.agent_name,ag.agent_desc,count(jq.*) AS fired_jobs ";
35 $query.=
"FROM agent ag LEFT OUTER JOIN jobqueue jq ON (jq.jq_type = ag.agent_name) ";
36 $query.=
"GROUP BY ag.agent_name,ag.agent_desc ORDER BY fired_jobs DESC;";
38 $rows = $this->
dbManager->getRows($query);
40 $V =
"<table border=1>";
41 $V .=
"<tr><th>".(
"AgentName").
"</th><th>"._(
"Description").
"</th><th>"._(
"Number of jobs").
"</th></tr>";
43 foreach ($rows as $agData) {
44 $V .=
"<tr><td>".$agData[
'agent_name'].
"</td><td>".$agData[
'agent_desc'].
"</td><td align='right'>".$agData[
'fired_jobs'].
"</td></tr>";
46 'agentName' => $agData[
'agent_name'],
47 'agentDesc' => $agData[
'agent_desc'],
48 'firedJobs' => intval($agData[
'fired_jobs']),
62 $V =
"<h1> Statistics </h1>";
63 $V .=
"<table style='width: 100%;' border=0>\n";
66 $V .=
"<td class='dashboard'>";
67 $text = _(
"Jobs Sumary");
68 $V .=
"<h2>$text</h2>\n";
This is the Plugin class. All plugins should:
Output()
This function is called when user output is requested. This function is responsible for content....
__construct()
base constructor. Most plugins will just use this
CountAllJobs($fromRest=false)
Lists number of ever quequed jobs per job type (agent)..
#define PLUGIN_DB_ADMIN
Plugin requires admin level permission on DB.
fo_dbManager * dbManager
fo_dbManager object