summaryrefslogtreecommitdiffstats
path: root/application/controllers/StatisticsController.php
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-07 15:10:33 +0200
committerSebastian Wagner2011-10-07 15:10:33 +0200
commit3690f240e3d7926d561f660ca576056f429f3b15 (patch)
treecc279d817d20d2e535ca7c8f05bbaf3670b6337f /application/controllers/StatisticsController.php
parentrename statistic (diff)
downloadpoolctrl-3690f240e3d7926d561f660ca576056f429f3b15.tar.gz
poolctrl-3690f240e3d7926d561f660ca576056f429f3b15.tar.xz
poolctrl-3690f240e3d7926d561f660ca576056f429f3b15.zip
rename statistic
Diffstat (limited to 'application/controllers/StatisticsController.php')
-rwxr-xr-xapplication/controllers/StatisticsController.php144
1 files changed, 144 insertions, 0 deletions
diff --git a/application/controllers/StatisticsController.php b/application/controllers/StatisticsController.php
new file mode 100755
index 0000000..93e63a7
--- /dev/null
+++ b/application/controllers/StatisticsController.php
@@ -0,0 +1,144 @@
+<?php
+class StatisticsController 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