module.itop-service-mgmt-provider.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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-provider/2.0.0',
  5. array(
  6. // Identification
  7. //
  8. 'label' => 'Service Management (services, SLAs, contracts) for Service providers',
  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' => 'ServiceMgmtProviderInstaller',
  18. // Components
  19. //
  20. 'datamodel' => array(
  21. 'model.itop-service-mgmt-provider.php',
  22. ),
  23. 'data.struct' => array(
  24. //'data.struct.itop-service-mgmt.xml',
  25. ),
  26. 'data.sample' => array(
  27. 'data.sample.organizations.xml',
  28. 'data.sample.contracts.xml',
  29. 'data.sample.services.xml',
  30. 'data.sample.serviceelements.xml',
  31. 'data.sample.sla.xml',
  32. 'data.sample.slt.xml',
  33. 'data.sample.sltsla.xml',
  34. // 'data.sample.coveragewindows.xml',
  35. 'data.sample.contractservice.xml',
  36. // 'data.sample.deliverymodel.xml',
  37. 'data.sample.deliverymodelcontact.xml',
  38. ),
  39. // Documentation
  40. //
  41. 'doc.manual_setup' => '',
  42. 'doc.more_information' => '',
  43. // Default settings
  44. //
  45. 'settings' => array(
  46. ),
  47. )
  48. );
  49. if (!class_exists('ServiceMgmtProviderInstaller'))
  50. {
  51. // Module installation handler
  52. //
  53. class ServiceMgmtProviderInstaller extends ModuleInstallerAPI
  54. {
  55. public static function BeforeWritingConfig(Config $oConfiguration)
  56. {
  57. // If you want to override/force some configuration values, do it here
  58. return $oConfiguration;
  59. }
  60. /**
  61. * Handler called before creating or upgrading the database schema
  62. * @param $oConfiguration Config The new configuration of the application
  63. * @param $sPreviousVersion string PRevious version number of the module (empty string in case of first install)
  64. * @param $sCurrentVersion string Current version number of the module
  65. */
  66. public static function BeforeDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
  67. {
  68. if (strlen($sPreviousVersion) > 0)
  69. {
  70. // If you want to migrate data from one format to another, do it here
  71. self::RenameClassInDB('ServiceFamilly', 'ServiceFamily');
  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. ?>