module.itop-service-mgmt.php 2.6 KB

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