activitylog: add links to previous/next action

This commit is contained in:
Thomas Gelf 2015-11-17 21:16:09 +01:00
parent 40656be2c3
commit dc1363238b
3 changed files with 22 additions and 1 deletions

View File

@ -136,6 +136,12 @@ class ShowController extends ActionController
$this->view->entry = $this->db()->fetchActivityLogEntry(Util::hex2binary($checksum));
}
$this->view->neighbors = $this->db()->getActivitylogNeighbors(
$id,
$this->params->get('type'),
$this->params->get('name')
);
$entry = $this->view->entry;
$this->activityTabs($entry);
$this->showInfo($entry);

View File

@ -8,6 +8,8 @@ class ActivityLogTable extends QuickTable
{
protected $filters = array();
protected $extraParams = array();
public function getColumns()
{
return array(
@ -20,7 +22,10 @@ class ActivityLogTable extends QuickTable
protected function getActionUrl($row)
{
return $this->url('director/show/activitylog', array('id' => $row->id));
return $this->url(
'director/show/activitylog',
array_merge(array('id' => $row->id), $this->extraParams
));
}
public function getTitles()
@ -37,6 +42,10 @@ class ActivityLogTable extends QuickTable
{
$this->filters[] = array('l.object_type = ?', $type);
$this->filters[] = array('l.object_name = ?', $name);
$this->extraParams = array(
'type' => $type,
'name' => $name,
);
return $this;
}

View File

@ -4,5 +4,11 @@
</div>
<div class="content">
<p><?php if ($this->neighbors->prev): ?>
<?= $this->qlink('<- prev', $this->url()->with('id', $this->neighbors->prev)) ?>
<?php endif ?>
<?php if ($this->neighbors->next): ?>
<?= $this->qlink('next ->', $this->url()->with('id', $this->neighbors->next)) ?>
<?php endif ?></p>
<?= $this->output ?>
</div>