"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ui/include/classes/api/services/CMediatype.php" between
zabbix-5.4.0.tar.gz and zabbix-5.4.1.tar.gz

About: ZABBIX is an enterprise-class distributed monitoring solution for servers and applications.

CMediatype.php  (zabbix-5.4.0):CMediatype.php  (zabbix-5.4.1)
skipping to change at line 1215 skipping to change at line 1215
); );
} }
} }
} }
protected function addRelatedObjects(array $options, array $result) { protected function addRelatedObjects(array $options, array $result) {
$result = parent::addRelatedObjects($options, $result); $result = parent::addRelatedObjects($options, $result);
// adding message templates // adding message templates
if ($options['selectMessageTemplates'] !== null && $options['sele ctMessageTemplates'] != API_OUTPUT_COUNT) { if ($options['selectMessageTemplates'] !== null && $options['sele ctMessageTemplates'] != API_OUTPUT_COUNT) {
$message_templates = [];
$relation_map = $this->createRelationMap($result, 'mediat ypeid', 'mediatype_messageid', $relation_map = $this->createRelationMap($result, 'mediat ypeid', 'mediatype_messageid',
'media_type_message' 'media_type_message'
); );
$message_templates = API::getApiService()->select('media_ $related_ids = $relation_map->getRelatedIds();
type_message', [
'output' => $options['selectMessageTemplates'], if ($related_ids) {
'filter' => ['mediatype_messageid' => $relation_m $message_templates = API::getApiService()->select
ap->getRelatedIds()], ('media_type_message', [
'preservekeys' => true 'output' => $options['selectMessageTempla
]); tes'],
$message_templates = $this->unsetExtraFields($message_tem 'mediatype_messageids' => $related_ids,
plates, ['mediatype_messageid', 'mediatypeid'], 'preservekeys' => true
[] ]);
); $message_templates = $this->unsetExtraFields($mes
sage_templates, ['mediatype_messageid', 'mediatypeid'],
[]
);
}
$result = $relation_map->mapMany($result, $message_templa tes, 'message_templates'); $result = $relation_map->mapMany($result, $message_templa tes, 'message_templates');
} }
// adding users // adding users
if ($options['selectUsers'] !== null && $options['selectUsers'] ! = API_OUTPUT_COUNT) { if ($options['selectUsers'] !== null && $options['selectUsers'] ! = API_OUTPUT_COUNT) {
$users = [];
$relationMap = $this->createRelationMap($result, 'mediaty peid', 'userid', 'media'); $relationMap = $this->createRelationMap($result, 'mediaty peid', 'userid', 'media');
$users = API::User()->get([ $related_ids = $relationMap->getRelatedIds();
'output' => $options['selectUsers'],
'userids' => $relationMap->getRelatedIds(), if ($related_ids) {
'preservekeys' => true $users = API::User()->get([
]); 'output' => $options['selectUsers'],
'userids' => $related_ids,
'preservekeys' => true
]);
}
$result = $relationMap->mapMany($result, $users, 'users') ; $result = $relationMap->mapMany($result, $users, 'users') ;
} }
if ($this->outputIsRequested('parameters', $options['output'])) { if ($this->outputIsRequested('parameters', $options['output'])) {
foreach ($result as $mediatypeid => $mediatype) { foreach ($result as $mediatypeid => $mediatype) {
$result[$mediatypeid]['parameters'] = []; $result[$mediatypeid]['parameters'] = [];
} }
$parameters = DB::select('media_type_param', [ $parameters = DB::select('media_type_param', [
'output' => ['mediatypeid', 'name', 'value'], 'output' => ['mediatypeid', 'name', 'value'],
 End of changes. 4 change blocks. 
16 lines changed or deleted 28 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)