module.itop-endusers-devices.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. // Copyright (C) 2010 Combodo SARL
  3. //
  4. // This program is free software; you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation; version 3 of the License.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program; if not, write to the Free Software
  15. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. SetupWebPage::AddModule(
  17. __FILE__, // Path to the current file, all other file names are relative to the directory containing this file
  18. 'itop-endusers-devices/2.0.0',
  19. array(
  20. // Identification
  21. //
  22. 'label' => 'End User Devices management',
  23. 'category' => 'business',
  24. // Setup
  25. //
  26. 'dependencies' => array(
  27. 'itop-config-mgmt/2.0.0'
  28. ),
  29. 'mandatory' => false,
  30. 'visible' => true,
  31. 'installer' => 'EndUserMgmtInstaller',
  32. // Components
  33. //
  34. 'datamodel' => array(
  35. 'model.itop-endusers-devices.php'
  36. ),
  37. 'webservice' => array(
  38. ),
  39. 'data.struct' => array(
  40. // add your 'structure' definition XML files here,
  41. ),
  42. 'data.sample' => array(
  43. // add your sample data XML files here,
  44. ),
  45. // Documentation
  46. //
  47. 'doc.manual_setup' => '', // hyperlink to manual setup documentation, if any
  48. 'doc.more_information' => '', // hyperlink to more information, if any
  49. // Default settings
  50. //
  51. 'settings' => array(
  52. // Module specific settings go here, if any
  53. ),
  54. )
  55. );
  56. if (!class_exists('EndUserMgmtInstaller'))
  57. {
  58. // Module installation handler
  59. //
  60. class EndUserMgmtInstaller extends ModuleInstallerAPI
  61. {
  62. public static function BeforeWritingConfig(Config $oConfiguration)
  63. {
  64. // If you want to override/force some configuration values, do it here
  65. return $oConfiguration;
  66. }
  67. /**
  68. * Handler called before creating or upgrading the database schema
  69. * @param $oConfiguration Config The new configuration of the application
  70. * @param $sPreviousVersion string PRevious version number of the module (empty string in case of first install)
  71. * @param $sCurrentVersion string Current version number of the module
  72. */
  73. public static function BeforeDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
  74. {
  75. if (strlen($sPreviousVersion) > 0)
  76. {
  77. // If you want to migrate data from one format to another, do it here
  78. self::RenameClassInDB('IpPhone', 'IPPhone');
  79. }
  80. }
  81. /**
  82. * Handler called after the creation/update of the database schema
  83. * @param $oConfiguration Config The new configuration of the application
  84. * @param $sPreviousVersion string PRevious version number of the module (empty string in case of first install)
  85. * @param $sCurrentVersion string Current version number of the module
  86. */
  87. public static function AfterDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
  88. {
  89. }
  90. }
  91. }
  92. ?>