summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xapplication/controllers/StatisticController.php144
-rwxr-xr-xapplication/layouts/default.phtml10
-rwxr-xr-xapplication/views/scripts/statistic/category.phtml126
-rwxr-xr-xapplication/views/scripts/statistic/index.phtml4
-rwxr-xr-xapplication/views/scripts/statistic/running.phtml120
-rw-r--r--application/views/scripts/statistic/success.phtml120
-rw-r--r--application/views/scripts/statistic/type.phtml120
-rwxr-xr-xpublic/media/js/script.js12
8 files changed, 13 insertions, 643 deletions
diff --git a/application/controllers/StatisticController.php b/application/controllers/StatisticController.php
deleted file mode 100755
index 57d73d3..0000000
--- a/application/controllers/StatisticController.php
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-class StatisticController extends Zend_Controller_Action
-{
- protected $acl;
- protected $config;
- protected $pbs2host;
- protected $eventMapper;
- protected $eventcategoryMapper;
- protected $eventreportMapper;
-
-
- public function init()
- {
- $this->eventMapper = new Application_Model_EventMapper();
- $this->eventcategoryMapper = new Application_Model_EventcategoryMapper();
- $this->eventreportMapper = new Application_Model_EventreportMapper();
-
- if (Zend_Auth::getInstance()->hasIdentity()) {
- $this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
- if(isset($this->userIDsNamespace['apikey'])) {
- $this->acl = new Poolctrl_Acl($this->pbs2host, $this->config['pbs2']['checkright'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
- }
- if(!$this->userIDsNamespace['membershipID'] !='') {
- $this->_helper->redirector('selectmembership', 'person');
- return;
- }
- } else {
- $this->_helper->redirector('login', 'auth');
- return;
- }
- }
-
- public function indexAction()
- {
- }
-
- public function checkrightAction() {
- $this->_helper->layout->disableLayout();
- $rightShortcut = $this->_request->getParam("rightShortcut");
- $this->view->right = $this->acl->checkRight($rightShortcut);
- }
-
- public function categorylistAction() {
-
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
- $poolID = $this->getRequest()->getParam('poolID');
- $userIDsSession = new Zend_Session_Namespace('userIDs');
- $userIDsSession->poolID = $poolID;
-
- if($this->acl->checkRight('eoo')) {
- $eventList = $this->eventMapper->fetchAll();
- } else {
- $eventList = $this->eventMapper->findBy(array("pbs_membershipID", $this->userIDsNamespace['membershipID']));
- }
-
- $ret['dataBar'] = $this->eventMapper->getCategoryBarCount($poolID);
- $ret['dataPie'] = $this->eventMapper->getCategoryPieCount($poolID);
- $ret['color'] = $this->eventcategoryMapper->getCategoryColor($poolID);
-
- echo json_encode($ret);
-
- }
-
- public function runninglistAction() {
-
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
- $poolID = $this->getRequest()->getParam('poolID');
- $userIDsSession = new Zend_Session_Namespace('userIDs');
- $userIDsSession->poolID = $poolID;
-
- if($this->acl->checkRight('eoo')) {
- $eventList = $this->eventMapper->fetchAll();
- } else {
- $eventList = $this->eventMapper->findBy(array("pbs_membershipID", $this->userIDsNamespace['membershipID']));
- }
-
- $ret['dataBar'] = $this->eventMapper->getRunningBarCount($poolID);
- $ret['dataPie'] = $this->eventMapper->getRunningPieCount($poolID);
-
- echo json_encode($ret);
-
- }
-
- public function successlistAction() {
-
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
- $poolID = $this->getRequest()->getParam('poolID');
- $userIDsSession = new Zend_Session_Namespace('userIDs');
- $userIDsSession->poolID = $poolID;
-
- if($this->acl->checkRight('eoo')) {
- $eventList = $this->eventMapper->fetchAll();
- } else {
- $eventList = $this->eventMapper->findBy(array("pbs_membershipID", $this->userIDsNamespace['membershipID']));
- }
-
- $ret['dataBar'] = $this->eventreportMapper->getSuccessBarCount($poolID);
- $ret['dataPie'] = $this->eventreportMapper->getSuccessPieCount($poolID);
-
- echo json_encode($ret);
-
- }
-
- public function typelistAction() {
-
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
- $poolID = $this->getRequest()->getParam('poolID');
- $userIDsSession = new Zend_Session_Namespace('userIDs');
- $userIDsSession->poolID = $poolID;
-
- if($this->acl->checkRight('eoo')) {
- $eventList = $this->eventMapper->fetchAll();
- } else {
- $eventList = $this->eventMapper->findBy(array("pbs_membershipID", $this->userIDsNamespace['membershipID']));
- }
-
- $ret['dataBar'] = $this->eventMapper->getTypeBarCount($poolID);
- $ret['dataPie'] = $this->eventMapper->getTypePieCount($poolID);
-
- echo json_encode($ret);
-
- }
-
- public function categoryAction() {
-
- }
-
- public function runningAction() {
-
- }
-
- public function successAction() {
-
- }
-
- public function typeAction() {
-
- }
-
-} \ No newline at end of file
diff --git a/application/layouts/default.phtml b/application/layouts/default.phtml
index 7649a33..5c999dd 100755
--- a/application/layouts/default.phtml
+++ b/application/layouts/default.phtml
@@ -51,13 +51,13 @@ echo $this->headScript()."\n";
$acl = new Poolctrl_Acl($pbs2host, $config['pbs2']['checkright'] . $userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);;
if($acl->checkRight('eo')) { ?>
<li class='navTreeItem'><a href='/event'>PoolCtrl</a></li>
- <li class='navTreeItem'><a href='/statistic'>Statistics</a></li>
+ <li class='navTreeItem'><a href='/statistics'>Statistics</a></li>
<li id='statisticsTree'>
<ul class='navTreeLevel1'>
- <li class='navTreeItem'><a href='/statistic/category'>Category</a></li>
- <li class='navTreeItem'><a href='/statistic/running'>Running</a></li>
- <li class='navTreeItem'><a href='/statistic/success'>Success</a></li>
- <li class='navTreeItem'><a href='/statistic/type'>Type</a></li>
+ <li class='navTreeItem'><a href='/statistics/category'>Category</a></li>
+ <li class='navTreeItem'><a href='/statistics/running'>Running</a></li>
+ <li class='navTreeItem'><a href='/statistics/success'>Success</a></li>
+ <li class='navTreeItem'><a href='/statistics/type'>Type</a></li>
</ul>
</li>
<?php } ?>
diff --git a/application/views/scripts/statistic/category.phtml b/application/views/scripts/statistic/category.phtml
deleted file mode 100755
index 4f94216..0000000
--- a/application/views/scripts/statistic/category.phtml
+++ /dev/null
@@ -1,126 +0,0 @@
-<h1>Statistic - Category</h1>
-
-<link
- rel="stylesheet" type="text/css"
- href="/media/css/jquery.jqplot.min.css" />
-<link
- rel="stylesheet" type="text/css"
- href="/media/css/style.css" />
-
-
-<select id="poolselectbox" name="PoolSelectbox"
- onclick="setPoolIDtmp();" onChange="fetchPoolEvents();">
- <option value="default">Please choose a Pool</option>
- <option value="all">All Pools</option>
-</select>
-
-<script>
-
-//fetch all poolevents of the selected #poolselectbox value
-function fetchPoolEvents() {
- poolID = $("#poolselectbox option:selected").val();
- plot();
-}
-
-function setPoolIDtmp() {
- poolIDtmp = $("#poolselectbox option:selected").val();
- }
-
-function plot() {
- poolID = $("#poolselectbox option:selected").val();
- $.get("/statistic/categorylist/poolID/" + poolID, function(data) {
- if(data.dataBar == '' && poolID != 'default') {
- $( "#noEventsDialog" ).dialog('open');
- $('#plotBar').empty();
- $('#plotPie').empty();
- } else if (poolID == 'default') {
- $('#plotBar').empty();
- $('#plotPie').empty();
- } else refreshPlot(data.dataBar, data.dataPie, data.color);
- }, "json");
-}
-
-//[[[4,"Lecture"],[36,"Maintenance"],[9,"Boot"],[21,"Shutdown"]]]
-
-function refreshPlot(dataBar, dataPie, color) {
- $('#plotBar').empty();
- $.jqplot('plotBar', dataBar, {
- seriesDefaults: {
- //renderer: $.jqplot.PieRenderer,
- renderer:$.jqplot.BarRenderer,
- pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
- shadowAngle: 135,
- rendererOptions: {
- //showDataLabels: true,
- barDirection: 'horizontal',
- varyBarColor : true
- }
- },
- axes: {
- yaxis: {
- renderer: $.jqplot.CategoryAxisRenderer
- }
- },
- seriesColors: color,
- highlighter: { show: false }
- });
- $('#plotPie').empty();
- $.jqplot('plotPie', dataPie,
- {
- seriesDefaults: {
- // Make this a pie chart.
- renderer: jQuery.jqplot.PieRenderer,
- rendererOptions: {
- // Put data labels on the pie slices.
- // By default, labels show the percentage of the slice.
- showDataLabels: true,
- lineLabels: true,
- varyBarColor : true
- }
- },
- seriesColors: color
- //legend: { show:true, location: 'e' }
- });
-}
-
-$(document).ready(function(){
-
- //fetch poollist from pbs database
- $.get("/event/getpoollist/", function(getpoollistresult){
- $("#poolselectbox").append(getpoollistresult);
- poolIDtmp = $("#poolselectbox option:selected").val();
- fetchPoolEvents();
- });
-});
-
-$(function() {
- $( "#noEventsDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: "No Events",
- buttons: {
- "OK": function() {
- $(this).dialog("close");
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- //$(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
- }
- });
- });
-
-</script>
-
-<div>
-<div id="plotBar" class="spalte"
- style="height: 300px; width: 350px;"></div>
-<div id="plotPie" class="spalte"
- style="height: 300px; width: 350px;"></div>
-</div>
-
-<!-- no events -->
-<div id="noEventsDialog" style="display: none">
-<p>There are no events in this pool to plot a statistic.</p>
-</div>
diff --git a/application/views/scripts/statistic/index.phtml b/application/views/scripts/statistic/index.phtml
deleted file mode 100755
index 1303efd..0000000
--- a/application/views/scripts/statistic/index.phtml
+++ /dev/null
@@ -1,4 +0,0 @@
-<h1>Statistic</h1>
-<body>
-<h2>Please choose a statistic</h2>
-</body> \ No newline at end of file
diff --git a/application/views/scripts/statistic/running.phtml b/application/views/scripts/statistic/running.phtml
deleted file mode 100755
index 1ac0a49..0000000
--- a/application/views/scripts/statistic/running.phtml
+++ /dev/null
@@ -1,120 +0,0 @@
-<h1>Statistic - Running</h1>
-
-<link
- rel="stylesheet" type="text/css"
- href="/media/css/jquery.jqplot.min.css" />
-
-<select id="poolselectbox" name="PoolSelectbox"
- onclick="setPoolIDtmp();" onChange="fetchPoolEvents();">
- <option value="default">Please choose a Pool</option>
- <option value="all">All Pools</option>
-</select>
-
-<script>
-
-//fetch all poolevents of the selected #poolselectbox value
-function fetchPoolEvents() {
- poolID = $("#poolselectbox option:selected").val();
- plot();
-}
-
-function setPoolIDtmp() {
- poolIDtmp = $("#poolselectbox option:selected").val();
- }
-
-function plot() {
- poolID = $("#poolselectbox option:selected").val();
- $.get("/statistic/runninglist/poolID/" + poolID, function(data) {
- if(data.dataBar == '0,Event over,0,Event not over' && poolID != 'default') {
- $('#plotBar').empty();
- $('#plotPie').empty();
- $( "#noEventsDialog" ).dialog('open');
- } else if (poolID == 'default') {
- $('#plotBar').empty();
- $('#plotPie').empty();
- } else refreshPlot(data.dataBar, data.dataPie, data.color);
- }, "json");
-}
-
-function refreshPlot(dataBar, dataPie, color) {
- $('#plotBar').empty();
- $.jqplot('plotBar', dataBar, {
- seriesDefaults: {
- //renderer: $.jqplot.PieRenderer,
- renderer:$.jqplot.BarRenderer,
- pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
- shadowAngle: 135,
- rendererOptions: {
- //showDataLabels: true,
- barDirection: 'horizontal',
- varyBarColor : true
- }
- },
- axes: {
- yaxis: {
- renderer: $.jqplot.CategoryAxisRenderer
- }
- },
- seriesColors: color,
- highlighter: { show: false }
- });
- $('#plotPie').empty();
- $.jqplot('plotPie', dataPie,
- {
- seriesDefaults: {
- // Make this a pie chart.
- renderer: jQuery.jqplot.PieRenderer,
- rendererOptions: {
- // Put data labels on the pie slices.
- // By default, labels show the percentage of the slice.
- showDataLabels: true,
- lineLabels: true,
- varyBarColor : true
- }
- },
- seriesColors: color
- //legend: { show:true, location: 'e' }
- });
- }
-
-$(document).ready(function(){
-
- //fetch poollist from pbs database
- $.get("/event/getpoollist/", function(getpoollistresult){
- $("#poolselectbox").append(getpoollistresult);
- poolIDtmp = $("#poolselectbox option:selected").val();
- fetchPoolEvents();
- });
-});
-
-$(function() {
- $( "#noEventsDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: "No Events",
- buttons: {
- "OK": function() {
- $(this).dialog("close");
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- //$(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
- }
- });
- });
-
-</script>
-
-<div>
-<div id="plotBar" class="spalte"
- style="height: 300px; width: 350px;"></div>
-<div id="plotPie" class="spalte"
- style="height: 300px; width: 350px;"></div>
-</div>
-
-<!-- no events -->
-<div id="noEventsDialog" style="display: none">
-<p>There are no events in this pool to plot a statistic.</p>
-</div> \ No newline at end of file
diff --git a/application/views/scripts/statistic/success.phtml b/application/views/scripts/statistic/success.phtml
deleted file mode 100644
index 0d502b6..0000000
--- a/application/views/scripts/statistic/success.phtml
+++ /dev/null
@@ -1,120 +0,0 @@
-<h1>Statistic - Success</h1>
-
-<link
- rel="stylesheet" type="text/css"
- href="/media/css/jquery.jqplot.min.css" />
-
-<select id="poolselectbox" name="PoolSelectbox"
- onclick="setPoolIDtmp();" onChange="fetchPoolEvents();">
- <option value="default">Please choose a Pool</option>
- <option value="all">All Pools</option>
-</select>
-
-<script>
-
-//fetch all poolevents of the selected #poolselectbox value
-function fetchPoolEvents() {
- poolID = $("#poolselectbox option:selected").val();
- plot();
-}
-
-function setPoolIDtmp() {
- poolIDtmp = $("#poolselectbox option:selected").val();
- }
-
-function plot() {
- poolID = $("#poolselectbox option:selected").val();
- $.get("/statistic/successlist/poolID/" + poolID, function(data) {
- if(data.dataBar == '0,Successful,0,Failed' && poolID != 'default') {
- $( "#noEventsDialog" ).dialog('open');
- $('#plotBar').empty();
- $('#plotPie').empty();
- } else if (poolID == 'default') {
- $('#plotBar').empty();
- $('#plotPie').empty();
- } else refreshPlot(data.dataBar, data.dataPie, data.color);
- }, "json");
-}
-
-function refreshPlot(dataBar, dataPie, color) {
- $('#plotBar').empty();
- $.jqplot('plotBar', dataBar, {
- seriesDefaults: {
- //renderer: $.jqplot.PieRenderer,
- renderer:$.jqplot.BarRenderer,
- pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
- shadowAngle: 135,
- rendererOptions: {
- //showDataLabels: true,
- barDirection: 'horizontal',
- varyBarColor : true
- }
- },
- axes: {
- yaxis: {
- renderer: $.jqplot.CategoryAxisRenderer
- }
- },
- seriesColors: color,
- highlighter: { show: false }
- });
- $('#plotPie').empty();
- $.jqplot('plotPie', dataPie,
- {
- seriesDefaults: {
- // Make this a pie chart.
- renderer: jQuery.jqplot.PieRenderer,
- rendererOptions: {
- // Put data labels on the pie slices.
- // By default, labels show the percentage of the slice.
- showDataLabels: true,
- lineLabels: true,
- varyBarColor : true
- }
- },
- seriesColors: color
- //legend: { show:true, location: 'e' }
- });
- }
-
-$(document).ready(function(){
-
- //fetch poollist from pbs database
- $.get("/event/getpoollist/", function(getpoollistresult){
- $("#poolselectbox").append(getpoollistresult);
- poolIDtmp = $("#poolselectbox option:selected").val();
- fetchPoolEvents();
- });
-});
-
-$(function() {
- $( "#noEventsDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: "No Events",
- buttons: {
- "OK": function() {
- $(this).dialog("close");
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- //$(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
- }
- });
- });
-
-</script>
-
-<div>
-<div id="plotBar" class="spalte"
- style="height: 300px; width: 350px;"></div>
-<div id="plotPie" class="spalte"
- style="height: 300px; width: 350px;"></div>
-</div>
-
-<!-- no events -->
-<div id="noEventsDialog" style="display: none">
-<p>There are no events in this pool to plot a statistic.</p>
-</div> \ No newline at end of file
diff --git a/application/views/scripts/statistic/type.phtml b/application/views/scripts/statistic/type.phtml
deleted file mode 100644
index 6e72a8c..0000000
--- a/application/views/scripts/statistic/type.phtml
+++ /dev/null
@@ -1,120 +0,0 @@
-<h1>Statistic - Types</h1>
-
-<link
- rel="stylesheet" type="text/css"
- href="/media/css/jquery.jqplot.min.css" />
-
-<select id="poolselectbox" name="PoolSelectbox"
- onclick="setPoolIDtmp();" onChange="fetchPoolEvents();">
- <option value="default">Please choose a Pool</option>
- <option value="all">All Pools</option>
-</select>
-
-<script>
-
-//fetch all poolevents of the selected #poolselectbox value
-function fetchPoolEvents() {
- poolID = $("#poolselectbox option:selected").val();
- plot();
-}
-
-function setPoolIDtmp() {
- poolIDtmp = $("#poolselectbox option:selected").val();
- }
-
-function plot() {
- poolID = $("#poolselectbox option:selected").val();
- $.get("/statistic/typelist/poolID/" + poolID, function(data) {
- if(data.dataBar == '0,other,0,repeat,0,immediate' && poolID != 'default') {
- $('#plotBar').empty();
- $('#plotPie').empty();
- $( "#noEventsDialog" ).dialog('open');
- } else if (poolID == 'default') {
- $('#plotBar').empty();
- $('#plotPie').empty();
- } else refreshPlot(data.dataBar, data.dataPie, data.color);
- }, "json");
-}
-
-function refreshPlot(dataBar, dataPie, color) {
- $('#plotBar').empty();
- $.jqplot('plotBar', dataBar, {
- seriesDefaults: {
- //renderer: $.jqplot.PieRenderer,
- renderer:$.jqplot.BarRenderer,
- pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
- shadowAngle: 135,
- rendererOptions: {
- //showDataLabels: true,
- barDirection: 'horizontal',
- varyBarColor : true
- }
- },
- axes: {
- yaxis: {
- renderer: $.jqplot.CategoryAxisRenderer
- }
- },
- seriesColors: color,
- highlighter: { show: false }
- });
- $('#plotPie').empty();
- $.jqplot('plotPie', dataPie,
- {
- seriesDefaults: {
- // Make this a pie chart.
- renderer: jQuery.jqplot.PieRenderer,
- rendererOptions: {
- // Put data labels on the pie slices.
- // By default, labels show the percentage of the slice.
- showDataLabels: true,
- lineLabels: true,
- varyBarColor : true
- }
- },
- seriesColors: color
- //legend: { show:true, location: 'e' }
- });
- }
-
-$(document).ready(function(){
-
- //fetch poollist from pbs database
- $.get("/event/getpoollist/", function(getpoollistresult){
- $("#poolselectbox").append(getpoollistresult);
- poolIDtmp = $("#poolselectbox option:selected").val();
- fetchPoolEvents();
- });
-});
-
-$(function() {
- $( "#noEventsDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: "No Events",
- buttons: {
- "OK": function() {
- $(this).dialog("close");
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- //$(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
- }
- });
- });
-
-</script>
-
-<div>
-<div id="plotBar" class="spalte"
- style="height: 300px; width: 350px;"></div>
-<div id="plotPie" class="spalte"
- style="height: 300px; width: 350px;"></div>
-</div>
-
-<!-- no events -->
-<div id="noEventsDialog" style="display: none">
-<p>There are no events in this pool to plot a statistic.</p>
-</div> \ No newline at end of file
diff --git a/public/media/js/script.js b/public/media/js/script.js
index ab57acf..74a82ce 100755
--- a/public/media/js/script.js
+++ b/public/media/js/script.js
@@ -43,13 +43,17 @@ $(document)
mypath = '/' + path[1] + '/' + path[2] + '/owndetails';
} else if (path[1] == 'event') {
mypath = '/event';
- } else if (path[1] == 'statistic') {
+ } else if (path[1] == 'statistics') {
if(path[2] == 'category') {
- mypath = '/statistic/category';
+ mypath = '/statistics/category';
} else if(path[2] == 'running') {
- mypath = '/statistic/running';
+ mypath = '/statistics/running';
+ } else if(path[2] == 'success') {
+ mypath = '/statistics/success';
+ } else if(path[2] == 'type') {
+ mypath = '/statistics/type';
} else {
- mypath = '/statistic';
+ mypath = '/statistics';
}
setElementVisible('statisticsTree');
} else {