diff --git a/lam/templates/profedit/profilemain.php b/lam/templates/profedit/profilemain.php index 82ffde4d..595b7208 100644 --- a/lam/templates/profedit/profilemain.php +++ b/lam/templates/profedit/profilemain.php @@ -76,12 +76,14 @@ foreach ($types as $type) { if ($type->isHidden() || !checkIfWriteAccessIsAllowed($type->getId())) { continue; } + $profileList = \LAM\PROFILES\getAccountProfiles($type->getId()); + natcasesort($profileList); $profileClassesTemp[$type->getAlias()] = array( 'typeId' => $type->getId(), 'scope' => $type->getScope(), 'title' => $type->getAlias(), 'icon' => $type->getIcon(), - 'profiles' => ""); + 'profiles' => $profileList); } $profileClassesKeys = array_keys($profileClassesTemp); natcasesort($profileClassesKeys); @@ -188,13 +190,6 @@ if (!empty($_POST['export'])) { } } -// get list of profiles for each account type -foreach ($profileClasses as &$profileClass) { - $profileList = \LAM\PROFILES\getAccountProfiles($profileClass['typeId']); - natcasesort($profileList); - $profileClass['profiles'] = $profileList; -} - if (isset($_GET['savedSuccessfully'])) { $message = new htmlStatusMessage("INFO", _("Profile was saved."), htmlspecialchars($_GET['savedSuccessfully'])); $message->colspan = 10;