2015-07-26 15:39:37 +02:00
|
|
|
<?php
|
|
|
|
|
2015-10-20 22:34:04 +02:00
|
|
|
namespace Icinga\Module\Director\Controllers;
|
|
|
|
|
2016-07-13 10:19:51 +02:00
|
|
|
use Icinga\Module\Director\Objects\ImportRun;
|
2015-07-26 15:39:37 +02:00
|
|
|
use Icinga\Module\Director\Web\Controller\ActionController;
|
|
|
|
|
2015-10-20 22:34:04 +02:00
|
|
|
class ImportrunController extends ActionController
|
2015-07-26 15:39:37 +02:00
|
|
|
{
|
|
|
|
public function indexAction()
|
|
|
|
{
|
2016-07-13 10:19:51 +02:00
|
|
|
$db = $this->db();
|
2016-06-26 16:30:12 +02:00
|
|
|
$id = $this->getRequest()->getUrl()->getParams()->shift('id');
|
2016-07-13 10:19:51 +02:00
|
|
|
$importRun = ImportRun::load($id, $db);
|
|
|
|
$url = clone($this->getRequest()->getUrl());
|
|
|
|
$chosenColumns = $this->getRequest()->getUrl()->shift('chosenColumns');
|
|
|
|
|
2015-07-26 15:39:37 +02:00
|
|
|
$this->view->title = $this->translate('Import run');
|
2016-07-13 10:19:51 +02:00
|
|
|
$this->getTabs()->add('importrun', array(
|
|
|
|
'label' => $this->view->title,
|
|
|
|
'url' => $url
|
|
|
|
))->activate('importrun');
|
|
|
|
|
2016-06-26 16:30:12 +02:00
|
|
|
$table = $this
|
|
|
|
->loadTable('importedrows')
|
2016-07-13 10:19:51 +02:00
|
|
|
->setConnection($db)
|
|
|
|
->setImportRun($importRun);
|
|
|
|
|
|
|
|
if ($chosenColumns) {
|
|
|
|
$table->setColumns(preg_split('/,/', $chosenColumns, -1, PREG_SPLIT_NO_EMPTY));
|
|
|
|
}
|
2016-06-26 16:30:12 +02:00
|
|
|
|
2015-08-28 23:56:25 +02:00
|
|
|
$this->view->table = $this->applyPaginationLimits($table);
|
2016-06-26 16:30:12 +02:00
|
|
|
$this->view->filterEditor = $table->getFilterEditor($this->getRequest());
|
2015-07-26 15:39:37 +02:00
|
|
|
}
|
|
|
|
}
|