1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* Copyright (C) 2018 Laurent Destailleur <[email protected]> |
4
|
|
|
* Copyright (C) 2024 Rafael San José <[email protected]> |
5
|
|
|
* |
6
|
|
|
* This program is free software; you can redistribute it and/or modify |
7
|
|
|
* it under the terms of the GNU General Public License as published by |
8
|
|
|
* the Free Software Foundation; either version 3 of the License, or |
9
|
|
|
* (at your option) any later version. |
10
|
|
|
* |
11
|
|
|
* This program is distributed in the hope that it will be useful, |
12
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14
|
|
|
* GNU General Public License for more details. |
15
|
|
|
* |
16
|
|
|
* You should have received a copy of the GNU General Public License |
17
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
18
|
|
|
* or see https://www.gnu.org/ |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace Dolibarr\Code\Stock\Classes; |
22
|
|
|
|
23
|
|
|
use Dolibarr\Code\Core\Classes\CommonDocGenerator; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Parent class for stock models of doc generators |
27
|
|
|
*/ |
28
|
|
|
abstract class ModelePDFStock extends CommonDocGenerator |
29
|
|
|
{ |
30
|
|
|
/** |
31
|
|
|
* @var DoliDB Database handler |
|
|
|
|
32
|
|
|
*/ |
33
|
|
|
public $db; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var string model name |
37
|
|
|
*/ |
38
|
|
|
public $name; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var string model description (short text) |
42
|
|
|
*/ |
43
|
|
|
public $description; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @var string document type |
47
|
|
|
*/ |
48
|
|
|
public $type; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @var string Dolibarr version of the loaded document |
52
|
|
|
*/ |
53
|
|
|
public $version = 'dolibarr'; |
54
|
|
|
|
55
|
|
|
|
56
|
|
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Return list of active generation modules |
60
|
|
|
* |
61
|
|
|
* @param DoliDB $db Database handler |
62
|
|
|
* @param integer $maxfilenamelength Max length of value to show |
63
|
|
|
* @return array List of templates |
64
|
|
|
*/ |
65
|
|
|
public static function liste_modeles($db, $maxfilenamelength = 0) |
66
|
|
|
{ |
67
|
|
|
// phpcs:enable |
68
|
|
|
$type = 'stock'; |
69
|
|
|
$list = array(); |
70
|
|
|
|
71
|
|
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
72
|
|
|
$list = getListOfModels($db, $type, $maxfilenamelength); |
73
|
|
|
|
74
|
|
|
return $list; |
|
|
|
|
75
|
|
|
} |
76
|
|
|
} |
77
|
|
|
|