modIntracommreport.class.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?php
  2. /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
  5. * Copyright (C) 2019 Open-DSI <support@open-dsi.fr>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. /**
  21. * \file htdocs/core/modules/modIntracommreport.class.php
  22. * \ingroup Intracomm report
  23. * \brief Description and activation file for the module intracomm report
  24. */
  25. include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
  26. /**
  27. * Description and activation class for module intracommreport
  28. */
  29. class modIntracommreport 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. global $conf, $langs;
  39. $this->db = $db;
  40. $this->numero = 68000;
  41. $this->family = "financial";
  42. $this->module_position = '60';
  43. // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
  44. $this->name = preg_replace('/^mod/i', '', get_class($this));
  45. $this->description = "Intracomm report management (Support for French DEB/DES format)";
  46. // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
  47. $this->version = 'experimental';
  48. $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
  49. $this->picto = 'intracommreport';
  50. // Data directories to create when module is enabled
  51. $this->dirs = array('/intracommreport/temp');
  52. // Config pages
  53. $this->config_page_url = array("intracommreport.php@intracommreport");
  54. // Dependencies
  55. $this->depends = array("modFacture", "modTax", "modCategorie"); // List of modules id that must be enabled if this module is enabled
  56. $this->requiredby = array(); // List of modules id to disable if this one is disabled
  57. $this->conflictwith = array(); // List of modules id this module is in conflict with
  58. $this->phpmin = array(5, 6); // Minimum version of PHP required by module
  59. $this->need_dolibarr_version = array(13, 0, -5); // Minimum version of Dolibarr required by module
  60. $this->langfiles = array("intracommreport");
  61. // Constants
  62. // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
  63. // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',1),
  64. // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1)
  65. // );
  66. $this->const = array();
  67. // Tabs
  68. $this->tabs = array();
  69. // Css
  70. $this->module_parts = array();
  71. // Boxes
  72. $this->boxes = array();
  73. // Dictionaries
  74. if (!isset($conf->intracommreport->enabled)) {
  75. $conf->intracommreport = new stdClass();
  76. $conf->intracommreport->enabled = 0;
  77. }
  78. $this->dictionaries = array();
  79. // Permissions
  80. $this->rights = array();
  81. $this->rights_class = 'intracommreport';
  82. $r = 0;
  83. $r++;
  84. $this->rights[$r][0] = 68001;
  85. $this->rights[$r][1] = 'Read intracomm report';
  86. $this->rights[$r][2] = 'r';
  87. $this->rights[$r][3] = 0;
  88. $this->rights[$r][4] = 'read';
  89. $r++;
  90. $this->rights[$r][0] = 68002;
  91. $this->rights[$r][1] = 'Create/modify intracomm report';
  92. $this->rights[$r][2] = 'w';
  93. $this->rights[$r][3] = 0;
  94. $this->rights[$r][4] = 'write';
  95. $r++;
  96. $this->rights[$r][0] = 68004;
  97. $this->rights[$r][1] = 'Delete intracomm report';
  98. $this->rights[$r][2] = 'd';
  99. $this->rights[$r][3] = 0;
  100. $this->rights[$r][4] = 'delete';
  101. // Main menu entries
  102. $this->menu = array(); // List of menus to add
  103. $r = 0;
  104. // Exports
  105. $r = 1;
  106. }
  107. }