module.itop-service-mgmt.php 2.6 KB

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