public function indexAction() { $acUser = new Zend_Session_Namespace(); if (!$this->getRequest()->isXmlHttpRequest()) { $this->_helper->layout()->enableLayout(); } else { $this->_helper->layout()->disableLayout(); } $pObj = new Application_Model_DbTable_Projects(); $clientObj = new Application_Model_DbTable_ProjectClients(); $acUser->level == 'admin' ? $res = $pObj->getProjects() : ($res = $clientObj->getClientProject($acUser->userID)); $this->view->projectList = $res; $this->view->noAJpre = true; }
public function projectsAction() { $this->view->noAJmanpro = true; $task = $this->_getParam("task"); $targetActionID = $this->_getParam("t"); switch ($task) { case "attach": $this->view->dis = "attach"; $cu = new Application_Model_DbTable_Users(); $projectA = new Application_Model_DbTable_Projects(); $pInfo = $projectA->getById($targetActionID); $cRes = $cu->getClients(); $this->view->clients = $cRes; $this->view->projectID = $targetActionID; $this->view->projectName = $pInfo->projectName; break; case "new": $this->view->dis = "new"; break; case "del": $this->view->dis = "del"; $t = $this->_request->getPost('target-id'); if ($this->getRequest()->isPost() && !empty($t)) { $this->_helper->layout()->disableLayout(); $p = new Application_Model_DbTable_Projects(); $p->delete("id = " . $t); } break; default: $this->view->dis = "list"; $pObj = new Application_Model_DbTable_Projects(); $res = $pObj->getProjects(); $this->view->projectList = $res; } }