summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Wagner2011-11-16 16:26:13 +0100
committerSebastian Wagner2011-11-16 16:26:13 +0100
commit0447f20f91dc54d7989bea2d303b15de4ebc88b2 (patch)
treee7840a4113346fd0d326b45580ab2075596ed8c1
parentmore clean up (diff)
downloadpoolctrl-0447f20f91dc54d7989bea2d303b15de4ebc88b2.tar.gz
poolctrl-0447f20f91dc54d7989bea2d303b15de4ebc88b2.tar.xz
poolctrl-0447f20f91dc54d7989bea2d303b15de4ebc88b2.zip
some js outsourced
-rwxr-xr-xapplication/controllers/StatisticsController.php8
-rwxr-xr-xapplication/views/scripts/statistics/category.phtml95
-rwxr-xr-xapplication/views/scripts/statistics/running.phtml93
-rwxr-xr-xapplication/views/scripts/statistics/success.phtml93
-rwxr-xr-xapplication/views/scripts/statistics/type.phtml93
5 files changed, 16 insertions, 366 deletions
diff --git a/application/controllers/StatisticsController.php b/application/controllers/StatisticsController.php
index b98acf4..66141c8 100755
--- a/application/controllers/StatisticsController.php
+++ b/application/controllers/StatisticsController.php
@@ -56,7 +56,7 @@ class StatisticsController extends Zend_Controller_Action
} else {
$eventList = $this->eventMapper->findBy(array("pbs_membershipID", $this->userIDsNamespace['membershipID']));
}
-
+ // 1 = barPlot 2 = piePlot
$ret['dataBar'] = $this->eventMapper->getCategoryPlotdata($poolID, 1);
$ret['dataPie'] = $this->eventMapper->getCategoryPlotdata($poolID, 2);
$ret['color'] = $this->eventcategoryMapper->getCategoryColor($poolID, null);
@@ -80,7 +80,7 @@ class StatisticsController extends Zend_Controller_Action
} else {
$eventList = $this->eventMapper->findBy(array("pbs_membershipID", $this->userIDsNamespace['membershipID']));
}
-
+ // 1 = barPlot 2 = piePlot
$ret['dataBar'] = $this->eventMapper->getRunningPlotdata($poolID, 1);
$ret['dataPie'] = $this->eventMapper->getRunningPlotdata($poolID, 2);
@@ -103,7 +103,7 @@ class StatisticsController extends Zend_Controller_Action
} else {
$eventList = $this->eventMapper->findBy(array("pbs_membershipID", $this->userIDsNamespace['membershipID']));
}
-
+ // 1 = barPlot 2 = piePlot
$ret['dataBar'] = $this->eventreportMapper->getSuccessPlotdata($poolID, 1);
$ret['dataPieS'] = $this->eventreportMapper->getSuccessPlotdata($poolID, 2);
@@ -126,7 +126,7 @@ class StatisticsController extends Zend_Controller_Action
} else {
$eventList = $this->eventMapper->findBy(array("pbs_membershipID", $this->userIDsNamespace['membershipID']));
}
-
+ // 1 = barPlot 2 = piePlot
$ret['dataBar'] = $this->eventMapper->getTypePlotdata($poolID, 1);
$ret['dataPie'] = $this->eventMapper->getTypePlotdata($poolID, 2);
diff --git a/application/views/scripts/statistics/category.phtml b/application/views/scripts/statistics/category.phtml
index db17b63..2f8ed37 100755
--- a/application/views/scripts/statistics/category.phtml
+++ b/application/views/scripts/statistics/category.phtml
@@ -11,98 +11,9 @@
<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("/statistics/categoryplot/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");
-}
-
-function refreshPlot(dataBar, dataPie, color) {
- $('#plotBar').empty();
- $.jqplot('plotBar', dataBar, {
- seriesDefaults: {
- renderer:$.jqplot.BarRenderer,
- pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
- shadowAngle: 135,
- rendererOptions: {
- 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,
- varyBarColor : true
- }
- },
- seriesColors: color
- });
-}
-
-$(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>
+<!-- Add CategoryPlot -->
+<script
+ type="text/javascript" src="/media/js/categoryPlot.js"></script>
<div>
<div id="plotBar" class="spalte"
diff --git a/application/views/scripts/statistics/running.phtml b/application/views/scripts/statistics/running.phtml
index a23628c..2d2688c 100755
--- a/application/views/scripts/statistics/running.phtml
+++ b/application/views/scripts/statistics/running.phtml
@@ -11,96 +11,9 @@
<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("/statistics/runningplot/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);
- }, "json");
-}
-
-function refreshPlot(dataBar, dataPie) {
- $('#plotBar').empty();
- $.jqplot('plotBar', dataBar, {
- seriesDefaults: {
- renderer:$.jqplot.BarRenderer,
- pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
- shadowAngle: 135,
- rendererOptions: {
- barDirection: 'horizontal',
- varyBarColor : true
- }
- },
- axes: {
- yaxis: {
- renderer: $.jqplot.CategoryAxisRenderer
- }
- }
- });
- $('#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
- }
- }
- });
- }
-
-$(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>
+<!-- Add RunningPlot -->
+<script
+ type="text/javascript" src="/media/js/runningPlot.js"></script>
<div>
<div id="plotBar" class="spalte"
diff --git a/application/views/scripts/statistics/success.phtml b/application/views/scripts/statistics/success.phtml
index 5d5c895..c4c204d 100755
--- a/application/views/scripts/statistics/success.phtml
+++ b/application/views/scripts/statistics/success.phtml
@@ -10,96 +10,9 @@
<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("/statistics/successplot/poolID/" + poolID, function(data) {
- if(data.dataBar == '0,Successful,0,Failed' && poolID != 'default') {
- $( "#noEventsDialog" ).dialog('open');
- $('#plotBar').empty();
- $('#plotPieS').empty();
- } else if (poolID == 'default') {
- $('#plotBar').empty();
- $('#plotPieS').empty();
- } else refreshPlot(data.dataBar, data.dataPieS, data.dataPieT);
- }, "json");
-}
-
-function refreshPlot(dataBar, dataPieS, dataPieT) {
- $('#plotBar').empty();
- $.jqplot('plotBar', dataBar, {
- seriesDefaults: {
- //renderer: $.jqplot.PieRenderer,
- renderer:$.jqplot.BarRenderer,
- pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
- shadowAngle: 135,
- rendererOptions: {
- barDirection: 'horizontal',
- varyBarColor : true
- }
- },
- axes: {
- yaxis: {
- renderer: $.jqplot.CategoryAxisRenderer
- }
- }
- });
- $('#plotPieS').empty();
- $.jqplot('plotPieS', dataPieS,
- {
- 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,
- varyBarColor : true
- }
- }
- });
- }
-
-$(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>
+<!-- Add SuccessPlot -->
+<script
+ type="text/javascript" src="/media/js/successPlot.js"></script>
<div>
<div id="plotBar" class="spalte" style="height: 300px; width: 350px;"></div>
diff --git a/application/views/scripts/statistics/type.phtml b/application/views/scripts/statistics/type.phtml
index 6872436..b4082e6 100755
--- a/application/views/scripts/statistics/type.phtml
+++ b/application/views/scripts/statistics/type.phtml
@@ -11,96 +11,9 @@
<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("/statistics/typeplot/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);
- }, "json");
-}
-
-function refreshPlot(dataBar, dataPie) {
- $('#plotBar').empty();
- $.jqplot('plotBar', dataBar, {
- seriesDefaults: {
- renderer:$.jqplot.BarRenderer,
- pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
- shadowAngle: 135,
- rendererOptions: {
- barDirection: 'horizontal',
- varyBarColor : true
- }
- },
- axes: {
- yaxis: {
- renderer: $.jqplot.CategoryAxisRenderer
- }
- }
- });
- $('#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
- }
- }
- });
- }
-
-$(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>
+<!-- Add TypePlot -->
+<script
+ type="text/javascript" src="/media/js/typePlot.js"></script>
<div>
<div id="plotBar" class="spalte"