Skip to content

Commit d91764a

Browse files
stonebuzzcedric-anne
authored andcommitted
feat(Rule): display ranking
1 parent f225394 commit d91764a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/Rule.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,6 +1955,8 @@ final public function getDataForList(bool $display_criteria, bool $display_actio
19551955
$active ? __s('Rule is active') : __s('Rule is inactive'),
19561956
);
19571957

1958+
$data['rank'] = '<span class="badge">' . $this->fields["ranking"] . '</span>';
1959+
19581960
if ($display_entity) {
19591961
$entname = htmlescape(Dropdown::getDropdownName('glpi_entities', $this->fields['entities_id']));
19601962
if ($this->maybeRecursive() && $this->fields['is_recursive']) {

src/RuleCollection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ public function showListRules($target, $options = [])
553553
if ($display_entities) {
554554
$columns['entities_id'] = Entity::getTypeName(1);
555555
}
556+
$columns['rank'] = __('Position');
556557
$columns['sort'] = '';
557558

558559
TemplateRenderer::getInstance()->display('components/datatable.html.twig', [
@@ -566,6 +567,7 @@ public function showListRules($target, $options = [])
566567
'super_header' => $this->getTitle(),
567568
'columns' => $columns,
568569
'formatters' => [
570+
'rank' => 'raw_html',
569571
'name' => 'raw_html',
570572
'criteria' => 'raw_html',
571573
'actions' => 'raw_html',

0 commit comments

Comments
 (0)