module.itop-service-mgmt-provider.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-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' => 'ServiceMgmtInstaller',
  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.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. // If you want to migrate data from one format to another, do it here
  70. self::RenameClassInDB('ServiceFamilly', 'ServiceFamily');
  71. }
  72. }
  73. /**
  74. * Handler called after the creation/update of the database schema
  75. * @param $oConfiguration Config The new configuration of the application
  76. * @param $sPreviousVersion string PRevious version number of the module (empty string in case of first install)
  77. * @param $sCurrentVersion string Current version number of the module
  78. */
  79. public static function AfterDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
  80. {
  81. }
  82. }
  83. }
  84. ?>