module.itop-knownerror-mgmt.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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-knownerror-mgmt/2.0.0',
  5. array(
  6. // Identification
  7. //
  8. 'label' => 'Known Errors Database',
  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' => 'KnownErrorMgmtInstaller',
  19. // Components
  20. //
  21. 'datamodel' => array(
  22. 'model.itop-knownerror-mgmt.php',
  23. ),
  24. 'data.struct' => array(
  25. //'data.struct.itop-knownerror-mgmt.xml',
  26. ),
  27. 'data.sample' => array(
  28. //'data.sample.itop-knownerror-mgmt.xml',
  29. ),
  30. // Documentation
  31. //
  32. 'doc.manual_setup' => '', // No manual installation instructions
  33. 'doc.more_information' => '',
  34. // Default settings
  35. //
  36. 'settings' => array(
  37. ),
  38. )
  39. );
  40. if (!class_exists('KnownErrorMgmtInstaller'))
  41. {
  42. // Module installation handler
  43. //
  44. class KnownErrorMgmtInstaller extends ModuleInstallerAPI
  45. {
  46. public static function BeforeWritingConfig(Config $oConfiguration)
  47. {
  48. // If you want to override/force some configuration values, do it here
  49. return $oConfiguration;
  50. }
  51. /**
  52. * Handler called before creating or upgrading the database schema
  53. * @param $oConfiguration Config The new configuration of the application
  54. * @param $sPreviousVersion string PRevious version number of the module (empty string in case of first install)
  55. * @param $sCurrentVersion string Current version number of the module
  56. */
  57. public static function BeforeDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
  58. {
  59. if (strlen($sPreviousVersion) > 0)
  60. {
  61. // If you want to migrate data from one format to another, do it here
  62. self::RenameClassInDB('FAQcategory', 'FAQCategory');
  63. }
  64. }
  65. /**
  66. * Handler called after the creation/update of the database schema
  67. * @param $oConfiguration Config The new configuration of the application
  68. * @param $sPreviousVersion string PRevious version number of the module (empty string in case of first install)
  69. * @param $sCurrentVersion string Current version number of the module
  70. */
  71. public static function AfterDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
  72. {
  73. }
  74. }
  75. }
  76. ?>