/**
  * Лента комментов
  */
 public function executeIndex(sfWebRequest $request)
 {
     $this->executeNew();
     $this->pager = new sfDoctrinePager('Comment', sfConfig::get('app_comments_per_page', 10));
     $this->pager->setQuery(CommentTable::getInstance()->queryByPoint($this->point->getId()));
     $this->pager->setPage($request->getParameter('page'));
     $this->pager->init();
 }
Exemple #2
0
 /**
  * @param sfWebRequest $request
  */
 public function executeIndex(sfWebRequest $request)
 {
     $decision_id = $request->getParameter('decision_id', false);
     $this->decision = DecisionTable::getInstance()->getDecisionForUser($this->getUser()->getGuardUser(), $decision_id);
     $this->forward404Unless($this->decision);
     $this->forward404Unless($this->getUser()->verifyLightAccess($this->getContext()));
     $this->criteriaAnalyze = new CriteriaAnalyze();
     $this->criteriaAnalyze->setDecisionId($decision_id);
     if ($this->decision->save_graph_weight) {
         $this->criteriaAnalyze->loadData();
     } else {
         $this->criteriaAnalyze->load();
     }
     $this->logicalFilter = new LogicalFilterView();
     $this->logicalFilter->setDecisionId($decision_id);
     $this->logicalFilter->load();
     $this->roleFilter = new RoleFilterView();
     $this->roleFilter->setDecisionId($decision_id);
     $this->roleFilter->load();
     $this->statusFilter = new StatusFilterView();
     $this->statusFilter->setDecisionId($decision_id);
     $this->statusFilter->load();
     $this->tagFilter = new TagFilterView();
     $this->tagFilter->setDecisionId($decision_id);
     $this->tagFilter->load();
     $this->stackedBarChart = new StackedBarChart();
     $this->stackedBarChart->setDecisionId($decision_id);
     $this->stackedBarChart->setCriteriaValues($this->criteriaAnalyze->getCriteriaValues());
     $this->stackedBarChart->setRoleFilterData($this->roleFilter->getData());
     $this->stackedBarChart->setStatusFilterData($this->statusFilter->getData());
     $this->stackedBarChart->setTagFilterData($this->tagFilter->getDataForSQL());
     $this->stackedBarChart->setFilteredAlternativesIds($this->logicalFilter->getFilteredAlternativesIds());
     $this->stackedBarChart->load();
     $this->radarChart = new RadarChart();
     $this->radarChart->setData($this->stackedBarChart->getData());
     $this->radarChart->setAlternativeNames($this->stackedBarChart->getAlternativesNames());
     $this->radarChart->setCriteriaNames($this->stackedBarChart->getCriteriaNames());
     $this->radarChart->setAlternativesLabel($this->decision->getAlternativePluralAlias());
     $this->pointChart = new PointChart();
     $this->pointChart->setDecisionId($decision_id);
     $this->pointChart->setRoleFilterData($this->roleFilter->getData());
     $this->pointChart->setStatusFilterData($this->statusFilter->getData());
     $this->pointChart->setTagFilterData($this->tagFilter->getDataForSQL());
     $this->pointChart->setFilteredAlternativesIds($this->logicalFilter->getFilteredAlternativesIds());
     $this->pointChart->load();
     $this->pointChart->setTotalBenefit($this->stackedBarChart->getTotalBenefit());
     $this->costAnalyze = new CostAnalyze();
     $this->costAnalyze->setDecisionId($decision_id);
     $this->costAnalyze->setSortedAlternativeIds($this->stackedBarChart->getSortedAlternativeIds());
     $this->costAnalyze->setRoleFilterData($this->roleFilter->getData());
     $this->costAnalyze->setStatusFilterData($this->statusFilter->getData());
     $this->costAnalyze->setTagFilterData($this->tagFilter->getDataForSQL());
     $this->costAnalyze->setCumulativeData($this->stackedBarChart->getCumulativeData());
     $this->costAnalyze->setFilteredAlternativesIds($this->logicalFilter->getFilteredAlternativesIds());
     $this->costAnalyze->load();
     $this->cumulativeChart = new CumulativeGainChart();
     $this->cumulativeChart->setDecisionId($decision_id);
     $this->cumulativeChart->setSortedAlternativeIds($this->stackedBarChart->getSortedAlternativeIds());
     $this->cumulativeChart->setMeasurement($this->stackedBarChart->getCumulativeData());
     $this->cumulativeChart->setCostData($this->costAnalyze->getData());
     $this->cumulativeChart->setAlternativeNames($this->costAnalyze->getAlternativeNames());
     $this->cumulativeChart->setCriterionNames($this->costAnalyze->getCriteria());
     $this->cumulativeChart->load();
     $this->bubbleChart = new BubbleChart();
     $this->bubbleChart->setDecisionId($decision_id);
     $this->bubbleChart->setRoleFilterData($this->roleFilter->getData());
     $this->bubbleChart->setStatusFilterData($this->statusFilter->getData());
     $this->bubbleChart->setTagFilterData($this->tagFilter->getDataForSQL());
     $this->bubbleChart->setFilteredAlternativesIds($this->logicalFilter->getFilteredAlternativesIds());
     $this->bubbleChart->setTotalBenefit($this->stackedBarChart->getTotalBenefit());
     $this->bubbleChart->load();
     $this->releases = ProjectReleaseTable::getInstance()->getList($decision_id);
     $this->comments = CommentTable::getInstance()->getList($decision_id);
 }
 public function load()
 {
     $this->criteria = Doctrine::getTable('Criterion')->getPlannedForPrioritization($this->role->id);
     $this->decision = Doctrine_Query::create()->from('Decision d')->where('d.Roles.id = ?', $this->role->id)->fetchOne();
     $this->comments = CommentTable::getInstance()->getArrayByCriteria($this->criteria->getPrimaryKeys());
 }
 public function load()
 {
     $this->alternatives = Doctrine::getTable('Alternative')->getPlannedForMeasurement($this->role->id, $this->criterion_id);
     $this->criterion = Doctrine::getTable('Criterion')->find($this->criterion_id);
     $this->comments = CommentTable::getInstance()->getArrayForAlternatives($this->criterion_id, $this->alternatives->getPrimaryKeys(), $this->role);
 }
 /**
  * Последние комментарии
  */
 public function executeLastComments()
 {
     $comments = CommentTable::getInstance()->queryFeed()->limit(sfConfig::get('app_feeds_last_comments_count', 30))->execute(array(), Doctrine::HYDRATE_ARRAY);
     $this->buildFeed($comments, array('title' => 'Последние комментарии | НеСкучайк!', 'permalink_url' => 'comment', 'permalink_param_name' => 'id', 'permalink_param_column' => 'point_id'));
 }