Ejemplo n.º 1
0
 public function listOrganisationAction()
 {
     $model = new Model_Wep();
     $userModel = new Model_User();
     $activity_model = new Model_ActivityCollection();
     $orgs = $model->listOrganisation('account');
     $org_data = array();
     foreach ($orgs as $organisation) {
         $users = $userModel->getUserCountByAccountId($organisation['id']);
         $organisation['users_count'] = $users[0]['users_count'];
         $activities = $activity_model->getActivitiesCountByAccount($organisation['id']);
         $organisation['activity_count'] = $activities[0]['activity_count'];
         $user = $userModel->getUserByAccountId($organisation['id'], array('role_id' => 1));
         $organisation['user_id'] = $user['user_id'];
         $organisation['email'] = $user['email'];
         $org_data[] = $organisation;
     }
     $this->view->rowSet = $org_data;
 }
Ejemplo n.º 2
0
 public function listOrganisationAction()
 {
     $identity = Zend_Auth::getInstance()->getIdentity();
     $userId = $identity->user_id;
     $userModel = new Model_User();
     $groupModel = new User_Model_DbTable_Group();
     $userGroupModel = new User_Model_DbTable_UserGroup();
     $activityModel = new Model_ActivityCollection();
     $group = $userGroupModel->getRowByUserId($userId);
     $orgs = $groupModel->getAllOrganisationsByGroupId($group['group_id']);
     $org_data = array();
     foreach ($orgs as $organisation) {
         $users = $userModel->getUserCountByAccountId($organisation['account_id']);
         $organisation['users_count'] = $users[0]['users_count'];
         $activities = $activityModel->getActivitiesCountByAccount($organisation['account_id']);
         $organisation['activity_count'] = $activities[0]['activity_count'];
         $user = $userModel->getUserByAccountId($organisation['account_id'], array('role_id' => 1));
         $organisation['user_id'] = $user['user_id'];
         $org_data[] = $organisation;
     }
     $this->view->groupRow = $group;
     $this->view->rowSet = $org_data;
 }