N°7194 - Add link to datamodel class schema on object details (#613)

This commit is contained in:
Anne-Catherine
2024-03-26 11:35:44 +01:00
committed by GitHub
parent 12b30c1531
commit 279b29a98c
20 changed files with 46 additions and 5 deletions

View File

@@ -125,9 +125,7 @@ class ApplicationMenu
*/
public static function CheckMenuIdEnabled($sMenuId)
{
self::LoadAdditionalMenus();
$oMenuNode = self::GetMenuNode(self::GetMenuIndexById($sMenuId));
if (is_null($oMenuNode) || !$oMenuNode->IsEnabled())
if (self::IsMenuIdEnabled($sMenuId) === false)
{
require_once(APPROOT.'/setup/setuppage.class.inc.php');
$oP = new ErrorPage(Dict::S('UI:PageTitle:FatalError'));
@@ -138,6 +136,19 @@ class ApplicationMenu
}
}
/**
* @param $sMenuId
*
* @return bool true if the menu exists and current user is allowed to see the menu
* @since 3.2.0
*/
public static function IsMenuIdEnabled($sMenuId):bool
{
self::LoadAdditionalMenus();
$oMenuNode = self::GetMenuNode(self::GetMenuIndexById($sMenuId));
return is_null($oMenuNode) === false && $oMenuNode->IsEnabled();
}
/**
* Main function to add a menu entry into the application, can be called during the definition
* of the data model objects