dolibarr 20.0.2
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 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 * or see https://www.gnu.org/
21 */
22
23
24
31require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
32require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
33
34
38abstract class ModelePDFMember extends CommonDocGenerator
39{
40 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
48 public static function liste_modeles($db, $maxfilenamelength = 0)
49 {
50 // phpcs:enable
51 $type = 'member';
52 $list = array();
53
54 include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
55 $list = getListOfModels($db, $type, $maxfilenamelength);
56 return $list;
57 }
58}
59
60
61
66{
74 public function getToolTip($langs, $soc)
75 {
76 global $conf;
77
78 $langs->loadLangs(array("admin", "companies"));
79
80 $strikestart = '';
81 $strikeend = '';
82 if (getDolGlobalString('MAIN_MEMBER_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
83 $strikestart = '<strike>';
84 $strikeend = '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
85 }
86
87 $s = '';
88 $s .= $langs->trans("Name").': <b>'.$this->getName($langs).'</b><br>';
89 $s .= $langs->trans("Version").': <b>'.$this->getVersion().'</b><br>';
90 $s .= $langs->trans("MemberCodeDesc").'<br>';
91 $s .= $langs->trans("ValidityControledByModule").': <b>'.$this->getName($langs).'</b><br>';
92 $s .= '<br>';
93 $s .= '<u>'.$langs->trans("ThisIsModuleRules").':</u><br>';
94
95 $s .= $langs->trans("Required").': '.$strikestart;
96 $s .= yn(!$this->code_null, 1, 2).$strikeend;
97 $s .= '<br>';
98 $s .= $langs->trans("CanBeModifiedIfOk").': ';
99 $s .= yn($this->code_modifiable, 1, 2);
100 $s .= '<br>';
101 $s .= $langs->trans("CanBeModifiedIfKo").': '.yn($this->code_modifiable_invalide, 1, 2).'<br>';
102 $s .= $langs->trans("AutomaticCode").': '.yn($this->code_auto, 1, 2).'<br>';
103 $s .= '<br>';
104 $nextval = $this->getNextValue($soc, 0);
105 if (empty($nextval)) {
106 $nextval = $langs->trans("Undefined");
107 }
108 $s .= $langs->trans("NextValue").' ('.$langs->trans("Member").'): <b>'.$nextval.'</b><br>';
109
110 return $s;
111 }
112
120 public function getNextValue($objsoc, $object)
121 {
122 return '';
123 }
124}
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
Parent class for documents (PDF, ODT, ...) generators.
Parent class for number ref generators.
getVersion()
Returns version of numbering module.
getName($langs)
Return model name.
Class 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.