main.itop-welcome-itil.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. // Copyright (C) 2010-2012 Combodo SARL
  3. //
  4. // This file is part of iTop.
  5. //
  6. // iTop is free software; you can redistribute it and/or modify
  7. // it under the terms of the GNU Affero General Public License as published by
  8. // the Free Software Foundation, either version 3 of the License, or
  9. // (at your option) any later version.
  10. //
  11. // iTop is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU Affero General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU Affero General Public License
  17. // along with iTop. If not, see <http://www.gnu.org/licenses/>
  18. // Add the standard menus
  19. /*
  20. * +--------------------+
  21. * | Welcome |
  22. * +--------------------+
  23. * Welcome To iTop
  24. * +--------------------+
  25. * | Tools |
  26. * +--------------------+
  27. * CSV Import
  28. * +--------------------+
  29. * | Admin Tools | << Only present if the user is an admin
  30. * +--------------------+
  31. * User Accounts
  32. * Profiles
  33. * Notifications
  34. * Run Queries
  35. * Export
  36. * Data Model
  37. * Universal Search
  38. */
  39. class ItopWelcome extends ModuleHandlerAPI
  40. {
  41. public static function OnMenuCreation()
  42. {
  43. // Add the admin menus
  44. if (UserRights::IsAdministrator())
  45. {
  46. $oAdminMenu = new MenuGroup('AdminTools', 80 /* fRank */);
  47. new OQLMenuNode('UserAccountsMenu', 'SELECT User', $oAdminMenu->GetIndex(), 1 /* fRank */,true);
  48. new OQLMenuNode('ProfilesMenu', 'SELECT URP_Profiles', $oAdminMenu->GetIndex(), 2 /* fRank */);
  49. new WebPageMenuNode('NotificationsMenu', utils::GetAbsoluteUrlAppRoot().'pages/notifications.php', $oAdminMenu->GetIndex(), 3 /* fRank */);
  50. new OQLMenuNode('AuditCategories', 'SELECT AuditCategory', $oAdminMenu->GetIndex(), 4 /* fRank */);
  51. new WebPageMenuNode('RunQueriesMenu', utils::GetAbsoluteUrlAppRoot().'pages/run_query.php', $oAdminMenu->GetIndex(), 8 /* fRank */);
  52. new OQLMenuNode('QueryMenu', 'SELECT Query', $oAdminMenu->GetIndex(), 8.5 /* fRank */, true);
  53. new WebPageMenuNode('ExportMenu', utils::GetAbsoluteUrlAppRoot().'webservices/export-v2.php?interactive=1', $oAdminMenu->GetIndex(), 9 /* fRank */);
  54. new WebPageMenuNode('DataModelMenu', utils::GetAbsoluteUrlAppRoot().'pages/schema.php', $oAdminMenu->GetIndex(), 10 /* fRank */);
  55. new WebPageMenuNode('UniversalSearchMenu', utils::GetAbsoluteUrlAppRoot().'pages/UniversalSearch.php', $oAdminMenu->GetIndex(), 11 /* fRank */);
  56. new OQLMenuNode('DataSources', 'SELECT SynchroDataSource', $oAdminMenu->GetIndex(), 12 /* fRank */, true);
  57. }
  58. }
  59. }
  60. /**
  61. * Direct end-users to the standard Portal application
  62. */
  63. class MyPortalURLMaker implements iDBObjectURLMaker
  64. {
  65. public static function MakeObjectURL($sClass, $iId)
  66. {
  67. if (strpos(MetaModel::GetConfig()->Get('portal_tickets'), $sClass) !== false)
  68. {
  69. $sAbsoluteUrl = utils::GetAbsoluteUrlAppRoot();
  70. $sUrl = "{$sAbsoluteUrl}portal/index.php?operation=details&class=$sClass&id=$iId";
  71. }
  72. else
  73. {
  74. $sUrl = '';
  75. }
  76. return $sUrl;
  77. }
  78. }
  79. ?>