dolibarr 19.0.4
modules_member.class.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
5 * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
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 <https://www.gnu.org/licenses/>.
19 * or see https://www.gnu.org/
20 */
21
22
23
30require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
31require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
32
33
37abstract class ModelePDFMember extends CommonDocGenerator
38{
39 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
47 public static function liste_modeles($db, $maxfilenamelength = 0)
48 {
49 // phpcs:enable
50 $type = 'member';
51 $list = array();
52
53 include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
54 $list = getListOfModels($db, $type, $maxfilenamelength);
55 return $list;
56 }
57}
58
59
60
65{
66 public $code_modifiable; // Editable code
67
68 public $code_modifiable_invalide; // Modified code if it is invalid
69
70 public $code_modifiable_null; // Modified code if it is null
71
72 public $code_null; //
73
74 public $code_auto;
75
76
84 public function getToolTip($langs, $soc)
85 {
86 global $conf;
87
88 $langs->loadLangs(array("admin", "companies"));
89
90 $strikestart = '';
91 $strikeend = '';
92 if (getDolGlobalString('MAIN_MEMBER_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
93 $strikestart = '<strike>';
94 $strikeend = '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
95 }
96
97 $s = '';
98 $s .= $langs->trans("Name").': <b>'.$this->getName($langs).'</b><br>';
99 $s .= $langs->trans("Version").': <b>'.$this->getVersion().'</b><br>';
100 $s .= $langs->trans("MemberCodeDesc").'<br>';
101 $s .= $langs->trans("ValidityControledByModule").': <b>'.$this->getName($langs).'</b><br>';
102 $s .= '<br>';
103 $s .= '<u>'.$langs->trans("ThisIsModuleRules").':</u><br>';
104
105 $s .= $langs->trans("Required").': '.$strikestart;
106 $s .= yn(!$this->code_null, 1, 2).$strikeend;
107 $s .= '<br>';
108 $s .= $langs->trans("CanBeModifiedIfOk").': ';
109 $s .= yn($this->code_modifiable, 1, 2);
110 $s .= '<br>';
111 $s .= $langs->trans("CanBeModifiedIfKo").': '.yn($this->code_modifiable_invalide, 1, 2).'<br>';
112 $s .= $langs->trans("AutomaticCode").': '.yn($this->code_auto, 1, 2).'<br>';
113 $s .= '<br>';
114 $nextval = $this->getNextValue($soc, 0);
115 if (empty($nextval)) {
116 $nextval = $langs->trans("Undefined");
117 }
118 $s .= $langs->trans("NextValue").' ('.$langs->trans("Member").'): <b>'.$nextval.'</b><br>';
119
120 return $s;
121 }
122
130 public function getNextValue($objsoc, $object)
131 {
132 return '';
133 }
134}
Parent class for documents (PDF, ODT, ...) generators.
Parent class for number ref generators.
getVersion()
Returns version of numbering module.
getName($langs)
Return model name.
Classe mere des modeles de numerotation des references de members.
getToolTip($langs, $soc)
Return description of module parameters.
getNextValue($objsoc, $object)
Return next value.
Parent class to manage intervention document templates.
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.