mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
Datalists: halfway done
This commit is contained in:
parent
02c7a5c62c
commit
2b2ab87338
@ -12,6 +12,14 @@ class Director_ListController extends ActionController
|
||||
$this->render('table');
|
||||
}
|
||||
|
||||
public function datalistAction()
|
||||
{
|
||||
$this->setConfigTabs()->activate('datalist');
|
||||
$this->view->title = $this->translate('Data lists');
|
||||
$this->view->table = $this->loadTable('datalist')->setConnection($this->db());
|
||||
$this->render('table');
|
||||
}
|
||||
|
||||
public function generatedconfigAction()
|
||||
{
|
||||
$this->view->addLink = $this->view->qlink(
|
||||
|
15
application/forms/DirectorDatalistForm.php
Normal file
15
application/forms/DirectorDatalistForm.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Icinga\Module\Director\Forms;
|
||||
|
||||
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
||||
|
||||
class DirectorDatalistForm extends DirectorObjectForm
|
||||
{
|
||||
public function setup()
|
||||
{
|
||||
$this->addElement('text', 'list_name', array(
|
||||
'label' => $this->translate('List name')
|
||||
));
|
||||
}
|
||||
}
|
43
application/tables/DatalistTable.php
Normal file
43
application/tables/DatalistTable.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Icinga\Module\Director\Tables;
|
||||
|
||||
use Icinga\Module\Director\Web\Table\QuickTable;
|
||||
|
||||
class DatalistTable extends QuickTable
|
||||
{
|
||||
public function getColumns()
|
||||
{
|
||||
return array(
|
||||
'id' => 'l.id',
|
||||
'list_name' => 'l.list_name',
|
||||
'owner' => 'l.owner',
|
||||
);
|
||||
}
|
||||
|
||||
protected function getActionUrl($row)
|
||||
{
|
||||
return $this->url('director/show/datalist', array('id' => $row->id));
|
||||
}
|
||||
|
||||
public function getTitles()
|
||||
{
|
||||
$view = $this->view();
|
||||
return array(
|
||||
'list_name' => $view->translate('List name'),
|
||||
'owner' => $view->translate('Owner'),
|
||||
);
|
||||
}
|
||||
|
||||
public function fetchData()
|
||||
{
|
||||
$db = $this->connection()->getConnection();
|
||||
|
||||
$query = $db->select()->from(
|
||||
array('l' => 'director_datalist'),
|
||||
$this->getColumns()
|
||||
)->order('list_name ASC');
|
||||
|
||||
return $db->fetchAll($query);
|
||||
}
|
||||
}
|
@ -42,7 +42,10 @@ abstract class ActionController extends Controller
|
||||
)->add('activitylog', array(
|
||||
'label' => $this->translate('Activity Log'),
|
||||
'url' => 'director/list/activitylog')
|
||||
);
|
||||
)->add('datalist', array(
|
||||
'label' => $this->translate('Data lists'),
|
||||
'url' => 'director/list/datalist')
|
||||
);;
|
||||
return $this->view->tabs;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user