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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.1.0',
  5. array(
  6. // Identification
  7. //
  8. 'label' => 'Service Management for Service Providers',
  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' => 'ServiceMgmtProviderInstaller',
  19. // Components
  20. //
  21. 'datamodel' => array(
  22. 'model.itop-service-mgmt-provider.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('ServiceMgmtProviderInstaller'))
  51. {
  52. // Module installation handler
  53. //
  54. class ServiceMgmtProviderInstaller 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. // If you want to migrate data from one format to another, do it here
  72. self::RenameClassInDB('ServiceFamilly', 'ServiceFamily');
  73. self::RenameEnumValueInDB('SLT', 'request_type', 'servicerequest', 'service_request');
  74. }
  75. }
  76. /**
  77. * Handler called after the creation/update of the database schema
  78. * @param $oConfiguration Config The new configuration of the application
  79. * @param $sPreviousVersion string PRevious version number of the module (empty string in case of first install)
  80. * @param $sCurrentVersion string Current version number of the module
  81. */
  82. public static function AfterDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
  83. {
  84. }
  85. }
  86. }
  87. ?>