modImport.class.php 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. /* Copyright (C) 2005-2009 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 import Module import
  20. * \brief Module to make generic import of data into dolibarr database
  21. * \file htdocs/core/modules/modImport.class.php
  22. * \ingroup import
  23. * \brief Description and activation file for the module Import
  24. */
  25. include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
  26. /**
  27. * Class to describe and enable module Import
  28. */
  29. class modImport 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 = 250;
  40. $this->family = "technic";
  41. $this->module_position = '70';
  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'imports de donnees Dolibarr (via un assistant)";
  45. // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' 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("/import/temp");
  51. // Config pages
  52. $this->config_page_url = array("import.php");
  53. // Dependencies
  54. $this->hidden = false; // A condition to hide module
  55. $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
  56. $this->requiredby = array(); // List of module ids to disable if this one is disabled
  57. $this->conflictwith = array(); // List of module class names as string this module is in conflict with
  58. $this->phpmin = array(5, 6); // Minimum version of PHP required by module - Need auto_detect_line_endings php option to solve MAC pbs.
  59. $this->phpmax = array();
  60. $this->need_dolibarr_version = array(2, 7, -1); // Minimum version of Dolibarr required by module
  61. $this->need_javascript_ajax = 1;
  62. // Constants
  63. $this->const = array();
  64. // Boxes
  65. $this->boxes = array();
  66. // Permissions
  67. $this->rights = array();
  68. $this->rights_class = 'import';
  69. $r = 0;
  70. $r++;
  71. $this->rights[$r][0] = 1251;
  72. $this->rights[$r][1] = 'Run mass imports of external data (data load)';
  73. $this->rights[$r][2] = 'r';
  74. $this->rights[$r][3] = 0;
  75. $this->rights[$r][4] = 'run';
  76. // Menus
  77. //-------
  78. $this->menu = 1; // This module add menu entries. They are coded into menu manager.
  79. }
  80. }