diff options
author | Mārtiņš Tālbergs <martins.talbergs@zabbix.com> | 2020-06-29 13:46:14 +0300 |
---|---|---|
committer | Mārtiņš Tālbergs <martins.talbergs@zabbix.com> | 2020-06-29 13:46:14 +0300 |
commit | 6e2a7deaccfee1c50c7863aac4fd1bed0fb15cc9 (patch) | |
tree | 75223d729e886ed15746b0171bdd1c08f0608b5f /ui/app/controllers | |
parent | 8037cf6b7a4ab2f384b678f6843301030b4ca675 (diff) |
..F....... [ZBX-17955] renamed references from "users_medias" to "medias" in forms
Diffstat (limited to 'ui/app/controllers')
-rw-r--r-- | ui/app/controllers/CControllerUserCreate.php | 4 | ||||
-rw-r--r-- | ui/app/controllers/CControllerUserEdit.php | 8 | ||||
-rw-r--r-- | ui/app/controllers/CControllerUserEditGeneral.php | 18 | ||||
-rw-r--r-- | ui/app/controllers/CControllerUserProfileEdit.php | 6 | ||||
-rw-r--r-- | ui/app/controllers/CControllerUserProfileUpdate.php | 4 | ||||
-rw-r--r-- | ui/app/controllers/CControllerUserUpdate.php | 4 |
6 files changed, 22 insertions, 22 deletions
diff --git a/ui/app/controllers/CControllerUserCreate.php b/ui/app/controllers/CControllerUserCreate.php index f976275f629..ef15b7e8637 100644 --- a/ui/app/controllers/CControllerUserCreate.php +++ b/ui/app/controllers/CControllerUserCreate.php @@ -34,7 +34,7 @@ class CControllerUserCreate extends CControllerUserUpdateGeneral { 'password2' => 'required|string', 'type' => 'db users.type|in '.USER_TYPE_ZABBIX_USER.','.USER_TYPE_ZABBIX_ADMIN.','.USER_TYPE_SUPER_ADMIN, 'user_groups' => 'required|array_id|not_empty', - 'user_medias' => 'array', + 'medias' => 'array', 'lang' => 'db users.lang|in '.implode(',', $locales), 'theme' => 'db users.theme|in '.implode(',', $themes), 'autologin' => 'db users.autologin|in 0,1', @@ -89,7 +89,7 @@ class CControllerUserCreate extends CControllerUserUpdateGeneral { $user['medias'] = []; - foreach ($this->getInput('user_medias', []) as $media) { + foreach ($this->getInput('medias', []) as $media) { $user['medias'][] = [ 'mediatypeid' => $media['mediatypeid'], 'sendto' => $media['sendto'], diff --git a/ui/app/controllers/CControllerUserEdit.php b/ui/app/controllers/CControllerUserEdit.php index ddb93ff02d9..00e6950f628 100644 --- a/ui/app/controllers/CControllerUserEdit.php +++ b/ui/app/controllers/CControllerUserEdit.php @@ -45,7 +45,7 @@ class CControllerUserEdit extends CControllerUserEditGeneral { 'refresh' => 'db users.refresh', 'rows_per_page' => 'db users.rows_per_page', 'url' => 'db users.url', - 'user_medias' => 'array', + 'medias' => 'array', 'new_media' => 'array', 'enable_media' => 'int32', 'disable_media' => 'int32', @@ -106,7 +106,7 @@ class CControllerUserEdit extends CControllerUserEditGeneral { 'refresh' => $db_defaults['refresh'], 'rows_per_page' => $db_defaults['rows_per_page'], 'url' => '', - 'user_medias' => [], + 'medias' => [], 'new_media' => [], 'type' => $db_defaults['type'], 'config' => [ @@ -140,7 +140,7 @@ class CControllerUserEdit extends CControllerUserEditGeneral { $data['refresh'] = $this->user['refresh']; $data['rows_per_page'] = $this->user['rows_per_page']; $data['url'] = $this->user['url']; - $data['user_medias'] = $this->user['medias']; + $data['medias'] = $this->user['medias']; $data['type'] = $this->user['type']; $data['db_user']['alias'] = $this->user['alias']; } @@ -154,7 +154,7 @@ class CControllerUserEdit extends CControllerUserEditGeneral { ]); if ($data['form_refresh'] != 0) { $user_groups = $this->getInput('user_groups', []); - $data['user_medias'] = $this->getInput('user_medias', []); + $data['medias'] = $this->getInput('medias', []); } $data = $this->setUserMedias($data); diff --git a/ui/app/controllers/CControllerUserEditGeneral.php b/ui/app/controllers/CControllerUserEditGeneral.php index 005bd234cac..9182cbf7345 100644 --- a/ui/app/controllers/CControllerUserEditGeneral.php +++ b/ui/app/controllers/CControllerUserEditGeneral.php @@ -42,22 +42,22 @@ abstract class CControllerUserEditGeneral extends CController { */ protected function setUserMedias(array $data) { if ($this->hasInput('new_media')) { - $data['user_medias'][] = $this->getInput('new_media'); + $data['medias'][] = $this->getInput('new_media'); } elseif ($this->hasInput('enable_media')) { - if (array_key_exists($this->getInput('enable_media'), $data['user_medias'])) { - $data['user_medias'][$this->getInput('enable_media')]['active'] = MEDIA_STATUS_ACTIVE; + if (array_key_exists($this->getInput('enable_media'), $data['medias'])) { + $data['medias'][$this->getInput('enable_media')]['active'] = MEDIA_STATUS_ACTIVE; } } elseif ($this->hasInput('disable_media')) { - if (array_key_exists($this->getInput('disable_media'), $data['user_medias'])) { - $data['user_medias'][$this->getInput('disable_media')]['active'] = MEDIA_STATUS_DISABLED; + if (array_key_exists($this->getInput('disable_media'), $data['medias'])) { + $data['medias'][$this->getInput('disable_media')]['active'] = MEDIA_STATUS_DISABLED; } } $mediatypeids = []; - foreach ($data['user_medias'] as $media) { + foreach ($data['medias'] as $media) { $mediatypeids[$media['mediatypeid']] = true; } @@ -67,7 +67,7 @@ abstract class CControllerUserEditGeneral extends CController { 'preservekeys' => true ]); - foreach ($data['user_medias'] as &$media) { + foreach ($data['medias'] as &$media) { $media['name'] = $mediatypes[$media['mediatypeid']]['name']; $media['mediatype'] = $mediatypes[$media['mediatypeid']]['type']; $media['send_to_sort_field'] = is_array($media['sendto']) @@ -76,9 +76,9 @@ abstract class CControllerUserEditGeneral extends CController { } unset($media); - CArrayHelper::sort($data['user_medias'], ['name', 'send_to_sort_field']); + CArrayHelper::sort($data['medias'], ['name', 'send_to_sort_field']); - foreach ($data['user_medias'] as &$media) { + foreach ($data['medias'] as &$media) { unset($media['send_to_sort_field']); } unset($media); diff --git a/ui/app/controllers/CControllerUserProfileEdit.php b/ui/app/controllers/CControllerUserProfileEdit.php index 8b58301abaa..2a8871bdd2b 100644 --- a/ui/app/controllers/CControllerUserProfileEdit.php +++ b/ui/app/controllers/CControllerUserProfileEdit.php @@ -46,7 +46,7 @@ class CControllerUserProfileEdit extends CControllerUserEditGeneral { if (CWebUser::$data['type'] > USER_TYPE_ZABBIX_USER) { $fields += [ - 'user_medias' => 'array', + 'medias' => 'array', 'new_media' => 'array', 'enable_media' => 'int32', 'disable_media' => 'int32' @@ -122,7 +122,7 @@ class CControllerUserProfileEdit extends CControllerUserEditGeneral { ]; if (CWebUser::$data['type'] > USER_TYPE_ZABBIX_USER) { - $data['user_medias'] = $this->user['medias']; + $data['medias'] = $this->user['medias']; } // Overwrite with input variables. @@ -132,7 +132,7 @@ class CControllerUserProfileEdit extends CControllerUserEditGeneral { if (CWebUser::$data['type'] > USER_TYPE_ZABBIX_USER) { if ($data['form_refresh'] != 0) { - $data['user_medias'] = $this->getInput('user_medias', []); + $data['medias'] = $this->getInput('medias', []); } $data = $this->setUserMedias($data); diff --git a/ui/app/controllers/CControllerUserProfileUpdate.php b/ui/app/controllers/CControllerUserProfileUpdate.php index f0425710284..9dc1cff77fd 100644 --- a/ui/app/controllers/CControllerUserProfileUpdate.php +++ b/ui/app/controllers/CControllerUserProfileUpdate.php @@ -33,7 +33,7 @@ class CControllerUserProfileUpdate extends CControllerUserUpdateGeneral { 'userid' => 'fatal|required|db users.userid', 'password1' => 'string', 'password2' => 'string', - 'user_medias' => 'array', + 'medias' => 'array', 'lang' => 'db users.lang|in '.implode(',', $locales), 'theme' => 'db users.theme|in '.implode(',', $themes), 'autologin' => 'db users.autologin|in 0,1', @@ -93,7 +93,7 @@ class CControllerUserProfileUpdate extends CControllerUserUpdateGeneral { if (CWebUser::$data['type'] > USER_TYPE_ZABBIX_USER) { $user['medias'] = []; - foreach ($this->getInput('user_medias', []) as $media) { + foreach ($this->getInput('medias', []) as $media) { $user['medias'][] = [ 'mediatypeid' => $media['mediatypeid'], 'sendto' => $media['sendto'], diff --git a/ui/app/controllers/CControllerUserUpdate.php b/ui/app/controllers/CControllerUserUpdate.php index 180207ffe52..13e0f15b7f3 100644 --- a/ui/app/controllers/CControllerUserUpdate.php +++ b/ui/app/controllers/CControllerUserUpdate.php @@ -37,7 +37,7 @@ class CControllerUserUpdate extends CControllerUserUpdateGeneral { 'user_groups' => 'required|array_id|not_empty', 'password1' => 'string', 'password2' => 'string', - 'user_medias' => 'array', + 'medias' => 'array', 'lang' => 'db users.lang|in '.implode(',', $locales), 'theme' => 'db users.theme|in '.implode(',', $themes), 'autologin' => 'db users.autologin|in 0,1', @@ -101,7 +101,7 @@ class CControllerUserUpdate extends CControllerUserUpdateGeneral { $user['medias'] = []; - foreach ($this->getInput('user_medias', []) as $media) { + foreach ($this->getInput('medias', []) as $media) { $user['medias'][] = [ 'mediatypeid' => $media['mediatypeid'], 'sendto' => $media['sendto'], |