dolibarr  16.0.5
doc_generic_usergroup_odt.modules.php
1 <?php
2 /* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
4  * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 * or see https://www.gnu.org/
19 */
20 
27 require_once DOL_DOCUMENT_ROOT.'/core/modules/usergroup/modules_usergroup.class.php';
28 require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
29 require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
34 
35 
40 {
45  public $emetteur;
46 
51  public $phpmin = array(5, 6);
52 
57  public $version = 'dolibarr';
58 
59 
65  public function __construct($db)
66  {
67  global $conf, $langs, $mysoc;
68 
69  // Load translation files required by the page
70  $langs->loadLangs(array("main", "companies"));
71 
72  $this->db = $db;
73  $this->name = "ODT templates";
74  $this->description = $langs->trans("DocumentModelOdt");
75  $this->scandir = 'USERGROUP_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan
76 
77  // Page size for A4 format
78  $this->type = 'odt';
79  $this->page_largeur = 0;
80  $this->page_hauteur = 0;
81  $this->format = array($this->page_largeur, $this->page_hauteur);
82  $this->marge_gauche = 0;
83  $this->marge_droite = 0;
84  $this->marge_haute = 0;
85  $this->marge_basse = 0;
86 
87  $this->option_logo = 1; // Display logo
88  $this->option_tva = 0; // Manage the vat option USERGROUP_TVAOPTION
89  $this->option_modereg = 0; // Display payment mode
90  $this->option_condreg = 0; // Display payment terms
91  $this->option_multilang = 1; // Available in several languages
92  $this->option_escompte = 0; // Displays if there has been a discount
93  $this->option_credit_note = 0; // Support credit notes
94  $this->option_freetext = 1; // Support add of a personalised text
95  $this->option_draft_watermark = 0; // Support add of a watermark on drafts
96 
97  // Get source company
98  $this->emetteur = $mysoc;
99  if (!$this->emetteur->country_code) {
100  $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
101  }
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">';
122  $texte .= '<input type="hidden" name="token" value="'.newToken().'">';
123  $texte .= '<input type="hidden" name="page_y" value="">';
124  $texte .= '<input type="hidden" name="action" value="setModuleOptions">';
125  $texte .= '<input type="hidden" name="param1" value="USERGROUP_ADDON_PDF_ODT_PATH">';
126  if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) {
127  $texte .= '<input type="hidden" name="param2" value="USERGROUP_ADDON_PDF_ODT_DEFAULT">';
128  $texte .= '<input type="hidden" name="param3" value="USERGROUP_ADDON_PDF_ODT_TOBILL">';
129  $texte .= '<input type="hidden" name="param4" value="USERGROUP_ADDON_PDF_ODT_CLOSED">';
130  }
131  $texte .= '<table class="nobordernopadding" width="100%">';
132 
133  // List of directories area
134  $texte .= '<tr><td>';
135  $texttitle = $langs->trans("ListOfDirectories");
136  $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->USERGROUP_ADDON_PDF_ODT_PATH)));
137  $listoffiles = array();
138  foreach ($listofdir as $key => $tmpdir) {
139  $tmpdir = trim($tmpdir);
140  $tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir);
141  if (!$tmpdir) {
142  unset($listofdir[$key]);
143  continue;
144  }
145  if (!is_dir($tmpdir)) {
146  $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0);
147  } else {
148  $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)');
149  if (count($tmpfiles)) {
150  $listoffiles = array_merge($listoffiles, $tmpfiles);
151  }
152  }
153  }
154  $texthelp = $langs->trans("ListOfDirectoriesForModelGenODT");
155  // Add list of substitution keys
156  $texthelp .= '<br>'.$langs->trans("FollowingSubstitutionKeysCanBeUsed").'<br>';
157  $texthelp .= $langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it
158 
159  $texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1);
160  $texte .= '<div><div style="display: inline-block; min-width: 100px; vertical-align: middle;">';
161  $texte .= '<textarea class="flat" cols="60" name="value1">';
162  $texte .= $conf->global->USERGROUP_ADDON_PDF_ODT_PATH;
163  $texte .= '</textarea>';
164  $texte .= '</div><div style="display: inline-block; vertical-align: middle;">';
165  $texte .= '<input type="submit" class="button small reposition" name="modify" value="'.$langs->trans("Modify").'">';
166  $texte .= '<br></div></div>';
167 
168  // Scan directories
169  if (count($listofdir)) {
170  $texte .= $langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
171 
172  if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) {
173  // Model for creation
174  $list = ModelePDFUserGroup::liste_modeles($this->db);
175  $texte .= '<table width="50%;">';
176  $texte .= '<tr>';
177  $texte .= '<td width="60%;">'.$langs->trans("DefaultModelPropalCreate").'</td>';
178  $texte .= '<td colspan="">';
179  $texte .= $form->selectarray('value2', $list, $conf->global->USERGROUP_ADDON_PDF_ODT_DEFAULT);
180  $texte .= "</td></tr>";
181 
182  $texte .= '<tr>';
183  $texte .= '<td width="60%;">'.$langs->trans("DefaultModelPropalToBill").'</td>';
184  $texte .= '<td colspan="">';
185  $texte .= $form->selectarray('value3', $list, $conf->global->USERGROUP_ADDON_PDF_ODT_TOBILL);
186  $texte .= "</td></tr>";
187  $texte .= '<tr>';
188 
189  $texte .= '<td width="60%;">'.$langs->trans("DefaultModelPropalClosed").'</td>';
190  $texte .= '<td colspan="">';
191  $texte .= $form->selectarray('value4', $list, $conf->global->USERGROUP_ADDON_PDF_ODT_CLOSED);
192  $texte .= "</td></tr>";
193  $texte .= '</table>';
194  }
195  }
196 
197  $texte .= '</td>';
198 
199  $texte .= '<td rowspan="2" class="tdtop hideonsmartphone">';
200  $texte .= '<span class="opacitymedium">';
201  $texte .= $langs->trans("ExampleOfDirectoriesForModelGen");
202  $texte .= '</span>';
203  $texte .= '</td>';
204  $texte .= '</tr>';
205 
206  $texte .= '</table>';
207  $texte .= '</form>';
208 
209  return $texte;
210  }
211 
212  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
224  public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
225  {
226  // phpcs:enable
227  global $user, $langs, $conf, $mysoc, $hookmanager;
228 
229  if (empty($srctemplatepath)) {
230  dol_syslog("doc_generic_odt::write_file parameter srctemplatepath empty", LOG_WARNING);
231  return -1;
232  }
233 
234  // Add odtgeneration hook
235  if (!is_object($hookmanager)) {
236  include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
237  $hookmanager = new HookManager($this->db);
238  }
239  $hookmanager->initHooks(array('odtgeneration'));
240  global $action;
241 
242  if (!is_object($outputlangs)) {
243  $outputlangs = $langs;
244  }
245  $sav_charset_output = $outputlangs->charset_output;
246  $outputlangs->charset_output = 'UTF-8';
247 
248  // Load translation files required by the page
249  $outputlangs->loadLangs(array("main", "companies", "bills", "dict"));
250 
251  if ($conf->user->dir_output) {
252  // If $object is id instead of object
253  if (!is_object($object)) {
254  $id = $object;
255  $object = new UserGroup($this->db);
256  $result = $object->fetch($id);
257  if ($result < 0) {
258  dol_print_error($this->db, $object->error);
259  return -1;
260  }
261  }
262 
263  $dir = $conf->user->dir_output.'/usergroups';
264  $objectref = dol_sanitizeFileName($object->ref);
265  if (!preg_match('/specimen/i', $objectref)) {
266  $dir .= "/".$objectref;
267  }
268  $file = $dir."/".$objectref.".odt";
269 
270  if (!file_exists($dir)) {
271  if (dol_mkdir($dir) < 0) {
272  $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
273  return -1;
274  }
275  }
276 
277  if (file_exists($dir)) {
278  //print "srctemplatepath=".$srctemplatepath; // Src filename
279  $newfile = basename($srctemplatepath);
280  $newfiletmp = preg_replace('/\.od(t|s)/i', '', $newfile);
281  $newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
282  $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
283 
284  $newfiletmp = $objectref.'_'.$newfiletmp;
285 
286  // Get extension (ods or odt)
287  $newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
288  if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
289  $format = $conf->global->MAIN_DOC_USE_TIMING;
290  if ($format == '1') {
291  $format = '%Y%m%d%H%M%S';
292  }
293  $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat;
294  } else {
295  $filename = $newfiletmp.'.'.$newfileformat;
296  }
297  $file = $dir.'/'.$filename;
298  //print "newdir=".$dir;
299  //print "newfile=".$newfile;
300  //print "file=".$file;
301  //print "conf->user->dir_temp=".$conf->user->dir_temp;
302 
303  dol_mkdir($conf->user->dir_temp);
304  if (!is_writable($conf->user->dir_temp)) {
305  $this->error = "Failed to write in temp directory ".$conf->user->dir_temp;
306  dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
307  return -1;
308  }
309 
310  // If CUSTOMER contact defined on user, we use it
311  $usecontact = false;
312  $arrayidcontact = $object->getIdContact('external', 'CUSTOMER');
313  if (count($arrayidcontact) > 0) {
314  $usecontact = true;
315  $result = $object->fetch_contact($arrayidcontact[0]);
316  }
317 
318  // Recipient name
319  if (!empty($usecontact)) {
320  // We can use the company of contact instead of thirdparty company
321  if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
322  $object->contact->fetch_thirdparty();
323  $socobject = $object->contact->thirdparty;
324  $contactobject = $object->contact;
325  } else {
326  $socobject = $object->thirdparty;
327  // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
328  $contactobject = $object->contact;
329  }
330  } else {
331  $socobject = $object->thirdparty;
332  }
333  // Make substitution
334  $substitutionarray = array(
335  '__FROM_NAME__' => $this->emetteur->name,
336  '__FROM_EMAIL__' => $this->emetteur->email,
337  '__TOTAL_TTC__' => $object->total_ttc,
338  '__TOTAL_HT__' => $object->total_ht,
339  '__TOTAL_VAT__' => $object->total_tva
340  );
341  complete_substitutions_array($substitutionarray, $langs, $object);
342  // Call the ODTSubstitution hook
343  $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
344  $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
345 
346  // Line of free text
347  $newfreetext = '';
348  $paramfreetext = 'user_FREE_TEXT';
349  if (!empty($conf->global->$paramfreetext)) {
350  $newfreetext = make_substitutions($conf->global->$paramfreetext, $substitutionarray);
351  }
352 
353  // Open and load template
354  require_once ODTPHP_PATH.'odf.php';
355  try {
356  $odfHandler = new odf(
357  $srctemplatepath,
358  array(
359  'PATH_TO_TMP' => $conf->user->dir_temp,
360  'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
361  'DELIMITER_LEFT' => '{',
362  'DELIMITER_RIGHT' => '}'
363  )
364  );
365  } catch (Exception $e) {
366  $this->error = $e->getMessage();
367  dol_syslog($e->getMessage(), LOG_WARNING);
368  return -1;
369  }
370  // After construction $odfHandler->contentXml contains content and
371  // [!-- BEGIN row.lines --]*[!-- END row.lines --] has been replaced by
372  // [!-- BEGIN lines --]*[!-- END lines --]
373  //print html_entity_decode($odfHandler->__toString());
374  //print exit;
375 
376 
377  // Make substitutions into odt of freetext
378  try {
379  $odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
380  } catch (OdfException $e) {
381  dol_syslog($e->getMessage(), LOG_WARNING);
382  }
383 
384  // Make substitutions into odt
385  $array_user = $this->get_substitutionarray_user($user, $outputlangs);
386  $array_global = $this->get_substitutionarray_each_var_object($object, $outputlangs);
387  $array_soc = $this->get_substitutionarray_mysoc($mysoc, $outputlangs);
388  $array_thirdparty = $this->get_substitutionarray_thirdparty($socobject, $outputlangs);
389  $array_objet = $this->get_substitutionarray_each_var_object($object, $outputlangs);
390  $array_other = $this->get_substitutionarray_other($outputlangs);
391  // retrieve contact information for use in object as contact_xxx tags
392  $array_thirdparty_contact = array();
393  if ($usecontact && is_object($contactobject)) {
394  $array_thirdparty_contact = $this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact');
395  }
396 
397  $tmparray = array_merge($array_global, $array_user, $array_soc, $array_thirdparty, $array_objet, $array_other, $array_thirdparty_contact);
398  complete_substitutions_array($tmparray, $outputlangs, $object);
399  $object->fetch_optionals();
400  // Call the ODTSubstitution hook
401  $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
402  $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
403  foreach ($tmparray as $key => $value) {
404  try {
405  if (preg_match('/logo$/', $key)) { // Image
406  if (file_exists($value)) {
407  $odfHandler->setImage($key, $value);
408  } else {
409  $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
410  }
411  } else // Text
412  {
413  $odfHandler->setVars($key, $value, true, 'UTF-8');
414  }
415  } catch (OdfException $e) {
416  dol_syslog($e->getMessage(), LOG_WARNING);
417  }
418  }
419  // Replace tags of lines
420  try {
421  $foundtagforlines = 1;
422  try {
423  $listlines = $odfHandler->setSegment('lines');
424  } catch (OdfException $e) {
425  // We may arrive here if tags for lines not present into template
426  $foundtagforlines = 0;
427  dol_syslog($e->getMessage(), LOG_INFO);
428  }
429  if ($foundtagforlines) {
430  foreach ($object->members as $u) {
431  $tmparray = $this->get_substitutionarray_each_var_object($u, $outputlangs);
432  unset($tmparray['object_pass']);
433  unset($tmparray['object_pass_indatabase']);
434  complete_substitutions_array($tmparray, $outputlangs, $object, $user, "completesubstitutionarray_users");
435  // Call the ODTSubstitutionLine hook
436  $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$u);
437  $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
438  foreach ($tmparray as $key => $val) {
439  try {
440  if (!is_array($val)) {
441  $listlines->setVars($key, $val, true, 'UTF-8');
442  }
443  } catch (OdfException $e) {
444  dol_syslog($e->getMessage(), LOG_WARNING);
445  } catch (SegmentException $e) {
446  dol_syslog($e->getMessage(), LOG_WARNING);
447  }
448  }
449  $listlines->merge();
450  }
451  $odfHandler->mergeSegment($listlines);
452  }
453  } catch (OdfException $e) {
454  $this->error = $e->getMessage();
455  dol_syslog($this->error, LOG_WARNING);
456  return -1;
457  }
458 
459  // Replace labels translated
460  $tmparray = $outputlangs->get_translations_for_substitutions();
461  foreach ($tmparray as $key => $value) {
462  try {
463  $odfHandler->setVars($key, $value, true, 'UTF-8');
464  } catch (OdfException $e) {
465  dol_syslog($e->getMessage(), LOG_WARNING);
466  }
467  }
468 
469  // Call the beforeODTSave hook
470  $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
471  $reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
472 
473  // Write new file
474  if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
475  try {
476  $odfHandler->exportAsAttachedPDF($file);
477  } catch (Exception $e) {
478  $this->error = $e->getMessage();
479  dol_syslog($e->getMessage(), LOG_WARNING);
480  return -1;
481  }
482  } else {
483  try {
484  $odfHandler->saveToDisk($file);
485  } catch (Exception $e) {
486  $this->error = $e->getMessage();
487  dol_syslog($e->getMessage(), LOG_WARNING);
488  return -1;
489  }
490  }
491 
492  $reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
493 
494  if (!empty($conf->global->MAIN_UMASK)) {
495  @chmod($file, octdec($conf->global->MAIN_UMASK));
496  }
497 
498  $odfHandler = null; // Destroy object
499 
500  $this->result = array('fullpath'=>$file);
501 
502  return 1; // Success
503  } else {
504  $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
505  return -1;
506  }
507  }
508 
509  return -1;
510  }
511 }
make_substitutions
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
Definition: functions.lib.php:7839
db
$conf db
API class for accounts.
Definition: inc.php:41
dol_sanitizeFileName
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
Definition: functions.lib.php:1226
description
print *****$script_file(".$version.") pid cd cd cd description as description
Definition: email_expire_services_to_customers.php:83
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4844
CommonDocGenerator\get_substitutionarray_user
get_substitutionarray_user($user, $outputlangs)
Define array with couple substitution key => substitution value.
Definition: commondocgenerator.class.php:108
UserGroup
Class to manage user groups.
Definition: usergroup.class.php:39
img_warning
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
Definition: functions.lib.php:4521
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
dol_dir_list
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
name
$conf db name
Definition: repair.php:122
ModelePDFUserGroup\liste_modeles
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
Definition: modules_usergroup.class.php:55
doc_generic_usergroup_odt
Class to build documents using ODF templates generator.
Definition: doc_generic_usergroup_odt.modules.php:39
doc_generic_usergroup_odt\info
info($langs)
Return description of a module.
Definition: doc_generic_usergroup_odt.modules.php:111
dol_print_date
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Definition: functions.lib.php:2514
CommonDocGenerator\get_substitutionarray_contact
get_substitutionarray_contact($object, $outputlangs, $array_key='object')
Define array with couple substitution key => substitution value.
Definition: commondocgenerator.class.php:321
doc_generic_usergroup_odt\write_file
write_file($object, $outputlangs, $srctemplatepath, $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build a document on disk using the generic odt module.
Definition: doc_generic_usergroup_odt.modules.php:224
Exception
CommonDocGenerator\get_substitutionarray_thirdparty
get_substitutionarray_thirdparty($object, $outputlangs, $array_key='company')
Define array with couple substitution key => substitution value For example {company_name},...
Definition: commondocgenerator.class.php:256
ModelePDFUserGroup
Parent class to manage intervention document templates.
Definition: modules_usergroup.class.php:39
CommonDocGenerator\get_substitutionarray_each_var_object
get_substitutionarray_each_var_object(&$object, $outputlangs, $recursive=1)
Define array with couple substitution key => substitution value.
Definition: commondocgenerator.class.php:841
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1603
CommonDocGenerator\get_substitutionarray_mysoc
get_substitutionarray_mysoc($mysoc, $outputlangs)
Define array with couple substitution key => substitution value.
Definition: commondocgenerator.class.php:197
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
dol_now
dol_now($mode='auto')
Return date for now.
Definition: functions.lib.php:2845
doc_generic_usergroup_odt\__construct
__construct($db)
Constructor.
Definition: doc_generic_usergroup_odt.modules.php:65
dol_mkdir
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
Definition: functions.lib.php:6603
type
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition: repair.php:119
HookManager
Class to manage hooks.
Definition: hookmanager.class.php:30
complete_substitutions_array
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 "subst...
Definition: functions.lib.php:7961
CommonDocGenerator\get_substitutionarray_other
get_substitutionarray_other($outputlangs)
Define array with couple substitution key => substitution value.
Definition: commondocgenerator.class.php:379