list/contactgroups: Ensure dashboard compliance

refs #7876
This commit is contained in:
Johannes Meyer 2015-04-17 16:14:13 +02:00
parent d725b2feb7
commit b9249dac4e
2 changed files with 21 additions and 9 deletions

View File

@ -424,11 +424,13 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab( $this->addTitleTab(
'contactgroups', 'contactgroups',
$this->translate('Contact Groups'), $this->translate('Contact Groups'),
$this->translate('List contact groups') $this->translate('List contact groups')
); );
$query = $this->backend->select()->from('contactgroup', array( $query = $this->backend->select()->from('contactgroup', array(
'contactgroup_name', 'contactgroup_name',
'contactgroup_alias', 'contactgroup_alias',
@ -436,7 +438,7 @@ class Monitoring_ListController extends Controller
'contact_alias', 'contact_alias',
'contact_email', 'contact_email',
'contact_pager', 'contact_pager',
))->order('contactgroup_alias'); ));
$this->filterQuery($query); $this->filterQuery($query);
// Fetch and prepare all contact groups: // Fetch and prepare all contact groups:
@ -453,6 +455,11 @@ class Monitoring_ListController extends Controller
} }
// TODO: Find a better naming // TODO: Find a better naming
$this->view->groupData = $groupData; $this->view->groupData = $groupData;
$this->setupSortControl(array(
'contactgroup_name' => $this->translate('Contactgroup Name'),
'contactgroup_alias' => $this->translate('Contactgroup Alias')
));
} }
public function commentsAction() public function commentsAction()

View File

@ -1,17 +1,22 @@
<?php if (!$this->compact): ?> <?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<div class="boxview" data-base-target="_next">
<?php <?php
if (count($groupData) === 0) {
echo mt('monitoring', 'No contacts matching the filter');
}
foreach ($groupData as $groupName => $groupInfo): ?> if (count($groupData) === 0) {
echo $this->translate('No contactgroups found matching the filter') . '</div>';
return;
}
?>
<div class="boxview" data-base-target="_next">
<?php foreach ($groupData as $groupName => $groupInfo): ?>
<div class="box contactgroup"> <div class="box contactgroup">
<h2><?= $groupInfo['alias']; ?></h2> <h2><?= $groupInfo['alias']; ?></h2>
<?php if ($groupInfo['alias'] !== $groupName): ?> <?php if ($groupInfo['alias'] !== $groupName): ?>