Skip to content

Commit

Permalink
rename first dimension column for flattened reports to label
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Jan 31, 2018
1 parent 6815158 commit bae9e0a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/CoreVisualizations/Visualizations/HtmlTable.php
Expand Up @@ -99,6 +99,11 @@ public function beforeGenericFiltersAreAppliedToLoadedDataTable()
}
});

# replace original label column with first dimension
$firstDimension = array_shift($dimensions);
$this->dataTable->filter('ColumnDelete', array('label'));
$this->dataTable->filter('ReplaceColumnNames', array(array($firstDimension => 'label')));

if (empty($this->config->columns_to_display)) {
$columns = $this->dataTable->getColumns();
$hasNbVisits = in_array('nb_visits', $columns);
Expand All @@ -112,6 +117,7 @@ public function beforeGenericFiltersAreAppliedToLoadedDataTable()
unset($this->config->columns_to_display[$label]);
}
$this->config->columns_to_display = array_merge($dimensions, $this->config->columns_to_display);
array_unshift($this->config->columns_to_display, 'label');
}
}

Expand Down

0 comments on commit bae9e0a

Please sign in to comment.