mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-21 17:07:54 +02:00
TemplateChoice: small fixes, forms
This commit is contained in:
parent
1739b950a8
commit
2f79920a18
@ -3,12 +3,10 @@
|
|||||||
namespace Icinga\Module\Director\Objects;
|
namespace Icinga\Module\Director\Objects;
|
||||||
|
|
||||||
use Icinga\Module\Director\Web\Form\QuickForm;
|
use Icinga\Module\Director\Web\Form\QuickForm;
|
||||||
use ipl\Translation\TranslationHelper;
|
|
||||||
use Zend_Form_Element as ZfElement;
|
|
||||||
|
|
||||||
class IcingaTemplateChoice extends IcingaObject
|
class IcingaTemplateChoice extends IcingaObject
|
||||||
{
|
{
|
||||||
private $objectTable;
|
protected $objectTable;
|
||||||
|
|
||||||
protected $defaultProperties = [
|
protected $defaultProperties = [
|
||||||
'id' => null,
|
'id' => null,
|
||||||
@ -90,11 +88,10 @@ class IcingaTemplateChoice extends IcingaObject
|
|||||||
if ($this->hasBeenLoadedFromDb()) {
|
if ($this->hasBeenLoadedFromDb()) {
|
||||||
$db = $this->getDb();
|
$db = $this->getDb();
|
||||||
$query = $db->select()->from(
|
$query = $db->select()->from(
|
||||||
['o' => $this->objectTable],
|
['o' => $this->getObjectTableName()],
|
||||||
['o.id', 'o.object_name']
|
['o.id', 'o.object_name']
|
||||||
)->where("o.object_type = 'template'")
|
)->where("o.object_type = 'template'")
|
||||||
->where('o.template_choice_id = ?', $this->get('id'));
|
->where('o.template_choice_id IS NULL OR o.template_choice_id = ?', $this->get('id'));
|
||||||
|
|
||||||
return $db->fetchPairs($query);
|
return $db->fetchPairs($query);
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Icinga\Module\Director\Objects;
|
namespace Icinga\Module\Director\Objects;
|
||||||
|
|
||||||
class IcingaTemplateChoiceHost extends IcingaTemplateChoice
|
class IcingaTemplateChoiceService extends IcingaTemplateChoice
|
||||||
{
|
{
|
||||||
protected $table = 'icinga_service_template_choice';
|
protected $table = 'icinga_service_template_choice';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user