modExport.class.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. /* Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. /**
  19. * \defgroup export Module export
  20. * \brief Module generique pour realiser des exports de donnees en base
  21. * \file htdocs/core/modules/modExport.class.php
  22. * \ingroup export
  23. * \brief Description and activation file for the module export
  24. */
  25. include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
  26. /**
  27. * Class to describe and enable module export
  28. */
  29. class modExport extends DolibarrModules
  30. {
  31. /**
  32. * Constructor. Define names, constants, directories, boxes, permissions
  33. *
  34. * @param DoliDB $db Database handler
  35. */
  36. public function __construct($db)
  37. {
  38. $this->db = $db;
  39. $this->numero = 240;
  40. $this->family = "technic";
  41. $this->module_position = '72';
  42. // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
  43. $this->name = preg_replace('/^mod/i', '', get_class($this));
  44. $this->description = "Outils d'exports de donnees Dolibarr (via un assistant)";
  45. // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
  46. $this->version = 'dolibarr';
  47. $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
  48. $this->picto = 'technic';
  49. // Data directories to create when module is enabled
  50. $this->dirs = array("/export/temp");
  51. // Config pages
  52. $this->config_page_url = array("export.php");
  53. // Dependencies
  54. $this->depends = array();
  55. $this->requiredby = array();
  56. $this->phpmin = array(4, 2, 0);
  57. $this->phpmax = array();
  58. // Constants
  59. $this->const = array();
  60. // Boxes
  61. $this->boxes = array();
  62. // Permissions
  63. $this->rights = array();
  64. $this->rights_class = 'export';
  65. $r = 0;
  66. $r++;
  67. $this->rights[$r][0] = 1201;
  68. $this->rights[$r][1] = 'Read exports';
  69. $this->rights[$r][2] = 'r';
  70. $this->rights[$r][3] = 0;
  71. $this->rights[$r][4] = 'lire';
  72. $r++;
  73. $this->rights[$r][0] = 1202;
  74. $this->rights[$r][1] = 'Creeate/modify export';
  75. $this->rights[$r][2] = 'w';
  76. $this->rights[$r][3] = 0;
  77. $this->rights[$r][4] = 'creer';
  78. // Menus
  79. //-------
  80. $this->menu = 1; // This module add menu entries. They are coded into menu manager.
  81. }
  82. }