diff --git a/app/locales/en_US/LC_MESSAGES/messages.mo b/app/locales/en_US/LC_MESSAGES/messages.mo index 783f5fbfa..24091ceeb 100644 Binary files a/app/locales/en_US/LC_MESSAGES/messages.mo and b/app/locales/en_US/LC_MESSAGES/messages.mo differ diff --git a/app/locales/en_US/LC_MESSAGES/messages.po b/app/locales/en_US/LC_MESSAGES/messages.po index 05602a78e..f8d31de63 100644 --- a/app/locales/en_US/LC_MESSAGES/messages.po +++ b/app/locales/en_US/LC_MESSAGES/messages.po @@ -4950,6 +4950,7 @@ msgstr "Permissions" #: app/modules/web/themes/material-blue/views/account/account.inc:100 #: app/modules/web/themes/material-blue/views/account/search-searchbox.inc:43 #: app/modules/web/themes/material-blue/views/itemshow/account_bulkedit.inc:51 +#: app/modules/web/themes/material-blue/views/itemshow/user_group.inc:66 msgid "Select Client" msgstr "Select Client" @@ -5571,6 +5572,10 @@ msgstr "Domain name" msgid "Default Group" msgstr "Default Group" +#: app/modules/web/themes/material-blue/views/itemshow/user_group.inc:60 +msgid "Default Client" +msgstr "Default Client" + #: app/modules/web/themes/material-blue/views/config/general-auth.inc:91 msgid "Sets the default users group for newly created SSO users" msgstr "Sets the default users group for newly created SSO users" diff --git a/app/modules/web/Controllers/Helpers/Account/AccountHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountHelper.php index 3ef16ff95..66ba511c2 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountHelper.php @@ -91,6 +91,10 @@ final class AccountHelper extends HelperBase * @var ItemPresetService */ private $itemPresetService; + /** + * @var UserGroupService + */ + private $userGroupService; /** * @var string */ @@ -218,6 +222,8 @@ public function setViewForAccount(AccountDetailsResponse $accountDetailsResponse $this->view->assign('accountData', $accountData); $this->view->assign('gotData', true); + $this->view->assign('accountClientId', $accountData->getClientId()); + $accountActionsHelper = $this->dic->get(AccountActionsHelper::class); $this->view->assign('accountActions', $accountActionsHelper->getActionsForAccount($this->accountAcl, $accountActionsDto)); @@ -403,6 +409,9 @@ public function setViewForBlank($actionId) $this->view->assign('accountId', 0); $this->view->assign('gotData', false); + $userGroupData = $this->userGroupService->getById($userData->getUserGroupId()); + $this->view->assign('accountClientId', $userGroupData->getDefaultClientId()); + $this->view->assign('accountActions', $this->dic->get(AccountActionsHelper::class) ->getActionsForAccount($this->accountAcl, new AccountActionsDto($this->accountId))); @@ -463,9 +472,10 @@ protected function initialize() $this->accountHistoryService = $this->dic->get(AccountHistoryService::class); $this->publicLinkService = $this->dic->get(PublicLinkService::class); $this->itemPresetService = $this->dic->get(ItemPresetService::class); + $this->userGroupService = $this->dic->get(UserGroupService::class); $this->view->assign('changesHash', ''); $this->view->assign('chkUserEdit', false); $this->view->assign('chkGroupEdit', false); } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/UserGroupController.php b/app/modules/web/Controllers/UserGroupController.php index 29023ed1d..7e0c43d20 100644 --- a/app/modules/web/Controllers/UserGroupController.php +++ b/app/modules/web/Controllers/UserGroupController.php @@ -46,6 +46,7 @@ use SP\Repositories\NoSuchItemException; use SP\Services\Auth\AuthException; use SP\Services\ServiceException; +use SP\Services\Client\ClientService; use SP\Services\User\UserService; use SP\Services\UserGroup\UserGroupService; use SP\Services\UserGroup\UserToUserGroupService; @@ -159,6 +160,10 @@ protected function setViewData($userGroupId = null) $this->view->assign('group', $userGroupData); + $clients = SelectItemAdapter::factory(ClientService::getItemsBasic())->getItemsFromModel(); + + $this->view->assign('clients', $clients); + $users = $userGroupData->getUsers() ?: []; $this->view->assign('users', diff --git a/app/modules/web/Forms/UserGroupForm.php b/app/modules/web/Forms/UserGroupForm.php index f6c07978f..65eeeb6df 100644 --- a/app/modules/web/Forms/UserGroupForm.php +++ b/app/modules/web/Forms/UserGroupForm.php @@ -72,6 +72,7 @@ protected function analyzeRequestData() $this->groupData->setId($this->itemId); $this->groupData->setName($this->request->analyzeString('name')); $this->groupData->setDescription($this->request->analyzeString('description')); + $this->groupData->setDefaultClientId($this->request->analyzeInt('default_client_id')); $this->groupData->setUsers($this->request->analyzeArray('users', null, [])); } diff --git a/app/modules/web/themes/material-blue/views/account/account.inc b/app/modules/web/themes/material-blue/views/account/account.inc index 2462bf386..cde1973c4 100644 --- a/app/modules/web/themes/material-blue/views/account/account.inc +++ b/app/modules/web/themes/material-blue/views/account/account.inc @@ -38,6 +38,7 @@ use SP\Services\Account\AccountAcl; $accountData = $_getvar('accountData'); $accountAcl = $_getvar('accountAcl'); +$accountClientId = $_getvar('accountClientId'); $gotData = $_getvar('gotData', false); $showLinked = $gotData && count($_getvar('linkedAccounts', [])) > 0; $showFiles = $gotData && $configData->isFilesEnabled() && $accountAcl->isShowFiles(); @@ -128,7 +129,7 @@ $showCustomFields = count($_getvar('customFields', 0)) > 0; foreach ($_getvar('clients') as $client): ?>