dolibarr  13.0.2
doc_generic_invoice_odt.modules.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2010-2012 Laurent Destailleur <ely@users.sourceforge.net>
3  * Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
4  * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
5  * Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
6  * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.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 
29 require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
30 require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
35 
36 
41 {
46  public $emetteur;
47 
52  public $phpmin = array(5, 6);
53 
58  public $version = 'dolibarr';
59 
60 
66  public function __construct($db)
67  {
68  global $conf, $langs, $mysoc;
69 
70  // Load translation files required by the page
71  $langs->loadLangs(array("main", "companies"));
72 
73  $this->db = $db;
74  $this->name = "ODT/ODS templates";
75  $this->description = $langs->trans("DocumentModelOdt");
76  $this->scandir = 'FACTURE_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan
77 
78  // Page size for A4 format
79  $this->type = 'odt';
80  $this->page_largeur = 0;
81  $this->page_hauteur = 0;
82  $this->format = array($this->page_largeur, $this->page_hauteur);
83  $this->marge_gauche = 0;
84  $this->marge_droite = 0;
85  $this->marge_haute = 0;
86  $this->marge_basse = 0;
87 
88  $this->option_logo = 1; // Affiche logo
89  $this->option_tva = 0; // Gere option tva FACTURE_TVAOPTION
90  $this->option_modereg = 0; // Affiche mode reglement
91  $this->option_condreg = 0; // Affiche conditions reglement
92  $this->option_codeproduitservice = 0; // Affiche code produit-service
93  $this->option_multilang = 1; // Dispo en plusieurs langues
94  $this->option_escompte = 0; // Affiche si il y a eu escompte
95  $this->option_credit_note = 0; // Support credit notes
96  $this->option_freetext = 1; // Support add of a personalised text
97  $this->option_draft_watermark = 0; // Support add of a watermark on drafts
98 
99  // Recupere emetteur
100  $this->emetteur = $mysoc;
101  if (!$this->emetteur->country_code) $this->emetteur->country_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini
102  }
103 
104 
111  public function info($langs)
112  {
113  global $conf, $langs;
114 
115  // Load translation files required by the page
116  $langs->loadLangs(array("errors", "companies"));
117 
118  $form = new Form($this->db);
119 
120  $texte = $this->description.".<br>\n";
121  $texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" enctype="multipart/form-data">';
122  $texte .= '<input type="hidden" name="token" value="'.newToken().'">';
123  $texte .= '<input type="hidden" name="action" value="setModuleOptions">';
124  $texte .= '<input type="hidden" name="param1" value="FACTURE_ADDON_PDF_ODT_PATH">';
125  $texte .= '<table class="nobordernopadding" width="100%">';
126 
127  // List of directories area
128  $texte .= '<tr><td valign="middle">';
129  $texttitle = $langs->trans("ListOfDirectories");
130  $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->FACTURE_ADDON_PDF_ODT_PATH)));
131  $listoffiles = array();
132  foreach ($listofdir as $key=>$tmpdir)
133  {
134  $tmpdir = trim($tmpdir);
135  $tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir);
136  if (!$tmpdir) {
137  unset($listofdir[$key]); continue;
138  }
139  if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0);
140  else {
141  $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)');
142  if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles);
143  }
144  }
145  $texthelp = $langs->trans("ListOfDirectoriesForModelGenODT");
146  // Add list of substitution keys
147  $texthelp .= '<br>'.$langs->trans("FollowingSubstitutionKeysCanBeUsed").'<br>';
148  $texthelp .= $langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it
149 
150  $texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1);
151  $texte .= '<div><div style="display: inline-block; min-width: 100px; vertical-align: middle;">';
152  $texte .= '<textarea class="flat" cols="60" name="value1">';
153  $texte .= $conf->global->FACTURE_ADDON_PDF_ODT_PATH;
154  $texte .= '</textarea>';
155  $texte .= '</div><div style="display: inline-block; vertical-align: middle;">';
156  $texte .= '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button">';
157  $texte .= '<br></div></div>';
158 
159  // Scan directories
160  $nbofiles = count($listoffiles);
161  if (!empty($conf->global->FACTURE_ADDON_PDF_ODT_PATH))
162  {
163  $texte .= $langs->trans("NumberOfModelFilesFound").': <b>';
164  //$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
165  $texte .= count($listoffiles);
166  //$texte.=$nbofiles?'</a>':'';
167  $texte .= '</b>';
168  }
169  if ($nbofiles)
170  {
171  $texte .= '<div id="div_'.get_class($this).'" class="hiddenx">';
172  // Show list of found files
173  foreach ($listoffiles as $file) {
174  $texte .= '- '.$file['name'].' <a href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=invoices/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a><br>';
175  }
176  $texte .= '</div>';
177  }
178  // Add input to upload a new template file.
179  $texte .= '<div>'.$langs->trans("UploadNewTemplate").' <input type="file" name="uploadfile">';
180  $texte .= '<input type="hidden" value="FACTURE_ADDON_PDF_ODT_PATH" name="keyforuploaddir">';
181  $texte .= '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Upload")).'" name="upload">';
182  $texte .= '</div>';
183  $texte .= '</td>';
184 
185  $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
186  $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
187  $texte .= '</td>';
188  $texte .= '</tr>';
189 
190  $texte .= '</table>';
191  $texte .= '</form>';
192 
193  return $texte;
194  }
195 
196  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
208  public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
209  {
210  // phpcs:enable
211  global $user, $langs, $conf, $mysoc, $hookmanager;
212 
213  if (empty($srctemplatepath))
214  {
215  dol_syslog("doc_generic_odt::write_file parameter srctemplatepath empty", LOG_WARNING);
216  return -1;
217  }
218 
219  // Add odtgeneration hook
220  if (!is_object($hookmanager))
221  {
222  include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
223  $hookmanager = new HookManager($this->db);
224  }
225  $hookmanager->initHooks(array('odtgeneration'));
226  global $action;
227 
228  if (!is_object($outputlangs)) $outputlangs = $langs;
229  $sav_charset_output = $outputlangs->charset_output;
230  $outputlangs->charset_output = 'UTF-8';
231 
232  // Load translation files required by the page
233  $outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
234 
235  if ($conf->facture->dir_output)
236  {
237  // If $object is id instead of object
238  if (!is_object($object))
239  {
240  $id = $object;
241  $object = new Facture($this->db);
242  $result = $object->fetch($id);
243  if ($result < 0)
244  {
245  dol_print_error($this->db, $object->error);
246  return -1;
247  }
248  }
249 
250  $object->fetch_thirdparty();
251 
252  $dir = $conf->facture->dir_output;
253  $objectref = dol_sanitizeFileName($object->ref);
254  if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref;
255  $file = $dir."/".$objectref.".odt";
256 
257  if (!file_exists($dir))
258  {
259  if (dol_mkdir($dir) < 0)
260  {
261  $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
262  return -1;
263  }
264  }
265 
266  if (file_exists($dir))
267  {
268  //print "srctemplatepath=".$srctemplatepath; // Src filename
269  $newfile = basename($srctemplatepath);
270  $newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile);
271  $newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
272  $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
273 
274  $newfiletmp = $objectref.'_'.$newfiletmp;
275 
276  // Get extension (ods or odt)
277  $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
278  if (!empty($conf->global->MAIN_DOC_USE_TIMING))
279  {
280  $format = $conf->global->MAIN_DOC_USE_TIMING;
281  if ($format == '1') $format = '%Y%m%d%H%M%S';
282  $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
283  } else {
284  $filename = $newfiletmp.'.'.$newfileformat;
285  }
286  $file = $dir.'/'.$filename;
287  //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
288  //print "newdir=".$dir;
289  //print "newfile=".$newfile;
290  //print "file=".$file;
291  //print "conf->societe->dir_temp=".$conf->societe->dir_temp;
292 
293  dol_mkdir($conf->facture->dir_temp);
294 
295 
296  // If BILLING contact defined on invoice, we use it
297  $usecontact = false;
298  $arrayidcontact = $object->getIdContact('external', 'BILLING');
299  if (count($arrayidcontact) > 0)
300  {
301  $usecontact = true;
302  $result = $object->fetch_contact($arrayidcontact[0]);
303  }
304 
305  // Recipient name
306  $contactobject = null;
307  if (!empty($usecontact)) {
308  if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
309  $socobject = $object->contact;
310  } else {
311  $socobject = $object->thirdparty;
312  // if we have a BILLING contact and we dont use it as recipient we store the contact object for later use
313  $contactobject = $object->contact;
314  }
315  } else {
316  $socobject = $object->thirdparty;
317  }
318 
319  // Fetch info for linked propal
320  $object->fetchObjectLinked('', '', '', '');
321  //print_r($object->linkedObjects['propal']); exit;
322 
323  $propal_object = $object->linkedObjects['propal'][0];
324 
325  // Make substitution
326  $substitutionarray = array(
327  '__FROM_NAME__' => $this->emetteur->name,
328  '__FROM_EMAIL__' => $this->emetteur->email,
329  '__TOTAL_TTC__' => $object->total_ttc,
330  '__TOTAL_HT__' => $object->total_ht,
331  '__TOTAL_VAT__' => $object->total_tva
332  );
333  complete_substitutions_array($substitutionarray, $langs, $object);
334  // Call the ODTSubstitution hook
335  $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
336  $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
337 
338  // Line of free text
339  $newfreetext = '';
340  $paramfreetext = 'INVOICE_FREE_TEXT';
341  if (!empty($conf->global->$paramfreetext))
342  {
343  $newfreetext = make_substitutions($conf->global->$paramfreetext, $substitutionarray);
344  }
345 
346  // Open and load template
347  require_once ODTPHP_PATH.'odf.php';
348  try {
349  $odfHandler = new odf(
350  $srctemplatepath,
351  array(
352  'PATH_TO_TMP' => $conf->facture->dir_temp,
353  'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
354  'DELIMITER_LEFT' => '{',
355  'DELIMITER_RIGHT' => '}'
356  )
357  );
358  } catch (Exception $e)
359  {
360  $this->error = $e->getMessage();
361  dol_syslog($e->getMessage(), LOG_INFO);
362  return -1;
363  }
364  // After construction $odfHandler->contentXml contains content and
365  // [!-- BEGIN row.lines --]*[!-- END row.lines --] has been replaced by
366  // [!-- BEGIN lines --]*[!-- END lines --]
367  //print html_entity_decode($odfHandler->__toString());
368  //print exit;
369 
370 
371  // Make substitutions into odt of freetext
372  try {
373  $odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
374  } catch (OdfException $e)
375  {
376  dol_syslog($e->getMessage(), LOG_INFO);
377  }
378 
379  // Define substitution array
380  $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
381  $array_object_from_properties = $this->get_substitutionarray_each_var_object($object, $outputlangs);
382  $array_objet = $this->get_substitutionarray_object($object, $outputlangs);
383  $array_user = $this->get_substitutionarray_user($user, $outputlangs);
384  $array_soc = $this->get_substitutionarray_mysoc($mysoc, $outputlangs);
385  $array_thirdparty = $this->get_substitutionarray_thirdparty($socobject, $outputlangs);
386  $array_propal = is_object($propal_object) ? $this->get_substitutionarray_object($propal_object, $outputlangs, 'propal') : array();
387  $array_other = $this->get_substitutionarray_other($outputlangs);
388  // retrieve contact information for use in object as contact_xxx tags
389  $array_thirdparty_contact = array();
390  if ($usecontact && is_object($contactobject)) $array_thirdparty_contact = $this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact');
391 
392  $tmparray = array_merge($substitutionarray, $array_object_from_properties, $array_user, $array_soc, $array_thirdparty, $array_objet, $array_propal, $array_other, $array_thirdparty_contact);
393  complete_substitutions_array($tmparray, $outputlangs, $object);
394 
395  // Call the ODTSubstitution hook
396  $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
397  $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
398 
399  //var_dump($tmparray); exit;
400  foreach ($tmparray as $key=>$value)
401  {
402  try {
403  if (preg_match('/logo$/', $key)) // Image
404  {
405  //var_dump($value);exit;
406  if (file_exists($value)) $odfHandler->setImage($key, $value);
407  else $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
408  } else // Text
409  {
410  $odfHandler->setVars($key, $value, true, 'UTF-8');
411  }
412  } catch (OdfException $e)
413  {
414  dol_syslog($e->getMessage(), LOG_INFO);
415  }
416  }
417  // Replace tags of lines
418  try {
419  $foundtagforlines = 1;
420  try {
421  $listlines = $odfHandler->setSegment('lines');
422  } catch (OdfException $e)
423  {
424  // We may arrive here if tags for lines not present into template
425  $foundtagforlines = 0;
426  dol_syslog($e->getMessage(), LOG_INFO);
427  }
428  if ($foundtagforlines)
429  {
430  $linenumber = 0;
431  foreach ($object->lines as $line)
432  {
433  $linenumber++;
434  $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
435  complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
436  // Call the ODTSubstitutionLine hook
437  $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
438  $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
439  foreach ($tmparray as $key => $val)
440  {
441  try {
442  $listlines->setVars($key, $val, true, 'UTF-8');
443  } catch (OdfException $e)
444  {
445  dol_syslog($e->getMessage(), LOG_INFO);
446  } catch (SegmentException $e)
447  {
448  dol_syslog($e->getMessage(), LOG_INFO);
449  }
450  }
451  $listlines->merge();
452  }
453  $odfHandler->mergeSegment($listlines);
454  }
455  } catch (OdfException $e)
456  {
457  $this->error = $e->getMessage();
458  dol_syslog($this->error, LOG_WARNING);
459  return -1;
460  }
461 
462  // Replace labels translated
463  $tmparray = $outputlangs->get_translations_for_substitutions();
464  foreach ($tmparray as $key=>$value)
465  {
466  try {
467  $odfHandler->setVars($key, $value, true, 'UTF-8');
468  } catch (OdfException $e)
469  {
470  dol_syslog($e->getMessage(), LOG_INFO);
471  }
472  }
473 
474  // Call the beforeODTSave hook
475  $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
476  $reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
477 
478  // Write new file
479  if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
480  try {
481  $odfHandler->exportAsAttachedPDF($file);
482  } catch (Exception $e) {
483  $this->error = $e->getMessage();
484  dol_syslog($e->getMessage(), LOG_INFO);
485  return -1;
486  }
487  } else {
488  try {
489  $odfHandler->saveToDisk($file);
490  } catch (Exception $e) {
491  $this->error = $e->getMessage();
492  dol_syslog($e->getMessage(), LOG_INFO);
493  return -1;
494  }
495  }
496  $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
497  $reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
498 
499  if (!empty($conf->global->MAIN_UMASK))
500  @chmod($file, octdec($conf->global->MAIN_UMASK));
501 
502  $odfHandler = null; // Destroy object
503 
504  $this->result = array('fullpath'=>$file);
505 
506  return 1; // Success
507  } else {
508  $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
509  return -1;
510  }
511  }
512 
513  return -1;
514  }
515 }
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Definition: replenish.php:750
get_substitutionarray_each_var_object(&$object, $outputlangs, $recursive=true)
Define array with couple substitution key =&gt; substitution value.
dol_now($mode= 'auto')
Return date for now.
get_substitutionarray_user($user, $outputlangs)
Define array with couple substitution key =&gt; substitution value.
get_substitutionarray_object($object, $outputlangs, $array_key= 'object')
Define array with couple substitution key =&gt; substitution value.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:108
$conf db
API class for accounts.
Definition: inc.php:54
img_warning($titlealt= 'default', $moreatt= '', $morecss= 'pictowarning')
Show warning logo.
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null)
Return array of possible common substitutions.
Class to manage hooks.
get_substitutionarray_contact($object, $outputlangs, $array_key= 'object')
Define array with couple substitution key =&gt; substitution value.
Class to manage generation of HTML components Only common components must be here.
info($langs)
Return description of a module.
Class to build documents using ODF templates generator.
Parent class of invoice document generators.
get_substitutionarray_thirdparty($object, $outputlangs, $array_key= 'company')
Define array with couple substitution key =&gt; substitution value.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it&#39;s its name (generic function)
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
get_substitutionarray_mysoc($mysoc, $outputlangs)
Define array with couple substitution key =&gt; substitution value.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
Definition: files.lib.php:60
write_file($object, $outputlangs, $srctemplatepath, $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build a document on disk using the generic odt module.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
make_substitutions($text, $substitutionarray, $outputlangs=null)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=&gt;newva...
get_substitutionarray_other($outputlangs)
Define array with couple substitution key =&gt; substitution value.
Class to manage invoices.
get_substitutionarray_lines($line, $outputlangs, $linenumber=0)
Define array with couple substitution key =&gt; substitution value.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition: repair.php:105
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the &quot;subst...