public function showByTeamAction()
 {
     if ($this->getRequest()->getParam('download', false)) {
         $this->getResponse()->setHeader('Content-disposition', 'attachment; filename=json.txt');
     }
     $inputFilter = $this->_helper->FilterLoader();
     $params = Surfnet_Search_Parameters::create()->setLimit($inputFilter->results)->setOffset($inputFilter->startIndex)->setSortByField($inputFilter->sort)->setSortDirection($inputFilter->dir);
     $service = new Portal_Service_Tab();
     $results = $service->searchTeams($params);
     $this->view->gridConfig = $this->_helper->gridSetup($inputFilter);
     $this->view->ResultSet = $results->getResults();
     $this->view->startIndex = $results->getParameters()->getOffset();
     $this->view->recordsReturned = $results->getResultCount();
     $this->view->totalRecords = $results->getTotalCount();
 }
 /**
  * Tabs with a team connected to it.
  *
  * @param Integer $timestamp timestamp to determine the month
  *                this KPI covers.
  * @return Integer
  */
 public function getTeamTabs($timestamp)
 {
     /**
      * Teamtabs KPI per month
      * The timestamps are in milliseconds.
      */
     $date = getdate($timestamp);
     $searchFields = array('year' => $date['year'], 'month' => $date['mon']);
     $params = Surfnet_Search_Parameters::create()->setSearchParams($searchFields);
     $service = new Portal_Service_Tab();
     $results = $service->searchTeams($params)->getResults();
     return $results[0]['num'];
 }