Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(notification): link properly contact with contact template on fil…
Browse files Browse the repository at this point in the history
…e generation (#8080)

Refs: MON-4448
  • Loading branch information
kduret authored Oct 31, 2019
1 parent 02f3472 commit 3cfe251
Showing 1 changed file with 9 additions and 8 deletions.
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

0 comments on commit 3cfe251

Please sign in to comment.