/**
  * Show project overview page
  *
  * @param void
  * @return null
  */
 function index()
 {
     if ($this->active_project->isNew()) {
         $this->httpError(HTTP_ERR_NOT_FOUND);
     }
     // if
     if ($this->request->isApiCall()) {
         $this->serveData($this->active_project, 'project', array('describe_leader' => true, 'describe_company' => true, 'describe_group' => true, 'describe_permissions' => true, 'describe_icon' => true));
     } else {
         //        $options = $this->active_project->getOptions($this->logged_user);
         //        if(is_foreachable($options)) {
         //          $this->wireframe->addPageAction(lang('Options'), $this->active_project->getOverviewUrl(), $options, null, 255);
         //        } // if
         $this->wireframe->addRssFeed(lang(':project project', array('project' => $this->active_project->getName())) . ' - ' . lang('Recent activities'), assemble_url('project_rss', array('project_id' => $this->active_project->getId(), 'token' => $this->logged_user->getToken(true))), FEED_RSS);
         $task_types = get_completable_project_object_types();
         $day_types = get_day_project_object_types();
         $home_sidebars = array();
         event_trigger('on_project_overview_sidebars', array(&$home_sidebars, &$this->active_project, &$this->logged_user));
         $this->smarty->assign(array('project_group' => $this->active_project->getGroup(), 'project_company' => $this->active_project->getCompany(), 'late_and_today' => ProjectObjects::findLateAndToday($this->logged_user, $this->active_project, $day_types), 'upcoming_objects' => ProjectObjects::findUpcoming($this->logged_user, $this->active_project, $day_types), 'grouped_activities' => group_by_date(ActivityLogs::findProjectActivitiesByUser($this->active_project, $this->logged_user, 20), $this->logged_user), 'home_sidebars' => $home_sidebars));
         $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);
         mysql_select_db(DB_NAME);
         $query = "select count(*) as count from healingcrystals_project_objects \n\t\t\t\t where project_id='" . $this->active_project->getId() . "' and type='Milestone' and completed_on is null";
         $result = mysql_query($query);
         $info = mysql_fetch_assoc($result);
         $milestones_count = $info['count'];
         $query = "select count(*) as count from healingcrystals_project_objects \n\t\t\t\t where project_id='" . $this->active_project->getId() . "' and type='Ticket' and completed_on is null";
         $result = mysql_query($query);
         $info = mysql_fetch_assoc($result);
         $tickets_count = $info['count'];
         $query = "select count(*) as count from healingcrystals_project_objects \n\t\t\t\t where project_id='" . $this->active_project->getId() . "' and type='Page' and completed_on is null";
         $result = mysql_query($query);
         $info = mysql_fetch_assoc($result);
         $pages_count = $info['count'];
         $query = "select count(*) as count from healingcrystals_project_objects \n\t\t\t\t where project_id='" . $this->active_project->getId() . "' and type='Task' and completed_on is null";
         $result = mysql_query($query);
         $info = mysql_fetch_assoc($result);
         $tasks_count = $info['count'];
         $query = "select count(*) as count from healingcrystals_project_objects \n\t\t\t\t where project_id='" . $this->active_project->getId() . "' and type='File' and completed_on is null";
         $result = mysql_query($query);
         $info = mysql_fetch_assoc($result);
         $files_count = $info['count'];
         $query = "select count(*) as count from healingcrystals_project_objects \n\t\t\t\t where project_id='" . $this->active_project->getId() . "' and type='Discussion' and completed_on is null";
         $result = mysql_query($query);
         $info = mysql_fetch_assoc($result);
         $discussions_count = $info['count'];
         $query = "select count(*) as count from healingcrystals_project_objects \n\t\t\t\t where project_id='" . $this->active_project->getId() . "' and type='Checklist' and completed_on is null";
         $result = mysql_query($query);
         $info = mysql_fetch_assoc($result);
         $checklists_count = $info['count'];
         mysql_close($link);
         $this->smarty->assign(array('milestones_count' => $milestones_count, 'tickets_count' => $tickets_count, 'pages_count' => $pages_count, 'tasks_count' => $tasks_count, 'files_count' => $files_count, 'discussions_count' => $discussions_count, 'checklists_count' => $checklists_count));
     }
     // if
 }
 /**
  * Display project info
  *
  */
 function index()
 {
     $this->addBreadcrumb(lang('Overview'));
     $this->smarty->assign(array("page_back_url" => assemble_url('mobile_access_projects'), "project_leader" => $this->active_project->getLeader(), "project_group" => $this->active_project->getGroup(), "project_company" => $this->active_project->getCompany(), "late_and_today" => ProjectObjects::findLateAndToday($this->logged_user, $this->active_project, get_day_project_object_types()), "recent_activities" => ActivityLogs::findProjectActivitiesByUser($this->active_project, $this->logged_user, 15), 'upcoming_objects' => ProjectObjects::findUpcoming($this->logged_user, $this->active_project, get_day_project_object_types())));
 }