modules_stock.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
  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. * or see https://www.gnu.org/
  17. */
  18. require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
  19. /**
  20. * Parent class for stock models of doc generators
  21. */
  22. abstract class ModelePDFStock extends CommonDocGenerator
  23. {
  24. /**
  25. * @var string Error code (or message)
  26. */
  27. public $error = '';
  28. /**
  29. * @var int page_largeur
  30. */
  31. public $page_largeur;
  32. /**
  33. * @var int page_hauteur
  34. */
  35. public $page_hauteur;
  36. /**
  37. * @var array format
  38. */
  39. public $format;
  40. /**
  41. * @var int marge_gauche
  42. */
  43. public $marge_gauche;
  44. /**
  45. * @var int marge_droite
  46. */
  47. public $marge_droite;
  48. /**
  49. * @var int marge_haute
  50. */
  51. public $marge_haute;
  52. /**
  53. * @var int marge_basse
  54. */
  55. public $marge_basse;
  56. // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
  57. /**
  58. * Return list of active generation modules
  59. *
  60. * @param DoliDB $db Database handler
  61. * @param integer $maxfilenamelength Max length of value to show
  62. * @return array List of templates
  63. */
  64. public static function liste_modeles($db, $maxfilenamelength = 0)
  65. {
  66. // phpcs:enable
  67. global $conf;
  68. $type = 'stock';
  69. $list = array();
  70. include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  71. $list = getListOfModels($db, $type, $maxfilenamelength);
  72. return $list;
  73. }
  74. }