Skip to content
This repository was archived by the owner on Dec 13, 2022. It is now read-only.
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(notification): link properly contact with contact template on fil…
…e generation (#8080)

Refs: MON-4448
  • Loading branch information
kduret committed Oct 31, 2019
commit 00ce510a7500ff8c794249ee38a10841a4dfc61d
17 changes: 9 additions & 8 deletions www/class/config-generate/contact.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,20 +226,21 @@ public function generateFromContactId($contact_id)
if (is_null($this->contacts[$contact_id])) {
return null;
}
if ($this->checkGenerate($contact_id)) {
return $this->contacts[$contact_id]['register'] == 1
? $this->contacts[$contact_id]['contact_name']
: $this->contacts[$contact_id]['name'];
}

if ($this->contacts[$contact_id]['register'] == 0 && !isset($this->contacts[$contact_id]['name'])) {
$this->contacts[$contact_id]['name'] = $this->contacts[$contact_id]['contact_name'];
unset($this->contacts[$contact_id]['contact_name']);
}

$this->contacts[$contact_id]['use'] = array();
$this->contacts[$contact_id]['use'][] =
$this->generateFromContactId($this->contacts[$contact_id]['contact_template_id']);
if ($this->checkGenerate($contact_id)) {
return $this->contacts[$contact_id]['register'] == 1
? $this->contacts[$contact_id]['contact_name']
: $this->contacts[$contact_id]['name'];
}

$this->contacts[$contact_id]['use'] = [
$this->generateFromContactId($this->contacts[$contact_id]['contact_template_id'])
];
$this->getContactNotificationCommands($contact_id, 'host');
$this->getContactNotificationCommands($contact_id, 'service');
$period = Timeperiod::getInstance($this->dependencyInjector);
Expand Down