2015-06-02 14:19:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Tables;
|
|
|
|
|
|
|
|
use Icinga\Module\Director\Web\Table\QuickTable;
|
|
|
|
|
2015-06-12 12:07:53 +02:00
|
|
|
class IcingaUserGroupTable extends QuickTable
|
2015-06-02 14:19:05 +02:00
|
|
|
{
|
2015-07-29 15:30:10 +02:00
|
|
|
protected $searchColumns = array(
|
|
|
|
'usergroup',
|
|
|
|
);
|
|
|
|
|
2015-06-02 14:19:05 +02:00
|
|
|
public function getColumns()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
'id' => 'ug.id',
|
|
|
|
'usergroup' => 'ug.object_name',
|
|
|
|
'display_name' => 'ug.display_name',
|
|
|
|
'zone' => 'z.object_name',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getActionUrl($row)
|
|
|
|
{
|
2015-07-02 14:31:35 +02:00
|
|
|
return $this->url('director/usergroup', array('name' => $row->usergroup));
|
2015-06-02 14:19:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getTitles()
|
|
|
|
{
|
|
|
|
$view = $this->view();
|
|
|
|
return array(
|
|
|
|
'usergroup' => $view->translate('Usergroup'),
|
|
|
|
'display_name' => $view->translate('Display Name'),
|
|
|
|
'zone' => $view->translate('Zone'),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-07-23 16:19:22 +02:00
|
|
|
public function getBaseQuery()
|
2015-06-02 14:19:05 +02:00
|
|
|
{
|
|
|
|
$db = $this->connection()->getConnection();
|
|
|
|
$query = $db->select()->from(
|
|
|
|
array('ug' => 'icinga_usergroup'),
|
2015-07-23 16:19:22 +02:00
|
|
|
array()
|
2015-06-02 14:19:05 +02:00
|
|
|
)->joinLeft(
|
|
|
|
array('z' => 'icinga_zone'),
|
|
|
|
'ug.zone_id = z.id',
|
|
|
|
array()
|
|
|
|
);
|
|
|
|
|
2015-07-23 16:19:22 +02:00
|
|
|
return $query;
|
2015-06-02 14:19:05 +02:00
|
|
|
}
|
|
|
|
}
|