Passed
Push — GENERAL_BUG_REVIEW_240911 ( c757bd...0ad96d )
by Rafael
45:56
created

ModeleNumRefKnowledgeRecord::getExample()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
/* Copyright (C) 2003-2004  Rodolphe Quiedeville        <[email protected]>
4
 * Copyright (C) 2004-2011  Laurent Destailleur         <[email protected]>
5
 * Copyright (C) 2004       Eric Seigne                 <[email protected]>
6
 * Copyright (C) 2005-2012  Regis Houssin               <[email protected]>
7
 * Copyright (C) 2006       Andre Cianfarani            <[email protected]>
8
 * Copyright (C) 2012       Juanjo Menent	            <[email protected]>
9
 * Copyright (C) 2014       Marcos García               <[email protected]>
10
 * Copyright (C) 2024       Rafael San José             <[email protected]>
11
 *
12
 * This program is free software; you can redistribute it and/or modify
13
 * it under the terms of the GNU General Public License as published by
14
 * the Free Software Foundation; either version 3 of the License, or
15
 * (at your option) any later version.
16
 *
17
 * This program is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 * GNU General Public License for more details.
21
 *
22
 * You should have received a copy of the GNU General Public License
23
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
24
 * or see https://www.gnu.org/
25
 */
26
27
namespace Dolibarr\Code\KnowledgeManagement\Classes;
28
29
/**
30
 *  \file           htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php
31
 *  \ingroup        knowledgemanagement
32
 *  \brief          File that contains parent class for knowledgerecords document models and parent class for knowledgerecords numbering models
33
 */
34
35
/**
36
 *  Parent class to manage numbering of KnowledgeRecord
37
 */
38
abstract class ModeleNumRefKnowledgeRecord
39
{
40
    /**
41
     * @var string Error code (or message)
42
     */
43
    public $error = '';
44
45
    /**
46
     *  Return if a module can be used or not
47
     *
48
     * @return     boolean     true if module can be used
49
     */
50
    public function isEnabled()
51
    {
52
        return true;
53
    }
54
55
    /**
56
     *  Returns the default description of the numbering template
57
     *
58
     * @return     string      Descriptive text
59
     */
60
    public function info()
61
    {
62
        global $langs;
63
        $langs->load("knowledgemanagement");
64
        return $langs->trans("NoDescription");
65
    }
66
67
    /**
68
     *  Returns an example of numbering
69
     *
70
     * @return     string      Example
71
     */
72
    public function getExample()
73
    {
74
        global $langs;
75
        $langs->load("knowledgemanagement");
76
        return $langs->trans("NoExample");
77
    }
78
79
    /**
80
     *  Checks if the numbers already in the database do not
81
     *  cause conflicts that would prevent this numbering working.
82
     *
83
     * @param Object $object Object we need next value for
84
     * @return boolean                 false if conflict, true if ok
85
     */
86
    public function canBeActivated($object)
87
    {
88
        return true;
89
    }
90
91
    /**
92
     *  Returns next assigned value
93
     *
94
     * @param Object $object Object we need next value for
95
     * @return string      Valeur
96
     */
97
    public function getNextValue($object)
98
    {
99
        global $langs;
100
        return $langs->trans("NotAvailable");
101
    }
102
103
    /**
104
     *  Returns version of numbering module
105
     *
106
     * @return     string      Valeur
107
     */
108
    public function getVersion()
109
    {
110
        return DOL_VERSION;
111
    }
112
}
113