modDynamicPrices.class.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /* Copyright (C) 2014 Ion Agorria <ion@agorria.com>
  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; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \defgroup produit Module dynamic prices
  19. * \brief Module to manage dynamic prices in products
  20. * \file htdocs/core/modules/modDynamicPrices.class.php
  21. * \ingroup produit
  22. * \brief Description and activation file for the module to manage dynamic prices in products
  23. */
  24. include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
  25. /**
  26. * Class descriptor of DynamicPrices module
  27. */
  28. class modDynamicPrices extends DolibarrModules
  29. {
  30. /**
  31. * Constructor. Define names, constants, directories, boxes, permissions
  32. *
  33. * @param DoliDB $db Database handler
  34. */
  35. public function __construct($db)
  36. {
  37. $this->db = $db;
  38. $this->numero = 2200;
  39. $this->family = "products";
  40. $this->module_position = '85';
  41. // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
  42. $this->name = preg_replace('/^mod/i', '', get_class($this));
  43. $this->description = "Enable the usage of math expressions for prices";
  44. // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
  45. $this->version = 'experimental';
  46. // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
  47. $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
  48. // Name of image file used for this module.
  49. $this->picto = 'dynamicprice';
  50. // Data directories to create when module is enabled
  51. $this->dirs = array();
  52. // Config pages
  53. //-------------
  54. $this->config_page_url = array("dynamic_prices.php@product");
  55. // Dependancies
  56. //-------------
  57. $this->depends = array();
  58. $this->requiredby = array();
  59. $this->langfiles = array("other");
  60. // Constants
  61. //-----------
  62. $this->const = array();
  63. // New pages on tabs
  64. // -----------------
  65. $this->tabs = array();
  66. // Boxes
  67. //------
  68. $this->boxes = array();
  69. // Permissions
  70. //------------
  71. $this->rights = array();
  72. $this->rights_class = 'dynamicprices';
  73. $r = 0;
  74. }
  75. }