From 3690f240e3d7926d561f660ca576056f429f3b15 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 7 Oct 2011 15:10:33 +0200 Subject: rename statistic --- application/controllers/StatisticsController.php | 144 +++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100755 application/controllers/StatisticsController.php (limited to 'application/controllers/StatisticsController.php') 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 @@ +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 -- cgit v1.2.3-55-g7522