Reset Limit count and offset for `$table` in HostController::servicesAction
The limit in ObjectsTable::prepareQuery() limits the number of services shown in HostController::servicesAction. But this limit is required for pagination in ServicesController. Hence, reset the limit when this query is used in HostController::servicesAction().
This commit is contained in:
parent
560e0e6520
commit
26e76c611e
|
@ -211,7 +211,8 @@ class HostController extends ObjectController
|
||||||
->setAuth($this->Auth())
|
->setAuth($this->Auth())
|
||||||
->setHost($host)
|
->setHost($host)
|
||||||
->setBranch($branch)
|
->setBranch($branch)
|
||||||
->setTitle($this->translate('Individual Service objects'));
|
->setTitle($this->translate('Individual Service objects'))
|
||||||
|
->removeQueryLimit();
|
||||||
|
|
||||||
if (count($table)) {
|
if (count($table)) {
|
||||||
$content->add($table);
|
$content->add($table);
|
||||||
|
@ -225,7 +226,9 @@ class HostController extends ObjectController
|
||||||
->setAuth($this->Auth())
|
->setAuth($this->Auth())
|
||||||
->setBranch($branch)
|
->setBranch($branch)
|
||||||
->setHost($parent)
|
->setHost($parent)
|
||||||
->setInheritedBy($host);
|
->setInheritedBy($host)
|
||||||
|
->removeQueryLimit();
|
||||||
|
|
||||||
if (count($table)) {
|
if (count($table)) {
|
||||||
$content->add(
|
$content->add(
|
||||||
$table->setTitle(sprintf(
|
$table->setTitle(sprintf(
|
||||||
|
@ -253,6 +256,7 @@ class HostController extends ObjectController
|
||||||
->setBranch($branch)
|
->setBranch($branch)
|
||||||
->setAffectedHost($host)
|
->setAffectedHost($host)
|
||||||
->setTitle($title)
|
->setTitle($title)
|
||||||
|
->removeQueryLimit()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -247,4 +247,13 @@ class IcingaServiceSetServiceTable extends ZfQueryBasedTable
|
||||||
$deleteLink->handleRequest();
|
$deleteLink->handleRequest();
|
||||||
return $deleteLink;
|
return $deleteLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function removeQueryLimit()
|
||||||
|
{
|
||||||
|
$query = $this->getQuery();
|
||||||
|
$query->reset($query::LIMIT_OFFSET);
|
||||||
|
$query->reset($query::LIMIT_COUNT);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -303,4 +303,13 @@ class ObjectsTable extends ZfQueryBasedTable
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function removeQueryLimit()
|
||||||
|
{
|
||||||
|
$query = $this->getQuery();
|
||||||
|
$query->reset($query::LIMIT_OFFSET);
|
||||||
|
$query->reset($query::LIMIT_COUNT);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue