getDefaultTypeViewDataTable() public method

Returns the id of the default visualization for this report. Eg 'table' or 'pie'. Defaults to the HTML table.
Esempio n. 1
0
 /**
  * Creates a widget based on the specified report in {@link construct()}.
  *
  * It will automatically use the report's name, categoryId, subcategoryId (if specified),
  * defaultViewDataTable, module, action, order and parameters in order to create the widget.
  *
  * @return ReportWidgetConfig
  */
 public function createWidget()
 {
     $widget = new ReportWidgetConfig();
     $widget->setName($this->report->getName());
     $widget->setCategoryId($this->report->getCategoryId());
     if ($this->report->getDefaultTypeViewDataTable()) {
         $widget->setDefaultViewDataTable($this->report->getDefaultTypeViewDataTable());
     }
     if ($this->report->getSubcategoryId()) {
         $widget->setSubcategoryId($this->report->getSubcategoryId());
     }
     $widget->setModule($this->report->getModule());
     $widget->setAction($this->report->getAction());
     $orderThatListsReportsAtTheEndOfEachCategory = 100 + $this->report->getOrder();
     $widget->setOrder($orderThatListsReportsAtTheEndOfEachCategory);
     $parameters = $this->report->getParameters();
     if (!empty($parameters)) {
         $widget->setParameters($parameters);
     }
     return $widget;
 }
Esempio n. 2
0
 /**
  * Returns the default viewDataTable ID to use when determining which visualization to use.
  *
  * @param Report $report
  * @param string $apiAction
  *
  * @return bool|string
  */
 private static function getDefaultViewTypeForReport($report, $apiAction)
 {
     if (!empty($report) && $report->isEnabled()) {
         return $report->getDefaultTypeViewDataTable();
     }
     $defaultViewTypes = self::getDefaultTypeViewDataTable();
     return isset($defaultViewTypes[$apiAction]) ? $defaultViewTypes[$apiAction] : false;
 }
Esempio n. 3
0
 /**
  * Returns the default viewDataTable ID to use when determining which visualization to use.
  *
  * @param Report $report
  * @param string $apiAction
  *
  * @return bool|string
  */
 private static function getDefaultViewTypeForReport($report, $apiAction)
 {
     if (!empty($report) && $report->isEnabled()) {
         return $report->getDefaultTypeViewDataTable();
     }
     return false;
 }
Esempio n. 4
0
 /**
  * @param $controllerAction
  * @param $params
  * @return ViewDataTable
  * @throws \Exception
  */
 private static function makeTemporaryViewDataTableInstance($controllerAction, $params)
 {
     $report = new Report();
     $viewDataTableType = isset($params['viewDataTable']) ? $params['viewDataTable'] : $report->getDefaultTypeViewDataTable();
     $apiAction = $controllerAction;
     $loadViewDataTableParametersForUser = false;
     $viewDataTable = Factory::build($viewDataTableType, $apiAction, $controllerAction, $forceDefault = false, $loadViewDataTableParametersForUser);
     return $viewDataTable;
 }