Пример #1
0
 /**
  * This is report index action
  */
 public function actionIndex()
 {
     $this->layout = false;
     $infoType = Yii::app()->request->getParam('type', Info::TYPE_BUG);
     $productId = Yii::app()->request->getParam('product_id', Yii::app()->user->getState('product'));
     $color = 'blue';
     $selected = Yii::app()->request->getParam('selected', array());
     if (Info::TYPE_CASE == $infoType) {
         $color = 'green';
     } else {
         if (Info::TYPE_RESULT == $infoType) {
             $color = 'orange';
         }
     }
     $reportService = new ReportService();
     $reports = $reportService->getReports($infoType, $productId, $selected);
     $this->render('index', array('infoType' => $infoType, 'productId' => $productId, 'color' => $color, 'reports' => $reports, 'selected' => $selected));
 }