schema.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. <?php
  2. require_once('../application/application.inc.php');
  3. require_once('../application/itopwebpage.class.inc.php');
  4. require_once('../application/startup.inc.php');
  5. /**
  6. * Helper for this page -> link to a class
  7. */
  8. function MakeClassHLink($sClass)
  9. {
  10. return "<a href=\"?operation=details_class&class=$sClass\" title=\"".MetaModel::GetClassDescription($sClass)."\">".MetaModel::GetName($sClass)."</a>";
  11. }
  12. /**
  13. * Helper for this page -> link to a class
  14. */
  15. function MakeRelationHLink($sRelCode)
  16. {
  17. $sDec = MetaModel::GetRelationProperty($sRelCode, 'description');
  18. //$sVerbDown = MetaModel::GetRelationProperty($sRelCode, 'verb_down');
  19. //$sVerbUp = MetaModel::GetRelationProperty($sRelCode, 'verb_up');
  20. return "<a href=\"?operation=details_relation&relcode=$sRelCode\" title=\"$sDec\">".$sRelCode."</a>";
  21. }
  22. /**
  23. * Helper for the global list and the details of a given class
  24. */
  25. function DisplaySubclasses($oPage, $sClass)
  26. {
  27. $aChildClasses = MetaModel::EnumChildClasses($sClass);
  28. if (count($aChildClasses) != 0)
  29. {
  30. $oPage->add("<ul>\n");
  31. foreach($aChildClasses as $sClassName)
  32. {
  33. // Skip indirect childs, they will be handled somewhere else
  34. if (MetaModel::GetParentPersistentClass($sClassName) == $sClass)
  35. {
  36. $oPage->add("<li>".MakeClassHLink($sClassName)."\n");
  37. DisplaySubclasses($oPage, $sClassName);
  38. $oPage->add("</li>\n");
  39. }
  40. }
  41. $oPage->add("</ul>\n");
  42. }
  43. }
  44. /**
  45. * Helper for the global list and the details of a given class
  46. */
  47. function DisplayReferencingClasses($oPage, $sClass)
  48. {
  49. $bSkipLinkingClasses = false;
  50. $aRefs = MetaModel::EnumReferencingClasses($sClass, $bSkipLinkingClasses);
  51. if (count($aRefs) != 0)
  52. {
  53. $oPage->add("<ul>\n");
  54. foreach ($aRefs as $sRemoteClass => $aRemoteKeys)
  55. {
  56. foreach ($aRemoteKeys as $sExtKeyAttCode => $oExtKeyAttDef)
  57. {
  58. $oPage->add("<li>".Dict::Format('UI:Schema:Class_ReferencingClasses_From_By', $sClass, MakeClassHLink($sRemoteClass), $sExtKeyAttCode)."</li>\n");
  59. }
  60. }
  61. $oPage->add("</ul>\n");
  62. }
  63. }
  64. /**
  65. * Helper for the global list and the details of a given class
  66. */
  67. function DisplayLinkingClasses($oPage, $sClass)
  68. {
  69. $bSkipLinkingClasses = false;
  70. $aRefs = MetaModel::EnumLinkingClasses($sClass);
  71. if (count($aRefs) != 0)
  72. {
  73. $oPage->add("<ul>\n");
  74. foreach ($aRefs as $sLinkClass => $aRemoteClasses)
  75. {
  76. foreach($aRemoteClasses as $sExtKeyAttCode => $sRemoteClass)
  77. {
  78. $oPage->add("<li>".Dict::Format('UI:Schema:Class_IsLinkedTo_Class_Via_ClassAndAttribute', $sClass, MakeClassHLink($sRemoteClass), MakeClassHLink($sLinkClass), $sExtKeyAttCode));
  79. }
  80. }
  81. $oPage->add("</ul>\n");
  82. }
  83. }
  84. /**
  85. * Helper for the global list and the details of a given class
  86. */
  87. function DisplayRelatedClassesBestInClass($oPage, $sClass, $iLevels = 20, &$aVisitedClasses = array(), $bSubtree = true)
  88. {
  89. if ($iLevels <= 0) return;
  90. $iLevels--;
  91. if (array_key_exists($sClass, $aVisitedClasses)) return;
  92. $aVisitedClasses[$sClass] = true;
  93. if ($bSubtree) $oPage->add("<ul class=\"treeview\">\n");
  94. foreach (MetaModel::EnumParentClasses($sClass) as $sParentClass)
  95. {
  96. DisplayRelatedClassesBestInClass($oPage, $sParentClass, $iLevels, $aVisitedClasses, false);
  97. }
  98. ////$oPage->add("<div style=\"background-color:#ccc; border: 1px dashed #333;\">");
  99. foreach (MetaModel::EnumReferencedClasses($sClass) as $sExtKeyAttCode => $sRemoteClass)
  100. {
  101. $sVisited = (array_key_exists($sRemoteClass, $aVisitedClasses)) ? " ..." : "";
  102. if (MetaModel::GetAttributeOrigin($sClass, $sExtKeyAttCode) == $sClass)
  103. {
  104. $oPage->add("<li>$sClass| <em>$sExtKeyAttCode</em> =&gt;".MakeClassHLink($sRemoteClass)."$sVisited</li>\n");
  105. DisplayRelatedClassesBestInClass($oPage, $sRemoteClass, $iLevels, $aVisitedClasses);
  106. }
  107. }
  108. foreach (MetaModel::EnumReferencingClasses($sClass) as $sRemoteClass => $aRemoteKeys)
  109. {
  110. foreach ($aRemoteKeys as $sExtKeyAttCode => $oExtKeyAttDef)
  111. {
  112. $sVisited = (array_key_exists($sRemoteClass, $aVisitedClasses)) ? " ..." : "";
  113. $oPage->add("<li>$sClass| &lt;=".MakeClassHLink($sRemoteClass)."::<em>$sExtKeyAttCode</em>$sVisited</li>\n");
  114. DisplayRelatedClassesBestInClass($oPage, $sRemoteClass, $iLevels, $aVisitedClasses);
  115. }
  116. }
  117. ////$oPage->add("</div>");
  118. if ($bSubtree) $oPage->add("</ul>\n");
  119. }
  120. /**
  121. * Helper for the list of classes related to the given class
  122. */
  123. function DisplayRelatedClasses($oPage, $sClass)
  124. {
  125. $oPage->add("<h3>".Dict::Format('UI:Schema:Links:1-n', $sClass)."</h3>\n");
  126. DisplayReferencingClasses($oPage, $sClass);
  127. $oPage->add("<h3>".Dict::Format('UI:Schema:Links:n-n', $sClass)."</h3>\n");
  128. DisplayLinkingClasses($oPage, $sClass);
  129. $oPage->add("<h3>".Dict::S('UI:Schema:Links:All')."</h3>\n");
  130. DisplayRelatedClassesBestInClass($oPage, $sClass, 4);
  131. }
  132. /**
  133. * Helper for the lifecycle details of a given class
  134. */
  135. function DisplayLifecycle($oPage, $sClass)
  136. {
  137. $sStateAttCode = MetaModel::GetStateAttributeCode($sClass);
  138. if (empty($sStateAttCode))
  139. {
  140. $oPage->p(Dict::S('UI:Schema:NoLifeCyle'));
  141. }
  142. else
  143. {
  144. $aStates = MetaModel::EnumStates($sClass);
  145. $aStimuli = MetaModel::EnumStimuli($sClass);
  146. $oPage->add("<img src=\"../pages/graphviz.php?class=$sClass\">\n");
  147. $oPage->add("<h3>".Dict::S('UI:Schema:LifeCycleTransitions')."</h3>\n");
  148. $oPage->add("<ul>\n");
  149. foreach ($aStates as $sStateCode => $aStateDef)
  150. {
  151. $sStateLabel = MetaModel::GetStateLabel($sClass, $sStateCode);
  152. $sStateDescription = MetaModel::GetStateDescription($sClass, $sStateCode);
  153. $oPage->add("<li title=\"code: $sStateCode\">$sStateLabel <span style=\"color:grey;\">($sStateDescription)</span></li>\n");
  154. $oPage->add("<ul>\n");
  155. foreach(MetaModel::EnumTransitions($sClass, $sStateCode) as $sStimulusCode => $aTransitionDef)
  156. {
  157. $sStimulusLabel = $aStimuli[$sStimulusCode]->GetLabel();
  158. $sTargetStateLabel = MetaModel::GetStateLabel($sClass, $aTransitionDef['target_state']);
  159. if (count($aTransitionDef['actions']) > 0)
  160. {
  161. $sActions = " <em>(".implode(', ', $aTransitionDef['actions']).")</em>";
  162. }
  163. else
  164. {
  165. $sActions = "";
  166. }
  167. $oPage->add("<li><span style=\"color:red;font-weight=bold;\">$sStimulusLabel</span> =&gt; $sTargetStateLabel $sActions</li>\n");
  168. }
  169. $oPage->add("</ul>\n");
  170. }
  171. $oPage->add("</ul>\n");
  172. $oPage->add("<h3>".Dict::S('UI:Schema:LifeCyleAttributeOptions')."</h3>\n");
  173. $oPage->add("<ul>\n");
  174. foreach ($aStates as $sStateCode => $aStateDef)
  175. {
  176. $sStateLabel = MetaModel::GetStateLabel($sClass, $sStateCode);
  177. $sStateDescription = MetaModel::GetStateDescription($sClass, $sStateCode);
  178. $oPage->add("<li title=\"code: $sStateCode\">$sStateLabel <span style=\"color:grey;\">($sStateDescription)</span></li>\n");
  179. if (count($aStates[$sStateCode]['attribute_list']) > 0)
  180. {
  181. $oPage->add("<ul>\n");
  182. foreach($aStates[$sStateCode]['attribute_list'] as $sAttCode => $iOptions)
  183. {
  184. $oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
  185. $sAttLabel = $oAttDef->GetLabel();
  186. $aOptions = array();
  187. if ($iOptions & OPT_ATT_HIDDEN) $aOptions[] = Dict::S('UI:Schema:LifeCycleHiddenAttribute');
  188. if ($iOptions & OPT_ATT_READONLY) $aOptions[] = Dict::S('UI:Schema:LifeCycleReadOnlyAttribute');
  189. if ($iOptions & OPT_ATT_MANDATORY) $aOptions[] = Dict::S('UI:Schema:LifeCycleMandatoryAttribute');
  190. if ($iOptions & OPT_ATT_MUSTCHANGE) $aOptions[] = Dict::S('UI:Schema:LifeCycleAttributeMustChange');
  191. if ($iOptions & OPT_ATT_MUSTPROMPT) $aOptions[] = Dict::S('UI:Schema:LifeCycleAttributeMustPrompt');
  192. if (count($aOptions))
  193. {
  194. $sOptions = implode(', ', $aOptions);
  195. }
  196. else
  197. {
  198. $sOptions = "";
  199. }
  200. $oPage->add("<li><span style=\"color:purple;font-weight=bold;\">$sAttLabel</span> $sOptions</li>\n");
  201. }
  202. $oPage->add("</ul>\n");
  203. }
  204. else
  205. {
  206. $oPage->p("<em>".Dict::S('UI:Schema:LifeCycleEmptyList')."</em>");
  207. }
  208. }
  209. $oPage->add("</ul>\n");
  210. }
  211. }
  212. /**
  213. * Helper for the trigger
  214. */
  215. function DisplayTriggers($oPage, $sClass)
  216. {
  217. $oSet = new CMDBObjectSet(DBObjectSearch::FromOQL("SELECT TriggerOnStateChange WHERE target_class = '$sClass'"));
  218. cmdbAbstractObject::DisplaySet($oPage, $oSet);
  219. }
  220. /**
  221. * Display the list of classes from the business model
  222. */
  223. function DisplayClassesList($oPage)
  224. {
  225. $oPage->add("<h1>".Dict::S('UI:Schema:Title')."</h1>\n");
  226. $oPage->add("<ul id=\"ClassesList\" class=\"treeview fileview\">\n");
  227. foreach(MetaModel::EnumCategories() as $sCategory)
  228. {
  229. if (empty($sCategory)) continue; // means 'all' -> skip
  230. $sClosed = ($sCategory == 'bizmodel') ? '' : ' class="closed"';
  231. $oPage->add("<li$sClosed>".Dict::Format('UI:Schema:CategoryMenuItem', $sCategory)."\n");
  232. $oPage->add("<ul>\n");
  233. foreach(MetaModel::GetClasses($sCategory) as $sClassName)
  234. {
  235. if (MetaModel::IsStandaloneClass($sClassName))
  236. {
  237. $oPage->add("<li>".MakeClassHLink($sClassName)."</li>\n");
  238. }
  239. else if (MetaModel::IsRootClass($sClassName))
  240. {
  241. $oPage->add("<li class=\"closed\">".MakeClassHLink($sClassName)."\n");
  242. DisplaySubclasses($oPage, $sClassName);
  243. $oPage->add("</li>\n");
  244. }
  245. }
  246. $oPage->add("</ul>\n");
  247. $oPage->add("</li>\n");
  248. }
  249. $oPage->add("</ul>\n");
  250. $oPage->add("<h1>".Dict::S('UI:Schema:Relationships')."</h1>\n");
  251. $oPage->add("<ul id=\"ClassesRelationships\" class=\"treeview\">\n");
  252. foreach (MetaModel::EnumRelations() as $sRelCode)
  253. {
  254. $oPage->add("<li>".MakeRelationHLink($sRelCode)."\n");
  255. $oPage->add("<ul>\n");
  256. foreach (MetaModel::EnumRelationProperties($sRelCode) as $sProp => $sValue)
  257. {
  258. $oPage->add("<li>$sProp: ".htmlentities($sValue)."</li>\n");
  259. }
  260. $oPage->add("</ul>\n");
  261. $oPage->add("</li>\n");
  262. }
  263. $oPage->add("</ul>\n");
  264. $oPage->add_ready_script('$("#ClassesList").treeview();');
  265. $oPage->add_ready_script('$("#ClassesRelationships").treeview();');
  266. }
  267. /**
  268. * Display the details of a given class of objects
  269. */
  270. function DisplayClassDetails($oPage, $sClass)
  271. {
  272. $oPage->p("<h2>$sClass</h2><br/>\n".MetaModel::GetClassDescription($sClass)."<br/>\n");
  273. if (MetaModel::IsAbstract($sClass))
  274. {
  275. $oPage->p(Dict::S('UI:Schema:AbstractClass'));
  276. }
  277. else
  278. {
  279. $oPage->p(Dict::S('UI:Schema:NonAbstractClass'));
  280. }
  281. $oPage->p("<h3>".Dict::S('UI:Schema:ClassHierarchyTitle')."</h3>");
  282. $oPage->p("[<a href=\"?operation='list'\">".Dict::S('UI:Schema:AllClasses')."</a>]");
  283. // List the parent classes
  284. $sParent = MetaModel::GetParentPersistentClass($sClass);
  285. $aParents = array();
  286. $aParents[] = $sClass;
  287. while($sParent != "" && $sParent != 'cmdbAbstractObject')
  288. {
  289. $aParents[] = $sParent;
  290. $sParent = MetaModel::GetParentPersistentClass($sParent);
  291. }
  292. $iIndex = count($aParents);
  293. $sSpace ="";
  294. $oPage->add("<ul id=\"ClassHierarchy\">");
  295. while ($iIndex > 0)
  296. {
  297. $iIndex--;
  298. $oPage->add("<li>".MakeClassHLink($aParents[$iIndex])."\n");
  299. $oPage->add("<ul>\n");
  300. }
  301. for($iIndex = 0; $iIndex < count($aParents); $iIndex++)
  302. {
  303. $oPage->add("</ul>\n</li>\n");
  304. }
  305. $oPage->add("</ul>\n");
  306. $oPage->add_ready_script('$("#ClassHierarchy").treeview();');
  307. $oPage->p('');
  308. $oPage->AddTabContainer('details');
  309. $oPage->SetCurrentTabContainer('details');
  310. // List the attributes of the object
  311. $aDetails = array();
  312. foreach(MetaModel::ListAttributeDefs($sClass) as $sAttCode=>$oAttDef)
  313. {
  314. if ($oAttDef->IsExternalKey())
  315. {
  316. $sValue = Dict::Format('UI:Schema:ExternalKey_To',MakeClassHLink($oAttDef->GetTargetClass()));
  317. }
  318. else
  319. {
  320. $sValue = $oAttDef->GetDescription();
  321. }
  322. $sType = $oAttDef->GetType().' ('.$oAttDef->GetTypeDesc().')';
  323. $sOrigin = MetaModel::GetAttributeOrigin($sClass, $sAttCode);
  324. $sAllowedValues = "";
  325. $oAllowedValuesDef = $oAttDef->GetValuesDef();
  326. $sMoreInfo = "";
  327. $aCols = array();
  328. foreach($oAttDef->GetSQLColumns() as $sCol => $sFieldDesc)
  329. {
  330. $aCols[] = "$sCol: $sFieldDesc";
  331. }
  332. if (count($aCols) > 0)
  333. {
  334. $sCols = implode(', ', $aCols);
  335. $aMoreInfo = array();
  336. $aMoreInfo[] = Dict::Format('UI:Schema:Columns_Description', $sCols);
  337. $aMoreInfo[] = Dict::Format('UI:Schema:Default_Description', $oAttDef->GetDefaultValue());
  338. $aMoreInfo[] = $oAttDef->IsNullAllowed() ? Dict::S('UI:Schema:NullAllowed') : Dict::S('UI:Schema:NullNotAllowed');
  339. $sMoreInfo .= implode(', ', $aMoreInfo);
  340. }
  341. if (is_object($oAllowedValuesDef)) $sAllowedValues = $oAllowedValuesDef->GetValuesDescription();
  342. else $sAllowedValues = '';
  343. $aDetails[] = array('code' => $oAttDef->GetCode(), 'type' => $sType, 'origin' => $sOrigin, 'label' => $oAttDef->GetLabel(), 'description' => $sValue, 'values' => $sAllowedValues, 'moreinfo' => $sMoreInfo);
  344. }
  345. $oPage->SetCurrentTab(Dict::S('UI:Schema:Attributes'));
  346. $aConfig = array( 'code' => array('label' => Dict::S('UI:Schema:AttributeCode'), 'description' => Dict::S('UI:Schema:AttributeCode+')),
  347. 'label' => array('label' => Dict::S('UI:Schema:Label'), 'description' => Dict::S('UI:Schema:Label+')),
  348. 'type' => array('label' => Dict::S('UI:Schema:Type'), 'description' => Dict::S('UI:Schema:Type+')),
  349. 'origin' => array('label' => Dict::S('UI:Schema:Origin'), 'description' => Dict::S('UI:Schema:Origin+')),
  350. 'description' => array('label' => Dict::S('UI:Schema:Description'), 'description' => Dict::S('UI:Schema:Description+')),
  351. 'values' => array('label' => Dict::S('UI:Schema:AllowedValues'), 'description' => Dict::S('UI:Schema:AllowedValues+')),
  352. 'moreinfo' => array('label' => Dict::S('UI:Schema:MoreInfo'), 'description' => Dict::S('UI:Schema:MoreInfo+')),
  353. );
  354. $oPage->table($aConfig, $aDetails);
  355. // List the search criteria for this object
  356. $aDetails = array();
  357. foreach (MetaModel::GetClassFilterDefs($sClass) as $sFilterCode => $oFilterDef)
  358. {
  359. $aOpDescs = array();
  360. foreach ($oFilterDef->GetOperators() as $sOpCode => $sOpDescription)
  361. {
  362. $sIsTheLooser = ($sOpCode == $oFilterDef->GetLooseOperator()) ? " (loose search)" : "";
  363. $aOpDescs[] = "$sOpCode ($sOpDescription)$sIsTheLooser";
  364. }
  365. $aDetails[] = array( 'code' => $sFilterCode, 'description' => $oFilterDef->GetLabel(),'operators' => implode(" / ", $aOpDescs));
  366. }
  367. $oPage->SetCurrentTab(Dict::S('UI:Schema:SearchCriteria'));
  368. $aConfig = array( 'code' => array('label' => Dict::S('UI:Schema:FilterCode'), 'description' => Dict::S('UI:Schema:FilterCode+')),
  369. 'description' => array('label' => Dict::S('UI:Schema:FilterDescription'), 'description' => Dict::S('UI:Schema:FilterDescription+')),
  370. 'operators' => array('label' => Dict::S('UI:Schema:AvailOperators'), 'description' => Dict::S('UI:Schema:AvailOperators+'))
  371. );
  372. $oPage->table($aConfig, $aDetails);
  373. $oPage->SetCurrentTab(Dict::S('UI:Schema:ChildClasses'));
  374. DisplaySubclasses($oPage, $sClass);
  375. $oPage->SetCurrentTab(Dict::S('UI:Schema:ReferencingClasses'));
  376. DisplayReferencingClasses($oPage, $sClass);
  377. $oPage->SetCurrentTab(Dict::S('UI:Schema:RelatedClasses'));
  378. DisplayRelatedClasses($oPage, $sClass);
  379. $oPage->SetCurrentTab(Dict::S('UI:Schema:LifeCycle'));
  380. DisplayLifecycle($oPage, $sClass);
  381. $oPage->SetCurrentTab(Dict::S('UI:Schema:Triggers'));
  382. DisplayTriggers($oPage, $sClass);
  383. $oPage->SetCurrentTab();
  384. $oPage->SetCurrentTabContainer();
  385. }
  386. /**
  387. * Display the details of a given relation (e.g. "impacts")
  388. */
  389. function DisplayRelationDetails($oPage, $sRelCode)
  390. {
  391. $sDesc = MetaModel::GetRelationProperty($sRelCode, 'description');
  392. $sVerbDown = MetaModel::GetRelationProperty($sRelCode, 'verb_down');
  393. $sVerbUp = MetaModel::GetRelationProperty($sRelCode, 'verb_up');
  394. $oPage->add("<h1>".Dict::Format('UI:Schema:Relation_Code_Description', $sRelCode, $sDesc)."</h1>");
  395. $oPage->p(Dict::Format('UI:Schema:RelationDown_Description', $sVerbDown));
  396. $oPage->p(Dict::Format('UI:Schema:RelationUp_Description', $sVerbUp));
  397. $oPage->add("<ul id=\"RelationshipDetails\" class=\"treeview\">\n");
  398. foreach(MetaModel::GetClasses() as $sClass)
  399. {
  400. $aRelQueries = MetaModel::EnumRelationQueries($sClass, $sRelCode);
  401. if (count($aRelQueries) > 0)
  402. {
  403. $oPage->add("<li>class ".MakeClassHLink($sClass)."\n");
  404. $oPage->add("<ul>\n");
  405. foreach ($aRelQueries as $sRelKey => $aQuery)
  406. {
  407. $sQuery = $aQuery['sQuery'];
  408. $iDistance = $aQuery['iDistance'];
  409. if ($aQuery['bPropagate'])
  410. {
  411. $oPage->add("<li>".Dict::Format('UI:Schema:RelationPropagates', $sRelKey, $iDistance, $sQuery)."</li>\n");
  412. }
  413. else
  414. {
  415. $oPage->add("<li>".Dict::Format('UI:Schema:RelationDoesNotPropagate', $sRelKey, $iDistance, $sQuery)."</li>\n");
  416. }
  417. }
  418. $oPage->add("</ul>\n");
  419. $oPage->add("</li>\n");
  420. }
  421. }
  422. $oPage->add_ready_script('$("#RelationshipDetails").treeview();');
  423. }
  424. require_once('../application/loginwebpage.class.inc.php');
  425. LoginWebPage::DoLogin(); // Check user rights and prompt if needed
  426. // Display the menu on the left
  427. $oContext = new UserContext();
  428. $oAppContext = new ApplicationContext();
  429. $iActiveNodeId = utils::ReadParam('menu', -1);
  430. $currentOrganization = utils::ReadParam('org_id', 1);
  431. $operation = utils::ReadParam('operation', '');
  432. $oPage = new iTopWebPage(Dict::S('UI:Schema:Title'), $currentOrganization);
  433. $oPage->no_cache();
  434. $operation = utils::ReadParam('operation', '');
  435. switch($operation)
  436. {
  437. case 'details_class':
  438. $sClass = utils::ReadParam('class', 'logRealObject');
  439. DisplayClassDetails($oPage, $sClass);
  440. break;
  441. case 'details_relation':
  442. $sRelCode = utils::ReadParam('relcode', '');
  443. DisplayRelationDetails($oPage, $sRelCode);
  444. break;
  445. case 'list':
  446. default:
  447. DisplayClassesList($oPage);
  448. }
  449. $oPage->output();
  450. ?>