dolibarr 25.0.0-alpha
html_cerfafr.modules.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
6 * Copyright (C) 2014-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
7 * Copyright (C) 2015 Benoit Bruchard <benoitb21@gmail.com>
8 * Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
9 * Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 */
24
30require_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php';
31require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
32require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
33require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
34
35
40{
46 public function __construct($db)
47 {
48 global $langs;
49
50 $this->db = $db;
51 $this->name = "cerfafr";
52 $this->description = $langs->trans('DonationsReceiptModel').' - fr_FR - Cerfa 11580*04';
53
54 // Dimension page for size A4
55 $this->type = 'html';
56 }
57
58
64 public function isEnabled()
65 {
66 return true;
67 }
68
69
70 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
79 public function write_file($don, $outputlangs, $currency = '')
80 {
81 // phpcs:enable
82 global $user, $conf, $langs, $mysoc;
83
84 $now = dol_now();
85 $id = (!is_object($don) ? $don : '');
86
87 if (!is_object($outputlangs)) {
88 $outputlangs = $langs;
89 }
90
91 // Load traductions files required by page
92 $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "donations"));
93
94 $currency = !empty($currency) ? $currency : $conf->currency;
95
96 if (!empty($conf->don->dir_output)) {
97 // Definition of the object don (for upward compatibility)
98 if (!is_object($don)) {
99 $don = new Don($this->db);
100 $ret = $don->fetch($id);
101 $id = $don->id;
102 }
103
104 // Definition of $dir and $file
105 if (!empty($don->specimen)) {
106 $dir = $conf->don->dir_output;
107 $file = $dir."/SPECIMEN.html";
108 } else {
109 $donref = dol_sanitizeFileName((string) $don->ref);
110 $dir = $conf->don->dir_output."/".$donref;
111 $file = $dir."/".$donref.".html";
112 }
113
114 if (!file_exists($dir)) {
115 if (dol_mkdir($dir) < 0) {
116 $this->error = $langs->trans("ErrorCanNotCreateDir", $dir);
117 return -1;
118 }
119 }
120
121 if (file_exists($dir)) {
122 $formclass = new Form($this->db);
123
124 // This is not the proper way to do it but $formclass->form_modes_reglement
125 // prints the translation instead of returning it
126 $formclass->load_cache_types_paiements();
127 // Don::fetch() stores the payment mode into mode_reglement_id. The modepaymentid property is only
128 // set by the create/update forms, so it is always empty when the document is built from a fetched
129 // donation and no payment mode checkbox was ever ticked on the receipt.
130 $modepaymentid = !empty($don->mode_reglement_id) ? $don->mode_reglement_id : $don->modepaymentid;
131 if ($modepaymentid) {
132 $paymentmode = !empty($formclass->cache_types_paiements[(int) $modepaymentid]['label']) ? $formclass->cache_types_paiements[$modepaymentid]['label'] : '';
133 } else {
134 $paymentmode = '';
135 }
136 $modepaymentcode = !empty($formclass->cache_types_paiements[(int) $modepaymentid]['code']) ? $formclass->cache_types_paiements[(int) $modepaymentid]['code'] : "";
137 if ($modepaymentcode == 'CHQ') {
138 $ModePaiement = '<td width="25%"><input type="checkbox"> Remise d\'espèces</td><td width="25%"><input type="checkbox" disabled="true" checked="checked"> Chèque</td><td width="50%"><input type="checkbox"> Virement, prélèvement, carte bancaire</td>';
139 } elseif ($modepaymentcode == 'LIQ') {
140 $ModePaiement = '<td width="25%"><input type="checkbox" checked="checked"> Remise d\'espèces</td><td width="25%"><input type="checkbox"> Chèque</td><td width="50%"><input type="checkbox"> Virement, prélèvement, carte bancaire</td>';
141 } elseif ($modepaymentcode == 'VIR' || $modepaymentcode == 'PRE' || $modepaymentcode == 'CB') {
142 $ModePaiement = '<td width="25%"><input type="checkbox"> Remise d\'espèces</td><td width="25%"><input type="checkbox"> Chèque</td><td width="50%"><input type="checkbox" checked="checked"> Virement, prélèvement, carte bancaire</td>';
143 } else {
144 $ModePaiement = '<td width="25%"><input type="checkbox"> Remise d\'espèces</td><td width="25%"><input type="checkbox"> Chèque</td><td width="50%"><input type="checkbox"> Virement, prélèvement, carte bancaire</td>';
145 }
146
147 /*
148 if (empty($don->societe))
149 {
150 $CodeDon = '<td width="33%"><input type="checkbox" disabled="true" checked="checked" > 200 du CGI</td><td width="33%"><input type="checkbox" disabled="true" > 238 bis du CGI</td><td width="33%"><input type="checkbox" disabled="true" > 978 du CGI</td>';
151 }
152 else
153 {
154 $CodeDon = '<td width="33%"><input type="checkbox" disabled="true" > 200 du CGI</td><td width="33%"><input type="checkbox" disabled="true" checked="checked" > 238 bis du CGI</td><td width="33%"><input type="checkbox" disabled="true" > 978 du CGI</td>';
155 }
156 */
157 // Donator identity.
158 // When option DONATION_USE_THIRDPARTIES is on, the donation form does not show the name/address
159 // inputs at all, so llx_don only holds fk_soc and every donator field stays empty. The receipt
160 // would then be issued without the mandatory identity of the donator, so fall back on the linked
161 // third party for each field left empty.
162 $donatorsociete = (string) $don->societe;
163 $donatorlastname = (string) $don->lastname;
164 $donatorfirstname = (string) $don->firstname;
165 $donatoraddress = (string) $don->address;
166 $donatorzip = (string) $don->zip;
167 $donatortown = (string) $don->town;
168
169 if (!empty($don->socid) && $don->socid > 0) {
170 $donatorthirdparty = new Societe($this->db);
171 if ($donatorthirdparty->fetch($don->socid) > 0) {
172 if (dol_strlen(trim($donatorsociete.$donatorlastname.$donatorfirstname)) == 0) {
173 // A third party holds a single name field, even for a private individual, so it goes
174 // to the "Name" cell of the form and the "Firstname" cell is left empty.
175 $donatorsociete = (string) $donatorthirdparty->name;
176 }
177 if (dol_strlen(trim($donatoraddress)) == 0) {
178 $donatoraddress = (string) $donatorthirdparty->address;
179 }
180 if (dol_strlen(trim($donatorzip)) == 0) {
181 $donatorzip = (string) $donatorthirdparty->zip;
182 }
183 if (dol_strlen(trim($donatortown)) == 0) {
184 $donatortown = (string) $donatorthirdparty->town;
185 }
186 } else {
187 dol_syslog("html_cerfafr::write_file Failed to load thirdparty ".$don->socid." linked to donation ".$don->id.", donator block will remain empty - ".$donatorthirdparty->error, LOG_ERR);
188 }
189 }
190
191 if (dol_strlen(trim($donatorsociete.$donatorlastname.$donatorfirstname)) == 0) {
192 dol_syslog("html_cerfafr::write_file No name found for the donator of donation ".$don->id.", the receipt will not be compliant", LOG_WARNING);
193 }
194
195 // Define contents
196 $donmodel = DOL_DOCUMENT_ROOT."/core/modules/dons/html_cerfafr.html";
197
198 $form = file_get_contents($donmodel);
199
200 $form = str_replace('__REF__', (string) $don->id, $form);
201 $form = str_replace('__DATE__', dol_print_date($don->date, 'day', false, $outputlangs), $form);
202 //$form = str_replace('__IP__',$user->ip,$form); // TODO $user->ip not exist
203 $form = str_replace('__AMOUNT__', price($don->amount), $form);
204 $form = str_replace('__AMOUNTLETTERS__', $this->amountToLetters($don->amount), $form);
205 $form = str_replace('__CURRENCY__', $outputlangs->transnoentitiesnoconv("Currency".$currency), $form);
206 $form = str_replace('__CURRENCYCODE__', $conf->currency, $form);
207 $form = str_replace('__MAIN_INFO_SOCIETE_NOM__', (string) $mysoc->name, $form);
208 $form = str_replace('__MAIN_INFO_SOCIETE_ADDRESS__', (string) $mysoc->address, $form);
209 $form = str_replace('__MAIN_INFO_SOCIETE_ZIP__', (string) $mysoc->zip, $form);
210 $form = str_replace('__MAIN_INFO_SOCIETE_TOWN__', (string) $mysoc->town, $form);
211
212 $form = str_replace('__MAIN_INFO_SOCIETE_OBJECT__', (string) $mysoc->socialobject, $form);
213
214 $form = str_replace('__DONATOR_FIRSTNAME__', dol_escape_htmltag($donatorfirstname), $form);
215 // The template concatenates __DONATOR_SOCIETE__ and __DONATOR_LASTNAME__ with no separator,
216 // so add a line break when both are filled in.
217 $donatorlastnameprefix = (dol_strlen(trim($donatorsociete)) > 0 && dol_strlen(trim($donatorlastname)) > 0) ? '<br>' : '';
218 $form = str_replace('__DONATOR_LASTNAME__', $donatorlastnameprefix.dol_escape_htmltag($donatorlastname), $form);
219 $form = str_replace('__DONATOR_SOCIETE__', dol_escape_htmltag($donatorsociete), $form);
220
221 $form = str_replace('__DONATOR_STATUT__', (string) $don->statut, $form);
222 $form = str_replace('__DONATOR_ADDRESS__', dol_nl2br(dol_escape_htmltag($donatoraddress, 0, 1)), $form);
223 $form = str_replace('__DONATOR_ZIP__', dol_escape_htmltag($donatorzip), $form);
224 $form = str_replace('__DONATOR_TOWN__', dol_escape_htmltag($donatortown), $form);
225
226 $form = str_replace('__PAYMENTMODE_LIB__ ', (string) $paymentmode, $form);
227 $form = str_replace('__NOW__', dol_print_date($now, 'day', false, $outputlangs), $form);
228 $form = str_replace('__DONATION_PAYMENT_MODE__', $ModePaiement, $form);
229 $form = str_replace('__DONATION_MESSAGE__', getDolGlobalString('DONATION_MESSAGE'), $form);
230
231 // Replace with a generic replacement feature '__(XXX)__' must become $outputlangs->trans('XXX')
232 $form = make_substitutions($form, array(), $outputlangs);
233
234 $frencharticle = '';
235 if (preg_match('/fr/i', $outputlangs->defaultlang)) {
236 $frencharticle = '<font size="+1">Article 200, 238 bis et 978 du code général des impôts (CGI)</font>';
237 }
238 $form = str_replace('__FrenchArticle__', $frencharticle, $form);
239
240 $frencheligibility = '';
241 if (preg_match('/fr/i', $outputlangs->defaultlang)) {
242 $frencheligibility = 'Le bénéficiaire certifie sur l\'honneur que les dons et versements qu\'il reçoit ouvrent droit à la réduction d\'impôt prévue à l\'article :';
243 }
244 $form = str_replace('__FrenchEligibility__', $frencheligibility, $form);
245
246 $art200 = '';
247 if ($mysoc->country_code == 'FR') {
248 if (getDolGlobalInt('DONATION_ART200') >= 1) {
249 $art200 = '<input type="checkbox" disabled="true" checked="checked" >200 du CGI';
250 } else {
251 $art200 = '<input type="checkbox" disabled="true">200 du CGI';
252 }
253 }
254 $form = str_replace('__ARTICLE200__', $art200, $form);
255
256 $art238 = '';
257 if ($mysoc->country_code == 'FR') {
258 if (getDolGlobalInt('DONATION_ART238') >= 1) {
259 $art238 = '<input type="checkbox" disabled="true" checked="checked" >238 bis du CGI';
260 } else {
261 $art238 = '<input type="checkbox" disabled="true">238 bis du CGI';
262 }
263 }
264 $form = str_replace('__ARTICLE238__', $art238, $form);
265
266 $art978 = '';
267 if ($mysoc->country_code == 'FR') {
268 if (getDolGlobalInt('DONATION_ART978') >= 1) {
269 $art978 = '<input type="checkbox" disabled="true" checked="checked" >978 du CGI';
270 } else {
271 $art978 = '<input type="checkbox" disabled="true">978 du CGI';
272 }
273 }
274 $form = str_replace('__ARTICLE978__', $art978, $form);
275
276 // Save file on disk
277 dol_syslog("html_cerfafr::write_file $file");
278 $handle = fopen($file, "w");
279 fwrite($handle, $form);
280 fclose($handle);
281 dolChmod($file);
282
283 $this->result = array('fullpath' => $file);
284
285 return 1;
286 } else {
287 $this->error = $langs->trans("ErrorCanNotCreateDir", $dir);
288 return 0;
289 }
290 } else {
291 $this->error = $langs->trans("ErrorConstantNotDefined", "DON_OUTPUTDIR");
292 return 0;
293 }
294 }
295
304 private function amountToLetters($amount, $devise1 = '', $devise2 = '')
305 {
306 $unite = array();
307 $dix = array();
308 $cent = array();
309 if (empty($devise1)) {
310 $dev1 = 'euros';
311 } else {
312 $dev1 = $devise1;
313 }
314 if (empty($devise2)) {
315 $dev2 = 'centimes';
316 } else {
317 $dev2 = $devise2;
318 }
319 $integerAmount = intval($amount);
320 $fractionalAmount = intval(round($amount - intval($amount), 2) * 100);
321 $dix_c = intval($fractionalAmount % 100 / 10);
322 $cent_c = intval($fractionalAmount % 1000 / 100);
323 $unite[1] = $integerAmount % 10;
324 $dix[1] = intval($integerAmount % 100 / 10);
325 $cent[1] = intval($integerAmount % 1000 / 100);
326 $unite[2] = intval($integerAmount % 10000 / 1000);
327 $dix[2] = intval($integerAmount % 100000 / 10000);
328 $cent[2] = intval($integerAmount % 1000000 / 100000);
329 $unite[3] = intval($integerAmount % 10000000 / 1000000);
330 $dix[3] = intval($integerAmount % 100000000 / 10000000);
331 $cent[3] = intval($integerAmount % 1000000000 / 100000000);
332 $chif = array('', 'un', 'deux', 'trois', 'quatre', 'cinq', 'six', 'sept', 'huit', 'neuf', 'dix', 'onze', 'douze', 'treize', 'quatorze', 'quinze', 'seize', 'dix sept', 'dix huit', 'dix neuf');
333 $secon_c = '';
334 $trio_c = '';
335 $prim = array();
336 $secon = array();
337 $trio = array();
338 // @phpstan-ignore-next-line
339 '@phan-var string[] $prim
340 @phan-var string[] $secon
341 @phan-var string[] $trio
342 ';
343 for ($i = 1; $i <= 3; $i++) {
344 $prim[$i] = '';
345 $secon[$i] = '';
346 $trio[$i] = '';
347 if ($dix[$i] == 0) {
348 $secon[$i] = '';
349 $prim[$i] = $chif[$unite[$i]];
350 } elseif ($dix[$i] == 1) {
351 $secon[$i] = '';
352 $prim[$i] = $chif[($unite[$i] + 10)];
353 } elseif ($dix[$i] == 2) {
354 if ($unite[$i] == 1) {
355 $secon[$i] = 'vingt et';
356 $prim[$i] = $chif[$unite[$i]];
357 } else {
358 $secon[$i] = 'vingt';
359 $prim[$i] = $chif[$unite[$i]];
360 }
361 } elseif ($dix[$i] == 3) {
362 if ($unite[$i] == 1) {
363 $secon[$i] = 'trente et';
364 $prim[$i] = $chif[$unite[$i]];
365 } else {
366 $secon[$i] = 'trente';
367 $prim[$i] = $chif[$unite[$i]];
368 }
369 } elseif ($dix[$i] == 4) {
370 if ($unite[$i] == 1) {
371 $secon[$i] = 'quarante et';
372 $prim[$i] = $chif[$unite[$i]];
373 } else {
374 $secon[$i] = 'quarante';
375 $prim[$i] = $chif[$unite[$i]];
376 }
377 } elseif ($dix[$i] == 5) {
378 if ($unite[$i] == 1) {
379 $secon[$i] = 'cinquante et';
380 $prim[$i] = $chif[$unite[$i]];
381 } else {
382 $secon[$i] = 'cinquante';
383 $prim[$i] = $chif[$unite[$i]];
384 }
385 } elseif ($dix[$i] == 6) {
386 if ($unite[$i] == 1) {
387 $secon[$i] = 'soixante et';
388 $prim[$i] = $chif[$unite[$i]];
389 } else {
390 $secon[$i] = 'soixante';
391 $prim[$i] = $chif[$unite[$i]];
392 }
393 } elseif ($dix[$i] == 7) {
394 if ($unite[$i] == 1) {
395 $secon[$i] = 'soixante et';
396 $prim[$i] = $chif[$unite[$i] + 10];
397 } else {
398 $secon[$i] = 'soixante';
399 $prim[$i] = $chif[$unite[$i] + 10];
400 }
401 } elseif ($dix[$i] == 8) {
402 if ($unite[$i] == 1) {
403 $secon[$i] = 'quatre-vingts et';
404 $prim[$i] = $chif[$unite[$i]];
405 } else {
406 $secon[$i] = 'quatre-vingt';
407 $prim[$i] = $chif[$unite[$i]];
408 }
409 } elseif ($dix[$i] == 9) {
410 if ($unite[$i] == 1) {
411 $secon[$i] = 'quatre-vingts et';
412 $prim[$i] = $chif[$unite[$i] + 10];
413 } else {
414 $secon[$i] = 'quatre-vingts';
415 $prim[$i] = $chif[$unite[$i] + 10];
416 }
417 }
418 if ($cent[$i] == 1) {
419 $trio[$i] = 'cent';
420 } elseif ($cent[$i] != 0 || $cent[$i] != '') {
421 $trio[$i] = $chif[$cent[$i]].' cents';
422 }
423 }
424
425
426 $chif2 = array('', 'dix', 'vingt', 'trente', 'quarante', 'cinquante', 'soixante', 'soixante-dix', 'quatre-vingts', 'quatre-vingts dix');
427 $secon_c = $chif2[$dix_c];
428 if ($cent_c == 1) {
429 $trio_c = 'cent';
430 } elseif ($cent_c != 0 || $cent_c != '') {
431 $trio_c = $chif[$cent_c].' cents';
432 }
433
434 if (($cent[3] == 0 || $cent[3] == '') && ($dix[3] == 0 || $dix[3] == '') && ($unite[3] == 1)) {
435 $somme = $trio[3].' '.$secon[3].' '.$prim[3].' million ';
436 } elseif (($cent[3] != 0 && $cent[3] != '') || ($dix[3] != 0 && $dix[3] != '') || ($unite[3] != 0 && $unite[3] != '')) {
437 $somme = $trio[3].' '.$secon[3].' '.$prim[3].' millions ';
438 } else {
439 $somme = $trio[3].' '.$secon[3].' '.$prim[3];
440 }
441
442 if (($cent[2] == 0 || $cent[2] == '') && ($dix[2] == 0 || $dix[2] == '') && ($unite[2] == 1)) {
443 $somme .= ' mille ';
444 } elseif (($cent[2] != 0 && $cent[2] != '') || ($dix[2] != 0 && $dix[2] != '') || ($unite[2] != 0 && $unite[2] != '')) {
445 $somme .= $trio[2].' '.$secon[2].' '.$prim[2].' milles ';
446 } else {
447 $somme .= $trio[2].' '.$secon[2].' '.$prim[2];
448 }
449
450 $somme .= $trio[1].' '.$secon[1].' '.$prim[1];
451
452 $somme .= ' '.$dev1.' ';
453
454 if (($cent_c == '0' || $cent_c == '') && ($dix_c == '0' || $dix_c == '')) {
455 return $somme.' et z&eacute;ro '.$dev2;
456 } else {
457 return $somme.$trio_c.' '.$secon_c.' '.$dev2;
458 }
459 }
460}
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
Class to manage donations.
Definition don.class.php:41
Class to manage generation of HTML components Only common components must be here.
Parent class of subscription templates.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to generate document for subscriptions.
write_file($don, $outputlangs, $currency='')
Write the object to document file to disk.
isEnabled()
Return if a module can be used or not.
__construct($db)
Constructor.
amountToLetters($amount, $devise1='', $devise2='')
numbers to letters
global $mysoc
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
dol_now($mode='gmt')
Return date for now.
dol_nl2br($stringtoencode, $nl2brmode=0, $forxml=false)
Replace CRLF in string with a HTML BR tag.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dolChmod($filepath, $newmask='')
Change mod of a file.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
Definition html.lib.php:172
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Definition repair.php:130
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:133