summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-02 17:13:17 +0200
committerSebastian Wagner2011-10-02 17:13:17 +0200
commite504912258dc813a621fec6a8b3f6e8778221d88 (patch)
tree509f9283b1a73e32af683a337051469b0d9250ad /application/controllers
parentsome changes (diff)
downloadpoolctrl-e504912258dc813a621fec6a8b3f6e8778221d88.tar.gz
poolctrl-e504912258dc813a621fec6a8b3f6e8778221d88.tar.xz
poolctrl-e504912258dc813a621fec6a8b3f6e8778221d88.zip
some changes
Diffstat (limited to 'application/controllers')
-rw-r--r--application/controllers/StatisticController.php46
1 files changed, 21 insertions, 25 deletions
diff --git a/application/controllers/StatisticController.php b/application/controllers/StatisticController.php
index 4def963..7af5dc0 100644
--- a/application/controllers/StatisticController.php
+++ b/application/controllers/StatisticController.php
@@ -5,11 +5,13 @@ class StatisticController extends Zend_Controller_Action
protected $config;
protected $pbs2host;
protected $eventMapper;
+ protected $eventcategoryMapper;
public function init()
{
$this->eventMapper = new Application_Model_EventMapper();
+ $this->eventcategoryMapper = new Application_Model_EventcategoryMapper();
if (Zend_Auth::getInstance()->hasIdentity()) {
$this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
@@ -37,13 +39,13 @@ class StatisticController extends Zend_Controller_Action
$this->view->right = $this->acl->checkRight($rightShortcut);
}
- public function dumpAction() {
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
- $data = $this->_request->getParam("data");
- var_dump($data);
- }
-
+ public function dumpAction() {
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+ $data = $this->_request->getParam("data");
+ var_dump($data);
+ }
+
public function categorylistAction() {
$this->_helper->layout->disableLayout();
@@ -52,30 +54,24 @@ class StatisticController extends Zend_Controller_Action
$userIDsSession = new Zend_Session_Namespace('userIDs');
$userIDsSession->poolID = $poolID;
- if($this->acl->checkRight('eoo')) {
+ /*if($this->acl->checkRight('eoo')) {
$eventList = $this->eventMapper->fetchAll();
} else {
$eventList = $this->eventMapper->findBy(array("pbs_membershipID", $this->userIDsNamespace['membershipID']));
- }
-
- $count = 0;
-
- foreach ($eventList as $event){
+ }*/
- if($event->getPbs_poolID() == $poolID AND $event->getCategory() == $category) {
- $count += 1;
- }
- }
//echo $count;
+ $ret2 = $this->eventMapper->getCategoryCount();
+
$ret = array();
-
- $ret[] = array(3,'Lecture');
- $ret[] = array(2,'Boot');
- $ret[] = array(65,'Shutdown');
- $ret[] = array(20,'Maintenance');
-
- echo json_encode(array($ret));
-
+
+ $ret[] = array(3,'Lecture');
+ $ret[] = array(2,'Boot');
+ $ret[] = array(65,'Shutdown');
+ $ret[] = array(20,'Maintenance');
+
+ echo json_encode($ret2);
+
}
} \ No newline at end of file