summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 648625d)
raw | patch | inline | side by side (parent: 648625d)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 Aug 2010 15:04:47 +0000 (15:04 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 Aug 2010 15:04:47 +0000 (15:04 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19408 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/generic/statistics/class_statistics.inc | patch | blob | history | |
gosa-core/plugins/generic/statistics/statistics.tpl | patch | blob | history |
diff --git a/gosa-core/plugins/generic/statistics/class_statistics.inc b/gosa-core/plugins/generic/statistics/class_statistics.inc
index 15db5bc1798e2838b4b08d4e8f43abcc7d543a0b..433e33833440fb7cfb4c2de8ab73a272294c605e 100644 (file)
$available = $this->getLocalStatisticsFiles();
$alreadyTransmitted = $this->getStatisticsDatesFromServer();
$unsubmitted = array_intersect($available,$alreadyTransmitted);
+
+ // Exclude statistic collection from today, they are still active and cannot be submitted.
+ $curDate = date('Y-m-d');
+ if(isset($unsubmitted)) unset($unsubmitted[$curDate]);
+
return($unsubmitted);
}
$dates = array();
$DataSet2 = new pData;
$max = 1;
+ $seriesNumber = 0;
foreach($res['actionsPerInterval'] as $category => $entriesPerDate){
// Collect data per category and store used timestamps
$DataSet2->SetSerieName(_($category), $category);
$Test->setLabel($DataSet->GetData(),$DataSet->GetDataDescription(),"Serie1",0,"Daily incomes");
$DataSet2->AddSerie($category);
+ $seriesNumber++;
// Detect maximum value, to adjust the Y-Axis
$tmpMax = max($dataArray[$category]);
if(count($dates)){
$Test2->drawScale($DataSet2->GetData(),$DataSet2->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
- $DataSet2->RemoveSerie('date');
}
// Draw the cubic curve graph
$DataSet2->AddPoint($errors, 'Errors');
$DataSet2->SetSerieName('Errors', 'Errors');
$DataSet2->AddSerie('Errors');
-
+ $seriesNumber ++;
+
+ $Test2->setColorPalette($seriesNumber-1,255,0,0);
// Draw legend
$Test2->drawLegend(650,30,$DataSet2->GetDataDescription(),255,255,255);
// Draw right scale (Errors per day)
$Test2->setFixedScale(0.0001,(max($errors) +1) *1.1);
$Test2->drawRightScale($DataSet2->GetData(),$DataSet2->GetDataDescription(),SCALE_NORMAL,120,150,150,TRUE,0,2);
- $Test2->drawBarGraph($DataSet2->GetData(),$DataSet2->GetDataDescription(),TRUE);
+ $Test2->drawBarGraph($DataSet2->GetData(),$DataSet2->GetDataDescription());
$file = '/tmp/graph_'.$this->graphID_2;
$Test2->Render($file);
$smarty->assign('graphID_1', $this->graphID_1);
$smarty->assign('graphID_2', $this->graphID_2);
+ $smarty->assign('unsbmittedFiles', count($this->unsbmittedFiles));
+ $smarty->assign('unsbmittedFilesMsg',
+ sprintf(
+ _("You have currently %s unsubmitted statistic collection, do you want to transmit them now?"),
+ count($this->unsbmittedFiles)));
return($smarty->fetch(get_template_path('statistics.tpl', TRUE)));
}
diff --git a/gosa-core/plugins/generic/statistics/statistics.tpl b/gosa-core/plugins/generic/statistics/statistics.tpl
index 47fd7a832526a40d85d090484247e917707ef532..71572b76247ccbf5225f9ff88e24da6797d73a36 100644 (file)
{else}
- <button name='transmitStatistics'>{t}Send{/t}</button>
- <button name='receiveStatistics'>{t}Receive{/t}</button>
+ {if $unsbmittedFiles != 0}
+ {$unsbmittedFilesMsg}
+ <button name='transmitStatistics'>{t}Send{/t}</button>
+ <hr>
+ {/if}
- <hr>
- <table width="100%">
+ <table>
<tr>
- <td>{t}Start{/t}</td>
- <td>
+ <td>{t}Generate report for{/t}</td>
+ <td style='width:220px;'>
<input type="text" id="graph1DatePicker1" name="graph1DatePicker1" class="date" value="{$graph1DatePicker1}">
<script type="text/javascript">
{literal}
{/literal}
</script>
</td>
- </tr>
- <tr>
- <td>{t}Stop{/t}</td>
- <td>
+ <td> - </td>
+ <td style='width:220px;'>
<input type="text" id="graph1DatePicker2" name="graph1DatePicker2" class="date" value="{$graph1DatePicker2}">
<script type="text/javascript">
{literal}
{/literal}
</script>
</td>
+ <td>
+ <button name='receiveStatistics'>{t}Receive{/t}</button>
+ </td>
</tr>
</table>
+ <hr>
<img src='plugins/statistics/getGraph.php?id={$graphID_1}'>
<img src='plugins/statistics/getGraph.php?id={$graphID_2}'>