Source
326
326
*/
327
327
if (!copyHttpTests($cloneTemplateId, $input_templateid)) {
328
328
throw new Exception();
329
329
}
330
330
331
331
if (!copyItems($cloneTemplateId, $input_templateid, true)) {
332
332
throw new Exception();
333
333
}
334
334
335
335
// copy triggers
336
-
$dbTriggers = API::Trigger()->get([
337
-
'output' => ['triggerid'],
338
-
'hostids' => $cloneTemplateId,
339
-
'inherited' => false
340
-
]);
341
-
342
-
if ($dbTriggers) {
343
-
if (!copyTriggersToHosts(zbx_objectValues($dbTriggers, 'triggerid'), $input_templateid,
344
-
$cloneTemplateId)) {
345
-
throw new Exception();
346
-
}
336
+
if (!copyTriggersToHosts([$input_templateid], $cloneTemplateId)) {
337
+
throw new Exception();
347
338
}
348
339
349
340
// copy graphs
350
341
$dbGraphs = API::Graph()->get([
351
342
'output' => ['graphid'],
352
343
'hostids' => $cloneTemplateId,
353
344
'inherited' => false
354
345
]);
355
346
356
347
foreach ($dbGraphs as $dbGraph) {