mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 16:26:55 +02:00
Fix default template assignment
This commit is contained in:
+5
-2
@@ -343,7 +343,8 @@ function ExtTransports($obj) {
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function FormatAlertTpl($obj) {
|
function FormatAlertTpl($obj) {
|
||||||
$msg = '$ret .= "'.str_replace(array('{else}', '{/if}', '{/foreach}'), array('"; } else { $ret .= "', '"; } $ret .= "', '"; } $ret .= "'), addslashes($obj["template"])).'";';
|
$tpl = $obj["template"];
|
||||||
|
$msg = '$ret .= "'.str_replace(array('{else}', '{/if}', '{/foreach}'), array('"; } else { $ret .= "', '"; } $ret .= "', '"; } $ret .= "'), addslashes($tpl)).'";';
|
||||||
$parsed = $msg;
|
$parsed = $msg;
|
||||||
$s = strlen($msg);
|
$s = strlen($msg);
|
||||||
$x = $pos = -1;
|
$x = $pos = -1;
|
||||||
@@ -421,7 +422,9 @@ function DescribeAlert($alert) {
|
|||||||
$obj['device_id'] = $alert['device_id'];
|
$obj['device_id'] = $alert['device_id'];
|
||||||
$extra = $alert['details'];
|
$extra = $alert['details'];
|
||||||
if (!isset($tpl['template'])) {
|
if (!isset($tpl['template'])) {
|
||||||
$tpl['template'] = $default_tpl;
|
$obj['template'] = $default_tpl;
|
||||||
|
} else {
|
||||||
|
$obj['template'] = $tpl['template'];
|
||||||
}
|
}
|
||||||
if ($alert['state'] >= 1) {
|
if ($alert['state'] >= 1) {
|
||||||
if (!empty($tpl['title'])) {
|
if (!empty($tpl['title'])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user