/**
  *
  * @param string $name
  * @return string
  */
 public static function getBuList()
 {
     // Initializing connection
     $di = Di::getDefault();
     $dbconn = $di->get('db_centreon');
     #$router = $di->get('router');
     $buList = BusinessActivity::getList("ba_id,name", -1, 0, null, "ASC", array('ba_type_id' => 1));
     return $buList;
 }
 /**
  * Display side bar information of a business activity
  *
  * @method get
  * @route /business-activity/snapshotslide/[i:id]
  */
 public function snapshotslideAction()
 {
     $params = $this->getParams();
     $data['configurationData'] = BusinessActivity::get($params['id'], array('ba_id', 'name', 'activate', 'icon_id', 'id_reporting_period'));
     $data['configurationData']['icon'] = BusinessActivityRepository::getIconImage($data['configurationData']['name']);
     $data['configurationData']['reporting_period'] = !empty($data['configurationData']['id_reporting_period']) ? Timeperiod::get($data['configurationData']['id_reporting_period'], 'tp_name') : "";
     $data['configurationData']['activate'] = YesNoDefault::toString($data['configurationData']['activate']);
     $data['realtimeData'] = BusinessActivityRealtime::get($params['id']);
     $informations = array_merge($data['configurationData'], $data['realtimeData']);
     $edit_url = $this->router->getPathFor("/centreon-bam/businessactivity/" . $params['id']);
     $this->router->response()->json(array('informations' => $informations, 'edit_url' => $edit_url, 'success' => true));
 }
 public function testGetColumns()
 {
     $this->assertEquals(array("ba_id", "name", "description", "level_w", "level_c", "sla_type", "sla_warning", "sla_critical", "id_notification_period", "id_check_period", "id_reporting_period", "notification_interval", "notification_options", "notifications_enabled", "max_check_attempts", "normal_check_interval", "retry_check_interval", "current_level", "calculate", "downtime", "acknowledged", "dependency_dep_id", "icon_id", "graph_style", "activate", "comment", "organization_id"), BusinessActivity::getColumns());
 }