mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
IcingaCommandArgumentTable: use with object
This commit is contained in:
parent
618cd3c32b
commit
9279e01c89
@ -2,35 +2,52 @@
|
||||
|
||||
namespace Icinga\Module\Director\Tables;
|
||||
|
||||
use Icinga\Module\Director\Objects\IcingaCommand;
|
||||
use Icinga\Module\Director\Web\Table\QuickTable;
|
||||
|
||||
class IcingaCommandArgumentTable extends QuickTable
|
||||
{
|
||||
protected $commandObject;
|
||||
|
||||
protected $searchColumns = array(
|
||||
'command',
|
||||
);
|
||||
|
||||
public function setCommandObject(IcingaCommand $command)
|
||||
{
|
||||
$this->commandObject = $command;
|
||||
if ($this->connection === null) {
|
||||
$this->setConnection($command->getConnection());
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getColumns()
|
||||
{
|
||||
return array(
|
||||
'id' => 'ca.id',
|
||||
'command_id' => 'c.id',
|
||||
'command' => 'c.object_name',
|
||||
'argument_name' => 'ca.argument_name',
|
||||
'argument_value' => 'ca.argument_value',
|
||||
// 'required' => 'ca.required',
|
||||
);
|
||||
}
|
||||
|
||||
protected function getActionUrl($row)
|
||||
{
|
||||
return $this->url('director/commandargument', array('id' => $row->id));
|
||||
return $this->url(
|
||||
'director/command/arguments',
|
||||
array(
|
||||
'argument_id' => $row->id,
|
||||
'name' => $this->commandObject->object_name
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function getTitles()
|
||||
{
|
||||
$view = $this->view();
|
||||
return array(
|
||||
'command' => $view->translate('Command'),
|
||||
'argument_name' => $view->translate('Argument'),
|
||||
'argument_value' => $view->translate('Value'),
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user