ObjectsController: introduce quick search
This commit is contained in:
parent
d7142b307a
commit
33d323286e
|
@ -99,7 +99,59 @@ abstract class ObjectsController extends ActionController
|
|||
|
||||
$this->view->title = $this->translate('Icinga ' . ucfirst($ltype) . 's');
|
||||
$table = $this->loadTable($table)->setConnection($this->db());
|
||||
$this->view->filterEditor = $table->getFilterEditor($this->getRequest());
|
||||
$filterEditor = $table->getFilterEditor($this->getRequest());
|
||||
$filter = $filterEditor->getFilter();
|
||||
|
||||
if ($filter->isEmpty()) {
|
||||
|
||||
if ($this->params->get('modifyFilter')) {
|
||||
$this->view->addLink .= ' ' . $this->view->qlink(
|
||||
$this->translate('Show unfiltered'),
|
||||
$this->getRequest()->getUrl()->setParams(array()),
|
||||
null,
|
||||
array(
|
||||
'class' => 'icon-cancel',
|
||||
'data-base-target' => '_self',
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$this->view->addLink .= ' ' . $this->view->qlink(
|
||||
$this->translate('Filter'),
|
||||
$this->getRequest()->getUrl()->with('modifyFilter', true),
|
||||
null,
|
||||
array(
|
||||
'class' => 'icon-search',
|
||||
'data-base-target' => '_self',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$this->view->addLink .= ' ' . $this->view->qlink(
|
||||
$this->shorten($filter, 32),
|
||||
$this->getRequest()->getUrl()->with('modifyFilter', true),
|
||||
null,
|
||||
array(
|
||||
'class' => 'icon-search',
|
||||
'data-base-target' => '_self',
|
||||
)
|
||||
);
|
||||
|
||||
$this->view->addLink .= ' ' . $this->view->qlink(
|
||||
$this->translate('Show unfiltered'),
|
||||
$this->getRequest()->getUrl()->setParams(array()),
|
||||
null,
|
||||
array(
|
||||
'class' => 'icon-cancel',
|
||||
'data-base-target' => '_self',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->params->get('modifyFilter')) {
|
||||
$this->view->filterEditor = $filterEditor;
|
||||
}
|
||||
|
||||
if ($this->getRequest()->isApiRequest()) {
|
||||
$objects = array();
|
||||
|
|
Loading…
Reference in New Issue