2015-04-24 14:27:22 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Tables;
|
|
|
|
|
|
|
|
use Icinga\Module\Director\Web\Table\QuickTable;
|
|
|
|
|
|
|
|
class IcingaCommandTable extends QuickTable
|
|
|
|
{
|
2015-07-29 15:30:10 +02:00
|
|
|
protected $searchColumns = array(
|
|
|
|
'command',
|
|
|
|
);
|
|
|
|
|
2015-04-24 14:27:22 +02:00
|
|
|
public function getColumns()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
'id' => 'c.id',
|
|
|
|
'command' => 'c.object_name',
|
|
|
|
'command_line' => 'c.command',
|
|
|
|
'zone' => 'z.object_name',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-06-01 12:42:40 +02:00
|
|
|
protected function getActionUrl($row)
|
2015-04-24 14:27:22 +02:00
|
|
|
{
|
2015-07-02 14:31:35 +02:00
|
|
|
return $this->url('director/command', array('name' => $row->command));
|
2015-04-24 14:27:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getTitles()
|
|
|
|
{
|
|
|
|
$view = $this->view();
|
|
|
|
return array(
|
2015-06-02 17:37:54 +02:00
|
|
|
'command' => $view->translate('Command'),
|
|
|
|
'command_line' => $view->translate('Command line'),
|
|
|
|
'zone' => $view->translate('Zone'),
|
2015-04-24 14:27:22 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-07-23 16:19:22 +02:00
|
|
|
public function getBaseQuery()
|
2015-04-24 14:27:22 +02:00
|
|
|
{
|
|
|
|
$db = $this->connection()->getConnection();
|
|
|
|
$query = $db->select()->from(
|
|
|
|
array('c' => 'icinga_command'),
|
2015-07-23 16:19:22 +02:00
|
|
|
array()
|
2015-04-24 14:27:22 +02:00
|
|
|
)->joinLeft(
|
|
|
|
array('z' => 'icinga_zone'),
|
|
|
|
'c.zone_id = z.id',
|
|
|
|
array()
|
|
|
|
);
|
|
|
|
|
2015-07-23 16:19:22 +02:00
|
|
|
return $query;
|
2015-04-24 14:27:22 +02:00
|
|
|
}
|
|
|
|
}
|