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;
|
||||
|
||||
use Icinga\Module\Director\Web\Form\QuickForm;
|
||||
use ipl\Translation\TranslationHelper;
|
||||
use Zend_Form_Element as ZfElement;
|
||||
|
||||
class IcingaTemplateChoice extends IcingaObject
|
||||
{
|
||||
private $objectTable;
|
||||
protected $objectTable;
|
||||
|
||||
protected $defaultProperties = [
|
||||
'id' => null,
|
||||
@ -90,11 +88,10 @@ class IcingaTemplateChoice extends IcingaObject
|
||||
if ($this->hasBeenLoadedFromDb()) {
|
||||
$db = $this->getDb();
|
||||
$query = $db->select()->from(
|
||||
['o' => $this->objectTable],
|
||||
['o' => $this->getObjectTableName()],
|
||||
['o.id', 'o.object_name']
|
||||
)->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);
|
||||
} else {
|
||||
return [];
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Icinga\Module\Director\Objects;
|
||||
|
||||
class IcingaTemplateChoiceHost extends IcingaTemplateChoice
|
||||
class IcingaTemplateChoiceService extends IcingaTemplateChoice
|
||||
{
|
||||
protected $table = 'icinga_service_template_choice';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user