dolibarr 21.0.0-alpha
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 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 * or see https://www.gnu.org/
22 */
23
24
25
32require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
33require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
34
35
39abstract class ModelePDFMember extends CommonDocGenerator
40{
41 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
49 public static function liste_modeles($db, $maxfilenamelength = 0)
50 {
51 // phpcs:enable
52 $type = 'member';
53 $list = array();
54
55 include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
56 $list = getListOfModels($db, $type, $maxfilenamelength);
57 return $list;
58 }
59
60
61 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
73 abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $mode = 'member', $nooutput = 0, $filename = 'tmp_cards');
74 // phpcs:enable
75}
76
77
78
83{
91 public function getToolTip($langs, $soc)
92 {
93 $langs->loadLangs(array("admin", "companies"));
94
95 $strikestart = '';
96 $strikeend = '';
97 if (getDolGlobalString('MAIN_MEMBER_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
98 $strikestart = '<strike>';
99 $strikeend = '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
100 }
101
102 $s = '';
103 $s .= $langs->trans("Name").': <b>'.$this->getName($langs).'</b><br>';
104 $s .= $langs->trans("Version").': <b>'.$this->getVersion().'</b><br>';
105 $s .= $langs->trans("MemberCodeDesc").'<br>';
106 $s .= $langs->trans("ValidityControledByModule").': <b>'.$this->getName($langs).'</b><br>';
107 $s .= '<br>';
108 $s .= '<u>'.$langs->trans("ThisIsModuleRules").':</u><br>';
109
110 $s .= $langs->trans("Required").': '.$strikestart;
111 $s .= yn($this->code_null ? 0 : 1, 1, 2).$strikeend;
112 $s .= '<br>';
113 $s .= $langs->trans("CanBeModifiedIfOk").': ';
114 $s .= yn($this->code_modifiable, 1, 2);
115 $s .= '<br>';
116 $s .= $langs->trans("CanBeModifiedIfKo").': '.yn($this->code_modifiable_invalide, 1, 2).'<br>';
117 $s .= $langs->trans("AutomaticCode").': '.yn($this->code_auto, 1, 2).'<br>';
118 $s .= '<br>';
119 $nextval = $this->getNextValue($soc, null);
120 if (empty($nextval)) {
121 $nextval = $langs->trans("Undefined");
122 }
123 $s .= $langs->trans("NextValue").' ('.$langs->trans("Member").'): <b>'.$nextval.'</b><br>';
124
125 return $s;
126 }
127
135 public function getNextValue($objsoc, $object)
136 {
137 return '';
138 }
139
145 abstract public function getExample();
146}
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.
getExample()
Return an example of numbering.
Parent class to manage intervention document templates.
write_file($object, $outputlangs, $srctemplatepath='', $mode='member', $nooutput=0, $filename='tmp_cards')
Function to build a document.
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, $format=1, $color=0)
Return yes or no in current language.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.