Skip to content
Snippets Groups Projects
Verified Commit 62d88901 authored by Damien's avatar Damien
Browse files

FEAT #11266 TIME 0:20 Shortcut rework

parent 2cececc5
No related branches found
No related tags found
No related merge requests found
......@@ -101,29 +101,24 @@ class CoreController
public function getShortcuts(Request $request, Response $response)
{
$userGroups = UserModel::getGroupsByLogin(['login' => $GLOBALS['userId']]);
$shortcuts = [
['id' => 'home']
];
if ($GLOBALS['userId'] == 'superadmin') {
$menu = ServiceModel::getApplicationServicesByXML(['type' => 'menu']);
$menuModules = ServiceModel::getModulesServicesByXML(['type' => 'menu']);
$menu = array_merge($menu, $menuModules);
$shortcuts[] = ['id' => 'administration'];
$shortcuts[] = ['id' => 'search'];
} else {
$menu = ServiceController::getMenuServicesByUserId(['userId' => $GLOBALS['userId']]);
}
foreach ($menu as $value) {
if ($value['id'] == 'admin') {
if (ServiceModel::hasService(['id' => 'admin', 'userId' => $GLOBALS['userId'], 'location' => 'apps', 'type' => 'menu'])) {
$shortcuts[] = ['id' => 'administration'];
} elseif ($value['id'] == 'adv_search_mlb') {
}
if (ServiceModel::hasService(['id' => 'adv_search_mlb', 'userId' => $GLOBALS['userId'], 'location' => 'apps', 'type' => 'menu'])) {
$shortcuts[] = ['id' => 'search'];
}
}
$indexingGroups = [];
$userGroups = UserModel::getGroupsByLogin(['login' => $GLOBALS['userId']]);
foreach ($userGroups as $group) {
if ($group['can_index']) {
$indexingGroups[] = ['id' => $group['id'], 'label' => $group['group_desc']];
......@@ -136,9 +131,7 @@ class CoreController
];
}
return $response->withJson([
'shortcuts' => $shortcuts
]);
return $response->withJson(['shortcuts' => $shortcuts]);
}
public function getAdministration(Request $request, Response $response)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment