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

fix(notification): link properly contact with contact template #8080

Merged
merged 2 commits into from
Oct 31, 2019
Merged
Changes from all commits
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
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)) {
kduret marked this conversation as resolved.
Show resolved Hide resolved
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