module.itop-service-mgmt.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. SetupWebPage::AddModule(
  3. __FILE__, // Path to the current file, all other file names are relative to the directory containing this file
  4. 'itop-service-mgmt/2.1.0',
  5. array(
  6. // Identification
  7. //
  8. 'label' => 'Service Management',
  9. 'category' => 'business',
  10. // Setup
  11. //
  12. 'dependencies' => array(
  13. 'itop-config-mgmt/2.0.0',
  14. 'itop-tickets/2.0.0',
  15. ),
  16. 'mandatory' => false,
  17. 'visible' => true,
  18. 'installer' => 'ServiceMgmtInstaller',
  19. // Components
  20. //
  21. 'datamodel' => array(
  22. 'model.itop-service-mgmt.php',
  23. ),
  24. 'data.struct' => array(
  25. //'data.struct.itop-service-mgmt.xml',
  26. ),
  27. 'data.sample' => array(
  28. 'data.sample.organizations.xml',
  29. 'data.sample.contracts.xml',
  30. 'data.sample.services.xml',
  31. 'data.sample.serviceelements.xml',
  32. 'data.sample.sla.xml',
  33. 'data.sample.slt.xml',
  34. 'data.sample.sltsla.xml',
  35. // 'data.sample.coveragewindows.xml',
  36. 'data.sample.contractservice.xml',
  37. // 'data.sample.deliverymodel.xml',
  38. 'data.sample.deliverymodelcontact.xml',
  39. ),
  40. // Documentation
  41. //
  42. 'doc.manual_setup' => '',
  43. 'doc.more_information' => '',
  44. // Default settings
  45. //
  46. 'settings' => array(
  47. ),
  48. )
  49. );
  50. if (!class_exists('ServiceMgmtInstaller'))
  51. {
  52. // Module installation handler
  53. //
  54. class ServiceMgmtInstaller extends ModuleInstallerAPI
  55. {
  56. public static function BeforeWritingConfig(Config $oConfiguration)
  57. {
  58. // If you want to override/force some configuration values, do it here
  59. return $oConfiguration;
  60. }
  61. /**
  62. * Handler called before creating or upgrading the database schema
  63. * @param $oConfiguration Config The new configuration of the application
  64. * @param $sPreviousVersion string PRevious version number of the module (empty string in case of first install)
  65. * @param $sCurrentVersion string Current version number of the module
  66. */
  67. public static function BeforeDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
  68. {
  69. if (strlen($sPreviousVersion) > 0)
  70. {
  71. self::RenameEnumValueInDB('SLT', 'request_type', 'servicerequest', 'service_request');
  72. }
  73. }
  74. /**
  75. * Handler called after the creation/update of the database schema
  76. * @param $oConfiguration Config The new configuration of the application
  77. * @param $sPreviousVersion string PRevious version number of the module (empty string in case of first install)
  78. * @param $sCurrentVersion string Current version number of the module
  79. */
  80. public static function AfterDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
  81. {
  82. }
  83. }
  84. }
  85. ?>