dolibarr  13.0.2
step5.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
5  * Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org>
6  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
7  * Copyright (C) 2015-2016 RaphaĆ«l Doursenaud <rdoursenaud@gpcsolutions.fr>
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  */
22 
29 include_once 'inc.php';
30 if (file_exists($conffile)) include_once $conffile;
31 require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
32 require_once $dolibarr_main_document_root.'/core/lib/security.lib.php'; // for dol_hash
33 
34 global $langs;
35 
36 $versionfrom = GETPOST("versionfrom", 'alpha', 3) ?GETPOST("versionfrom", 'alpha', 3) : (empty($argv[1]) ? '' : $argv[1]);
37 $versionto = GETPOST("versionto", 'alpha', 3) ?GETPOST("versionto", 'alpha', 3) : (empty($argv[2]) ? '' : $argv[2]);
38 $setuplang = GETPOST('selectlang', 'aZ09', 3) ?GETPOST('selectlang', 'aZ09', 3) : (empty($argv[3]) ? 'auto' : $argv[3]);
39 $langs->setDefaultLang($setuplang);
40 $action = GETPOST('action', 'alpha') ?GETPOST('action', 'alpha') : (empty($argv[4]) ? '' : $argv[4]);
41 
42 // Define targetversion used to update MAIN_VERSION_LAST_INSTALL for first install
43 // or MAIN_VERSION_LAST_UPGRADE for upgrade.
44 $targetversion = DOL_VERSION; // If it's latest upgrade
45 if (!empty($action) && preg_match('/upgrade/i', $action)) // If it's an old upgrade
46 {
47  $tmp = explode('_', $action, 2);
48  if ($tmp[0] == 'upgrade')
49  {
50  if (!empty($tmp[1])) $targetversion = $tmp[1]; // if $action = 'upgrade_6.0.0-beta', we use '6.0.0-beta'
51  else $targetversion = DOL_VERSION; // if $action = 'upgrade', we use DOL_VERSION
52  }
53 }
54 
55 $langs->loadLangs(array("admin", "install"));
56 
57 $login = GETPOST('login', 'alpha') ?GETPOST('login', 'alpha') : (empty($argv[5]) ? '' : $argv[5]);
58 $pass = GETPOST('pass', 'alpha') ?GETPOST('pass', 'alpha') : (empty($argv[6]) ? '' : $argv[6]);
59 $pass_verif = GETPOST('pass_verif', 'alpha') ?GETPOST('pass_verif', 'alpha') : (empty($argv[7]) ? '' : $argv[7]);
60 $force_install_lockinstall = (int) (!empty($force_install_lockinstall) ? $force_install_lockinstall : (GETPOST('installlock', 'aZ09') ?GETPOST('installlock', 'aZ09') : (empty($argv[8]) ? '' : $argv[8])));
61 
62 $success = 0;
63 
64 $useforcedwizard = false;
65 $forcedfile = "./install.forced.php";
66 if ($conffile == "/etc/dolibarr/conf.php") $forcedfile = "/etc/dolibarr/install.forced.php";
67 if (@file_exists($forcedfile)) {
68  $useforcedwizard = true;
69  include_once $forcedfile;
70  // If forced install is enabled, replace post values. These are empty because form fields are disabled.
71  if ($force_install_noedit == 2) {
72  if (!empty($force_install_dolibarrlogin)) {
73  $login = $force_install_dolibarrlogin;
74  }
75  }
76 }
77 
78 dolibarr_install_syslog("- step5: entering step5.php page");
79 
80 $error = 0;
81 
82 /*
83  * Actions
84  */
85 
86 // If install, check password and password_verification used to create admin account
87 if ($action == "set") {
88  if ($pass <> $pass_verif) {
89  header("Location: step4.php?error=1&selectlang=$setuplang".(isset($login) ? '&login='.$login : ''));
90  exit;
91  }
92 
93  if (dol_strlen(trim($pass)) == 0) {
94  header("Location: step4.php?error=2&selectlang=$setuplang".(isset($login) ? '&login='.$login : ''));
95  exit;
96  }
97 
98  if (dol_strlen(trim($login)) == 0) {
99  header("Location: step4.php?error=3&selectlang=$setuplang".(isset($login) ? '&login='.$login : ''));
100  exit;
101  }
102 }
103 
104 
105 /*
106  * View
107  */
108 
109 pHeader($langs->trans("SetupEnd"), "step5");
110 print '<br>';
111 
112 // Test if we can run a first install process
113 if (empty($versionfrom) && empty($versionto) && !is_writable($conffile))
114 {
115  print $langs->trans("ConfFileIsNotWritable", $conffiletoshow);
116  pFooter(1, $setuplang, 'jscheckparam');
117  exit;
118 }
119 
120 if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action))
121 {
122  $error = 0;
123 
124  // If password is encoded, we decode it
125  if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass))
126  {
127  require_once $dolibarr_main_document_root.'/core/lib/security.lib.php';
128  if (preg_match('/crypted:/i', $dolibarr_main_db_pass))
129  {
130  $dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass);
131  $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass);
132  $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially crypted
133  } else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
134  }
135 
136  $conf->db->type = $dolibarr_main_db_type;
137  $conf->db->host = $dolibarr_main_db_host;
138  $conf->db->port = $dolibarr_main_db_port;
139  $conf->db->name = $dolibarr_main_db_name;
140  $conf->db->user = $dolibarr_main_db_user;
141  $conf->db->pass = $dolibarr_main_db_pass;
142  $conf->db->dolibarr_main_db_encryption = isset($dolibarr_main_db_encryption) ? $dolibarr_main_db_encryption : '';
143  $conf->db->dolibarr_main_db_cryptkey = isset($dolibarr_main_db_cryptkey) ? $dolibarr_main_db_cryptkey : '';
144 
145  $db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, $conf->db->port);
146 
147  // Create the global $hookmanager object
148  include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
149  $hookmanager = new HookManager($db);
150 
151  $ok = 0;
152 
153  // If first install
154  if ($action == "set")
155  {
156  // Active module user
157  $modName = 'modUser';
158  $file = $modName.".class.php";
159  dolibarr_install_syslog('step5: load module user '.DOL_DOCUMENT_ROOT."/core/modules/".$file, LOG_INFO);
160  include_once DOL_DOCUMENT_ROOT."/core/modules/".$file;
161  $objMod = new $modName($db);
162  $result = $objMod->init();
163  if (!$result) print 'ERROR in activating module file='.$file;
164 
165  if ($db->connected)
166  {
167  $conf->setValues($db);
168  // Reset forced setup after the setValues
169  if (defined('SYSLOG_FILE')) $conf->global->SYSLOG_FILE = constant('SYSLOG_FILE');
170  $conf->global->MAIN_ENABLE_LOG_TO_HTML = 1;
171 
172  // Create admin user
173  include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
174 
175  // Set default encryption to yes, generate a salt and set default encryption algorythm (but only if there is no user yet into database)
176  $sql = "SELECT u.rowid, u.pass, u.pass_crypted";
177  $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
178  $resql = $db->query($sql);
179  if ($resql)
180  {
181  $numrows = $db->num_rows($resql);
182  if ($numrows == 0)
183  {
184  // Define default setup for password encryption
185  dolibarr_set_const($db, "DATABASE_PWD_ENCRYPTED", "1", 'chaine', 0, '', $conf->entity);
186  dolibarr_set_const($db, "MAIN_SECURITY_SALT", dol_print_date(dol_now(), 'dayhourlog'), 'chaine', 0, '', 0); // All entities
187  if (function_exists('password_hash'))
188  dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'password_hash', 'chaine', 0, '', 0); // All entities
189  else dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'sha1md5', 'chaine', 0, '', 0); // All entities
190  }
191 
192  dolibarr_install_syslog('step5: DATABASE_PWD_ENCRYPTED = '.$conf->global->DATABASE_PWD_ENCRYPTED.' MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO, LOG_INFO);
193  }
194 
195  // Create user used to create the admin user
196  $createuser = new User($db);
197  $createuser->id = 0;
198  $createuser->admin = 1;
199 
200  // Set admin user
201  $newuser = new User($db);
202  $newuser->lastname = 'SuperAdmin';
203  $newuser->firstname = '';
204  $newuser->login = $login;
205  $newuser->pass = $pass;
206  $newuser->admin = 1;
207  $newuser->entity = 0;
208 
209  $conf->global->USER_MAIL_REQUIRED = 0; // Force global option to be sure to create a new user with no email
210  $result = $newuser->create($createuser, 1);
211  if ($result > 0)
212  {
213  print $langs->trans("AdminLoginCreatedSuccessfuly", $login)."<br>";
214  $success = 1;
215  } else {
216  if ($newuser->error == 'ErrorLoginAlreadyExists')
217  {
218  dolibarr_install_syslog('step5: AdminLoginAlreadyExists', LOG_WARNING);
219  print '<br><div class="warning">'.$langs->trans("AdminLoginAlreadyExists", $login)."</div><br>";
220  $success = 1;
221  } else {
222  dolibarr_install_syslog('step5: FailedToCreateAdminLogin '.$newuser->error, LOG_ERR);
223  print '<br><div class="error">'.$langs->trans("FailedToCreateAdminLogin").' '.$newuser->error.'</div><br><br>';
224  }
225  }
226 
227  if ($success)
228  {
229  // Insert MAIN_VERSION_FIRST_INSTALL in a dedicated transaction. So if it fails (when first install was already done), we can do other following requests.
230  $db->begin();
231  dolibarr_install_syslog('step5: set MAIN_VERSION_FIRST_INSTALL const to '.$targetversion, LOG_DEBUG);
232  $resql = $db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_FIRST_INSTALL', 1).",".$db->encrypt($targetversion, 1).",'chaine',0,'Dolibarr version when first install',0)");
233  if ($resql)
234  {
235  $conf->global->MAIN_VERSION_FIRST_INSTALL = $targetversion;
236  $db->commit();
237  } else {
238  //if (! $resql) dol_print_error($db,'Error in setup program'); // We ignore errors. Key may already exists
239  $db->commit();
240  }
241 
242  $db->begin();
243 
244  dolibarr_install_syslog('step5: set MAIN_VERSION_LAST_INSTALL const to '.$targetversion, LOG_DEBUG);
245  $resql = $db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_VERSION_LAST_INSTALL'");
246  if (!$resql) dol_print_error($db, 'Error in setup program');
247  $resql = $db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_LAST_INSTALL', 1).",".$db->encrypt($targetversion, 1).",'chaine',0,'Dolibarr version when last install',0)");
248  if (!$resql) dol_print_error($db, 'Error in setup program');
249  $conf->global->MAIN_VERSION_LAST_INSTALL = $targetversion;
250 
251  if ($useforcedwizard)
252  {
253  dolibarr_install_syslog('step5: set MAIN_REMOVE_INSTALL_WARNING const to 1', LOG_DEBUG);
254  $resql = $db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_REMOVE_INSTALL_WARNING'");
255  if (!$resql) dol_print_error($db, 'Error in setup program');
256  $resql = $db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_REMOVE_INSTALL_WARNING', 1).",".$db->encrypt(1, 1).",'chaine',1,'Disable install warnings',0)");
257  if (!$resql) dol_print_error($db, 'Error in setup program');
258  $conf->global->MAIN_REMOVE_INSTALL_WARNING = 1;
259  }
260 
261  // If we ask to force some modules to be enabled
262  if (!empty($force_install_module))
263  {
264  if (!defined('DOL_DOCUMENT_ROOT') && !empty($dolibarr_main_document_root)) define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root);
265 
266  $tmparray = explode(',', $force_install_module);
267  foreach ($tmparray as $modtoactivate)
268  {
269  $modtoactivatenew = preg_replace('/\.class\.php$/i', '', $modtoactivate);
270  print $langs->trans("ActivateModule", $modtoactivatenew).'<br>';
271 
272  $file = $modtoactivatenew.'.class.php';
273  dolibarr_install_syslog('step5: activate module file='.$file);
274  $res = dol_include_once("/core/modules/".$file);
275 
276  $res = activateModule($modtoactivatenew, 1);
277  if (!empty($res['errors'])) print 'ERROR in activating module file='.$file;
278  }
279  }
280 
281  dolibarr_install_syslog('step5: remove MAIN_NOT_INSTALLED const');
282  $resql = $db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_NOT_INSTALLED'");
283  if (!$resql) dol_print_error($db, 'Error in setup program');
284 
285  $db->commit();
286  }
287  } else {
288  print $langs->trans("ErrorFailedToConnect")."<br>";
289  }
290  }
291  // If upgrade
292  elseif (empty($action) || preg_match('/upgrade/i', $action))
293  {
294  if ($db->connected)
295  {
296  $conf->setValues($db);
297  // Reset forced setup after the setValues
298  if (defined('SYSLOG_FILE')) $conf->global->SYSLOG_FILE = constant('SYSLOG_FILE');
299  $conf->global->MAIN_ENABLE_LOG_TO_HTML = 1;
300 
301  // Define if we need to update the MAIN_VERSION_LAST_UPGRADE value in database
302  $tagdatabase = false;
303  if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) $tagdatabase = true; // We don't know what it was before, so now we consider we are version choosed.
304  else {
305  $mainversionlastupgradearray = preg_split('/[.-]/', $conf->global->MAIN_VERSION_LAST_UPGRADE);
306  $targetversionarray = preg_split('/[.-]/', $targetversion);
307  if (versioncompare($targetversionarray, $mainversionlastupgradearray) > 0) $tagdatabase = true;
308  }
309 
310  if ($tagdatabase)
311  {
312  dolibarr_install_syslog('step5: set MAIN_VERSION_LAST_UPGRADE const to value '.$targetversion);
313  $resql = $db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_VERSION_LAST_UPGRADE'");
314  if (!$resql) dol_print_error($db, 'Error in setup program');
315  $resql = $db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) VALUES (".$db->encrypt('MAIN_VERSION_LAST_UPGRADE', 1).",".$db->encrypt($targetversion, 1).",'chaine',0,'Dolibarr version for last upgrade',0)");
316  if (!$resql) dol_print_error($db, 'Error in setup program');
317  $conf->global->MAIN_VERSION_LAST_UPGRADE = $targetversion;
318  } else {
319  dolibarr_install_syslog('step5: we run an upgrade to version '.$targetversion.' but database was already upgraded to '.$conf->global->MAIN_VERSION_LAST_UPGRADE.'. We keep MAIN_VERSION_LAST_UPGRADE as it is.');
320  }
321  } else {
322  print $langs->trans("ErrorFailedToConnect")."<br>";
323  }
324  } else {
325  dol_print_error('', 'step5.php: unknown choice of action');
326  }
327 
328  // May fail if parameter already defined
329  $resql = $db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) VALUES (".$db->encrypt('MAIN_LANG_DEFAULT', 1).",".$db->encrypt($setuplang, 1).",'chaine',0,'Default language',1)");
330  //if (! $resql) dol_print_error($db,'Error in setup program');
331 
332  $db->close();
333 }
334 
335 
336 
337 // Create lock file
338 
339 // If first install
340 if ($action == "set" && $success)
341 {
342  if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION))
343  {
344  // Install is finished
345  print $langs->trans("SystemIsInstalled")."<br>";
346 
347  $createlock = 0;
348 
349  if (!empty($force_install_lockinstall) || !empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE))
350  {
351  // Install is finished, we create the lock file
352  $lockfile = DOL_DATA_ROOT.'/install.lock';
353  $fp = @fopen($lockfile, "w");
354  if ($fp)
355  {
356  if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) $force_install_lockinstall = 444; // For backward compatibility
357  fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")");
358  fclose($fp);
359  @chmod($lockfile, octdec($force_install_lockinstall));
360  $createlock = 1;
361  }
362  }
363  if (empty($createlock))
364  {
365  print '<div class="warning">'.$langs->trans("WarningRemoveInstallDir")."</div>";
366  }
367 
368  print "<br>";
369 
370  print $langs->trans("YouNeedToPersonalizeSetup")."<br><br><br>";
371 
372  print '<div class="center"><a href="../admin/index.php?mainmenu=home&leftmenu=setup'.(isset($login) ? '&username='.urlencode($login) : '').'">';
373  print '<span class="fas fa-external-link-alt"></span> '.$langs->trans("GoToSetupArea");
374  print '</a></div>';
375  } else {
376  // If here MAIN_VERSION_LAST_UPGRADE is not empty
377  print $langs->trans("VersionLastUpgrade").': <b><span class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</span></b><br>';
378  print $langs->trans("VersionProgram").': <b><span class="ok">'.DOL_VERSION.'</span></b><br>';
379  print $langs->trans("MigrationNotFinished").'<br>';
380  print "<br>";
381 
382  print '<div class="center"><a href="'.$dolibarr_main_url_root.'/install/index.php">';
383  print '<span class="fas fa-link-alt"></span> '.$langs->trans("GoToUpgradePage");
384  print '</a></div>';
385  }
386 }
387 // If upgrade
388 elseif (empty($action) || preg_match('/upgrade/i', $action))
389 {
390  if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION))
391  {
392  // Upgrade is finished
393  print $langs->trans("SystemIsUpgraded")."<br>";
394 
395  $createlock = 0;
396 
397  if (!empty($force_install_lockinstall) || !empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE))
398  {
399  // Upgrade is finished, we create the lock file
400  $lockfile = DOL_DATA_ROOT.'/install.lock';
401  $fp = @fopen($lockfile, "w");
402  if ($fp)
403  {
404  if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) $force_install_lockinstall = 444; // For backward compatibility
405  fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")");
406  fclose($fp);
407  @chmod($lockfile, octdec($force_install_lockinstall));
408  $createlock = 1;
409  }
410  }
411  if (empty($createlock))
412  {
413  print '<br><div class="warning">'.$langs->trans("WarningRemoveInstallDir")."</div>";
414  }
415 
416  print "<br><br>";
417 
418  print '<div class="center"><a href="../index.php?mainmenu=home'.(isset($login) ? '&username='.urlencode($login) : '').'">';
419  print '<span class="fas fa-link-alt"></span> '.$langs->trans("GoToDolibarr").'...';
420  print '</a></div><br>';
421  } else {
422  // If here MAIN_VERSION_LAST_UPGRADE is not empty
423  print $langs->trans("VersionLastUpgrade").': <b><span class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</span></b><br>';
424  print $langs->trans("VersionProgram").': <b><span class="ok">'.DOL_VERSION.'</span></b>';
425 
426  print "<br>";
427 
428  print '<div class="center"><a href="../install/index.php">';
429  print '<span class="fas fa-link-alt"></span> '.$langs->trans("GoToUpgradePage");
430  print '</a></div>';
431  }
432 } else {
433  dol_print_error('', 'step5.php: unknown choice of action');
434 }
435 
436 // Clear cache files
437 clearstatcache();
438 
439 $ret = 0;
440 if ($error && isset($argv[1])) $ret = 1;
441 dolibarr_install_syslog("Exit ".$ret);
442 
443 dolibarr_install_syslog("- step5: Dolibarr setup finished");
444 
445 pFooter(1, $setuplang);
446 
447 // Return code if ran from command line
448 if ($ret) exit($ret);
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname= '')
Make an include_once using default root and alternate root if it fails.
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
pHeader($subtitle, $next, $action= 'set', $param= '', $forcejqueryurl= '', $csstable= 'main-inside')
Show HTML header of install pages.
Definition: inc.php:347
getDoliDBInstance($type, $host, $user, $pass, $name, $port)
Return a DoliDB instance (database handler).
dol_decode($chain, $key= '1')
Decode a base 64 encoded + specific delta change.
dol_now($mode= 'auto')
Return date for now.
dolibarr_set_const($db, $name, $value, $type= 'chaine', $visible=0, $note= '', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:575
Class to manage Dolibarr users.
Definition: user.class.php:44
dolibarr_install_syslog($message, $level=LOG_DEBUG)
Log function for install pages.
Definition: inc.php:482
Class to manage hooks.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
versioncompare($versionarray1, $versionarray2)
Compare 2 versions (stored into 2 arrays).
Definition: admin.lib.php:66
pFooter($nonext=0, $setuplang= '', $jscheckfunction= '', $withpleasewait=0)
Print HTML footer of install pages.
Definition: inc.php:424
print
Draft customers invoices.
Definition: index.php:89
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
activateModule($value, $withdeps=1)
Enable a module.
Definition: admin.lib.php:971