Menu

Create profile with AdminTools

george
2015-11-04
2015-11-13
  • george

    george - 2015-11-04

    Hi,
    I,m trying create R\O profil.
    Simply profile is easy but i need see Data Model from AdminTools.
    I found this
    $itop_home/datamodels/1.x/itop-welcome-itil/main.itop-welcome-itil.php

    class ItopWelcome extends ModuleHandlerAPI
    {
            public static function OnMenuCreation()
            {
                    $oToolsMenu = new MenuGroup('DataAdministration', 70 /* fRank */, 'Organization', UR_ACTION_MODIFY, UR_ALLOWED_YES|UR_ALLOWED_DEPENDS);
                    new WebPageMenuNode('CSVImportMenu', utils::GetAbsoluteUrlAppRoot().'pages/csvimport.php', $oToolsMenu->GetIndex(), 1 /* fRank */);
    
                    // Add the admin menus
                    if (UserRights::IsAdministrator())
                    {
                            $oAdminMenu = new MenuGroup('AdminTools', 80 /* fRank */);
                            new OQLMenuNode('UserAccountsMenu', 'SELECT User', $oAdminMenu->GetIndex(), 1 /* fRank */);
                            new OQLMenuNode('ProfilesMenu', 'SELECT URP_Profiles', $oAdminMenu->GetIndex(), 2 /* fRank */);
                            new WebPageMenuNode('NotificationsMenu', utils::GetAbsoluteUrlAppRoot().'pages/notifications.php', $oAdminMenu->GetIndex(), 3 /* fRank */);
                            new OQLMenuNode('AuditCategories', 'SELECT AuditCategory', $oAdminMenu->GetIndex(), 4 /* fRank */);
                            new WebPageMenuNode('RunQueriesMenu', utils::GetAbsoluteUrlAppRoot().'pages/run_query.php', $oAdminMenu->GetIndex(), 8 /* fRank */);
                            new OQLMenuNode('QueryMenu', 'SELECT Query', $oAdminMenu->GetIndex(), 8.5 /* fRank */, true);
                            new WebPageMenuNode('ExportMenu', utils::GetAbsoluteUrlAppRoot().'webservices/export.php', $oAdminMenu->GetIndex(), 9 /* fRank */);
                            new WebPageMenuNode('DataModelMenu', utils::GetAbsoluteUrlAppRoot().'pages/schema.php', $oAdminMenu->GetIndex(), 10 /* fRank */);
                            new WebPageMenuNode('UniversalSearchMenu', utils::GetAbsoluteUrlAppRoot().'pages/UniversalSearch.php', $oAdminMenu->GetIndex(), 11 /* fRank */);
                    }
            }
    }
    

    but i'm not very good at PHP.
    in my model.*.php i tried this

    class ItopWelcome extends ModuleHandlerAPI
    {
            public static function OnMenuCreation()
            {
                            $oToolsMenu = new MenuGroup('DataAdministration', 70 /* fRank */, 'Organization', UR_ACTION_MODIFY, UR_ALLOWED_YES|UR_ALLOWED_DEPENDS,'AdminTools', 80 /* fRank */);
                            new WebPageMenuNode('CSVImportMenu', utils::GetAbsoluteUrlAppRoot().'pages/csvimport.php', $oToolsMenu->GetIndex(), 1 /* fRank */);
                            new WebPageMenuNode('DataModelMenu', utils::GetAbsoluteUrlAppRoot().'pages/schema.php', $oToolsMenu->GetIndex(), 10 /* fRank */);
    
    
            }
    }
    

    Thanks for every idea.

    Best Regards

    George

     

    Last edit: george 2015-11-04
  • Jay Prock

    Jay Prock - 2015-11-13

    I'm interested in something very similar to this as well. Is anyone able to confirm if the only way this can be accomplished is by modifying the itop build? In other words, is creating a custom profile that has access to the Admin tools using the extension approach (like this) definitely not possible?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.