diff --git a/dev/examples/code/create_invoice.php b/dev/examples/code/create_invoice.php index 3d3313ed3a3..cdb23e11f69 100755 --- a/dev/examples/code/create_invoice.php +++ b/dev/examples/code/create_invoice.php @@ -43,6 +43,8 @@ $error = 0; require_once $path."../../../htdocs/master.inc.php"; // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file. +global $db, $conf, $langs; + //$langs->setDefaultLang('en_US'); // To change default language of $langs $langs->load("main"); // To load language file for default language @set_time_limit(0); @@ -50,7 +52,7 @@ $langs->load("main"); // To load language file for default language // Load user and its permissions $result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. if (!$result > 0) { - dol_print_error('', $user->error); + dol_print_error(null, $user->error); exit; } $user->getrights(); diff --git a/dev/examples/code/create_order.php b/dev/examples/code/create_order.php index 1a6b3d04dc4..3b4e88d5646 100755 --- a/dev/examples/code/create_order.php +++ b/dev/examples/code/create_order.php @@ -50,7 +50,7 @@ $langs->load("main"); // To load language file for default language // Load user and its permissions $result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. if (!$result > 0) { - dol_print_error('', $user->error); + dol_print_error(null, $user->error); exit; } $user->getrights(); diff --git a/dev/examples/code/create_product.php b/dev/examples/code/create_product.php index 2fb818d5b5f..2ceaa5d74e6 100755 --- a/dev/examples/code/create_product.php +++ b/dev/examples/code/create_product.php @@ -50,7 +50,7 @@ $langs->load("main"); // To load language file for default language // Load user and its permissions $result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. if (!$result > 0) { - dol_print_error('', $user->error); + dol_print_error(null, $user->error); exit; } $user->getrights(); diff --git a/dev/examples/code/create_user.php b/dev/examples/code/create_user.php index 834c5b078a4..91644c3fd45 100755 --- a/dev/examples/code/create_user.php +++ b/dev/examples/code/create_user.php @@ -50,7 +50,7 @@ $langs->load("main"); // To load language file for default language // Load user and its permissions $result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. if (!$result > 0) { - dol_print_error('', $user->error); + dol_print_error(null, $user->error); exit; } $user->getrights(); diff --git a/dev/examples/code/get_contracts.php b/dev/examples/code/get_contracts.php index 117ea9d48b5..853a059d995 100755 --- a/dev/examples/code/get_contracts.php +++ b/dev/examples/code/get_contracts.php @@ -50,7 +50,7 @@ $langs->load("main"); // To load language file for default language // Load user and its permissions $result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. if (!$result > 0) { - dol_print_error('', $user->error); + dol_print_error(null, $user->error); exit; } $user->getrights(); diff --git a/dev/initdemo/sftpget_and_loaddump.php b/dev/initdemo/sftpget_and_loaddump.php index 5c940496f45..530afb7a3e5 100755 --- a/dev/initdemo/sftpget_and_loaddump.php +++ b/dev/initdemo/sftpget_and_loaddump.php @@ -98,7 +98,7 @@ print 'SFTP connect string : '.$sftpconnectstring."\n"; // SFTP connect if (!function_exists("ssh2_connect")) { - dol_print_error('', 'ssh2_connect function does not exists'); + dol_print_error(null, 'ssh2_connect function does not exists'); exit(1); } diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 0e4abdaebd4..c439f475f0d 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -350,7 +350,7 @@ if ($action == 'create') { $next_num_mvt = $object->getNextNumMvt('_tmp'); if (empty($next_num_mvt)) { - dol_print_error('', 'Failed to get next piece number'); + dol_print_error(null, 'Failed to get next piece number'); } print '
\n"; } else { - dol_print_error('', "Error, no invoice ".$object->id); + dol_print_error(null, "Error, no invoice ".$object->id); } } else { /* diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7b6ea28961a..d1242027585 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4633,7 +4633,7 @@ class Facture extends CommonInvoice } if (!$mybool) { - dol_print_error('', 'Failed to include file '.$file); + dol_print_error(null, 'Failed to include file '.$file); return ''; } diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index a48c399bb8d..a659a0b460a 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -443,7 +443,7 @@ class RemiseCheque extends CommonObject } if (!$mybool) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index b8df0fef891..9d5710e4c5c 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -1156,7 +1156,7 @@ class Paiement extends CommonObject } if (!$mybool) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index c670676806b..9f6d79641d9 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -884,7 +884,7 @@ if ($id > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } else { /* Social contribution not found */ - dol_print_error('', $object->error); + dol_print_error(null, $object->error); } } diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index d6d1a6c04d6..47e4d0027ad 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -165,7 +165,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object = new Contact($db); $result = $object->fetch($id); if ($result <= 0) { - dol_print_error('', $object->error); + dol_print_error(null, $object->error); } } $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index c705aeb04c2..129d6e92e77 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -586,7 +586,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object = new Contact($db); $result = $object->fetch($id); if ($result <= 0) { - dol_print_error('', $object->error); + dol_print_error(null, $object->error); } } $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 7f6a0958e06..610b6204b15 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -94,7 +94,7 @@ if ($id > 0 || !empty($ref) && $action != 'add') { $ret = $object->fetch_thirdparty(); } if ($ret < 0) { - dol_print_error('', $object->error); + dol_print_error(null, $object->error); } } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index bbefea140b9..af33d41ec37 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -313,7 +313,7 @@ class Contrat extends CommonObject } if (!$mybool) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/contrat/ticket.php b/htdocs/contrat/ticket.php index 539b5d0ac98..e4e1296ccdb 100644 --- a/htdocs/contrat/ticket.php +++ b/htdocs/contrat/ticket.php @@ -43,7 +43,7 @@ $ref=GETPOST('ref', 'alpha'); $action=GETPOST('action', 'alpha'); if ($id == '' && $ref == '') { - dol_print_error('', 'Bad parameter'); + dol_print_error(null, 'Bad parameter'); exit; } diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index f5b8f27c939..ccfe263026a 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -384,7 +384,7 @@ if ($action == "update_extras" && GETPOST('id', 'int') > 0 && !empty($permission // Action to delete if ($action == 'confirm_delete' && !empty($permissiontodelete)) { if (!($object->id > 0)) { - dol_print_error('', 'Error, object must be fetched before being deleted'); + dol_print_error(null, 'Error, object must be fetched before being deleted'); exit; } diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index 0a5f63de9aa..5efa4df394d 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -43,7 +43,7 @@ if ($action == 'builddoc' && ($permissiontoadd || !empty($usercangeneretedoc))) $ret = $object->fetch_thirdparty(); /*if (empty($object->id) || ! $object->id > 0) { - dol_print_error('Object must have been loaded by a fetch'); + dol_print_error(null, 'Object must have been loaded by a fetch'); exit; }*/ diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 4bda5b8de86..42faf23efa3 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -155,7 +155,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO } } } else { - dol_print_error('', "Use actions_sendmails.in.php for an element/object '".$object->element."' that is not supported"); + dol_print_error(null, "Use actions_sendmails.in.php for an element/object '".$object->element."' that is not supported"); } if (is_object($hookmanager)) { diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php index 3d3e24db88b..77a673d1ef6 100644 --- a/htdocs/core/actions_setnotes.inc.php +++ b/htdocs/core/actions_setnotes.inc.php @@ -30,7 +30,7 @@ // Set public note if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel', 'alpha')) { if (empty($action) || !is_object($object) || empty($id)) { - dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before'); + dol_print_error(null, 'Include of actions_setnotes.inc.php was done but required variable was not set before'); } if (empty($object->id)) { $object->fetch($id); // Fetch may not be already done @@ -76,7 +76,7 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel', if (empty($user->socid)) { // Private notes (always hidden to external users) if (empty($action) || !is_object($object) || empty($id)) { - dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before'); + dol_print_error(null, 'Include of actions_setnotes.inc.php was done but required variable was not set before'); } if (empty($object->id)) { $object->fetch($id); // Fetch may not be already done diff --git a/htdocs/core/antispamimage.php b/htdocs/core/antispamimage.php index 58d6b2da5e1..fad868f75c1 100644 --- a/htdocs/core/antispamimage.php +++ b/htdocs/core/antispamimage.php @@ -64,7 +64,7 @@ $_SESSION[$sessionkey] = $string; $img = imagecreate(80, 32); if (empty($img)) { - dol_print_error('', "Problem with GD creation"); + dol_print_error(null, "Problem with GD creation"); exit; } diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index ae94b01a505..9c1f99bbb31 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -189,7 +189,7 @@ class CSMSFile $sms->error = 'The SMS manager "'.$classfile.'" defined into SMS setup MAIN_MODULE_'.strtoupper($sendmode).'_SMS is not found'; } } catch (Exception $e) { - dol_print_error('', 'Error to get list of senders: '.$e->getMessage()); + dol_print_error(null, 'Error to get list of senders: '.$e->getMessage()); } } else { // Send sms method not correctly defined diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9331662122b..754c3390e08 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2182,7 +2182,7 @@ abstract class CommonObject global $conf, $user; if (!$this->table_element) { - dol_print_error('', get_class($this)."::load_previous_next_ref was called on object with property table_element not defined"); + dol_print_error(null, get_class($this)."::load_previous_next_ref was called on object with property table_element not defined"); return -1; } if ($fieldid == 'none') { @@ -4716,7 +4716,7 @@ abstract class CommonObject // Check parameters if (!isset($this->childtables) || !is_array($this->childtables) || count($this->childtables) == 0) { - dol_print_error('Called isObjectUsed on a class with property this->childtables not defined'); + dol_print_error(null, 'Called isObjectUsed on a class with property this->childtables not defined'); return -1; } @@ -5173,7 +5173,7 @@ abstract class CommonObject // Define output language and label if (getDolGlobalInt('MAIN_MULTILANGS')) { if (property_exists($this, 'socid') && !is_object($this->thirdparty)) { - dol_print_error('', 'Error: Method printObjectLine was called on an object and object->fetch_thirdparty was not done before'); + dol_print_error(null, 'Error: Method printObjectLine was called on an object and object->fetch_thirdparty was not done before'); return; } @@ -6000,7 +6000,7 @@ abstract class CommonObject global $langs, $conf; if (!empty(self::TRIGGER_PREFIX) && strpos($triggerName, self::TRIGGER_PREFIX . '_') !== 0) { - dol_print_error('', 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.'); + dol_print_error(null, 'The trigger "' . $triggerName . '" does not start with "' . self::TRIGGER_PREFIX . '_" as required.'); exit; } if (!is_object($langs)) { // If lang was not defined, we set it. It is required by run_triggers(). diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 09d9cd4a3b9..6a88c5f780a 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -242,7 +242,7 @@ class FormAccounting extends Form global $langs, $mysoc; if (empty($mysoc->country_id) && empty($mysoc->country_code) && empty($allcountries)) { - dol_print_error('', 'Call to select_accounting_account with mysoc country not yet defined'); + dol_print_error(null, 'Call to select_accounting_account with mysoc country not yet defined'); exit; } diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 01662f85d8a..f9cecb96867 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -207,7 +207,7 @@ function limitChars(textarea, limit, infodiv) $sms->error = 'The SMS manager "'.$classfile.'" defined into SMS setup MAIN_MODULE_'.strtoupper($sendmode).'_SMS is not found'; } } catch (Exception $e) { - dol_print_error('', 'Error to get list of senders: '.$e->getMessage()); + dol_print_error(null, 'Error to get list of senders: '.$e->getMessage()); exit; } } else { diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index fdc8f939903..94b53cf494d 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -965,7 +965,7 @@ class TimeSpent extends CommonObject } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 03c2fc7f59d..179fadfb2ac 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -211,7 +211,7 @@ class Translate // Check parameters if (empty($domain)) { - dol_print_error('', get_class($this) . "::Load ErrorWrongParameters"); + dol_print_error(null, get_class($this) . "::Load ErrorWrongParameters"); return -1; } if ($this->defaultlang === 'none_NONE') { diff --git a/htdocs/core/commonfieldsinexport.inc.php b/htdocs/core/commonfieldsinexport.inc.php index 3b201e4f10a..98838e623bf 100644 --- a/htdocs/core/commonfieldsinexport.inc.php +++ b/htdocs/core/commonfieldsinexport.inc.php @@ -2,7 +2,7 @@ if (empty($keyforclass) || empty($keyforclassfile) || empty($keyforelement)) { //print $keyforclass.' - '.$keyforclassfile.' - '.$keyforelement; - dol_print_error('', 'include of file commonfieldsinexport.inc.php was done but var $keyforclass or $keyforclassfile or $keyforelement was not set'); + dol_print_error(null, 'include of file commonfieldsinexport.inc.php was done but var $keyforclass or $keyforclassfile or $keyforelement was not set'); exit; } if (empty($keyforalias)) { diff --git a/htdocs/core/commonfieldsinimport.inc.php b/htdocs/core/commonfieldsinimport.inc.php index 60716b8b109..cf41efc169d 100644 --- a/htdocs/core/commonfieldsinimport.inc.php +++ b/htdocs/core/commonfieldsinimport.inc.php @@ -2,7 +2,7 @@ if (empty($keyforclass) || empty($keyforclassfile) || empty($keyforelement)) { //print $keyforclass.' - '.$keyforclassfile.' - '.$keyforelement; - dol_print_error('', 'include of file commonfieldsinimport.inc.php was done but var $keyforclass or $keyforclassfile or $keyforelement was not set'); + dol_print_error(null, 'include of file commonfieldsinimport.inc.php was done but var $keyforclass or $keyforclassfile or $keyforelement was not set'); exit; } if (empty($keyforalias)) { diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php index 99779e9ec5e..ce0b017cb25 100644 --- a/htdocs/core/datepicker.php +++ b/htdocs/core/datepicker.php @@ -128,7 +128,7 @@ if ($qualified) { //print $_GET["cm"].",".$_GET["sd"].",".$_GET["m"].",".$_GET["y"];exit; displayBox(GETPOST("sd", 'alpha'), GETPOST("m", 'int'), GETPOST("y", 'int')); } else { - dol_print_error('', 'ErrorBadParameters'); + dol_print_error(null, 'ErrorBadParameters'); } diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 1c686a9a7fb..f5e791e35fd 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -249,7 +249,7 @@ class DoliDBMysqli extends DoliDB $tmp = false; try { if (!class_exists('mysqli')) { - dol_print_error('', 'Driver mysqli for PHP not available'); + dol_print_error(null, 'Driver mysqli for PHP not available'); } if (strpos($host, 'ssl://') === 0) { $tmp = new mysqliDoli($host, $login, $passwd, $name, $port); diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index c454c743626..7f79181f808 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -6,7 +6,7 @@ if (empty($keyforselect) || empty($keyforelement) || empty($keyforaliasextra)) { //print $keyforselet.' - '.$keyforelement.' - '.$keyforaliasextra; - dol_print_error('', 'include of file extrafieldsinexport.inc.php was done but var $keyforselect or $keyforelement or $keyforaliasextra was not set'); + dol_print_error(null, 'include of file extrafieldsinexport.inc.php was done but var $keyforselect or $keyforelement or $keyforaliasextra was not set'); exit; } diff --git a/htdocs/core/extrafieldsinimport.inc.php b/htdocs/core/extrafieldsinimport.inc.php index 224a3c893b9..a97a9c3d17a 100644 --- a/htdocs/core/extrafieldsinimport.inc.php +++ b/htdocs/core/extrafieldsinimport.inc.php @@ -6,7 +6,7 @@ if (empty($keyforselect) || empty($keyforelement) || empty($keyforaliasextra)) { //print $keyforselet.' - '.$keyforelement.' - '.$keyforaliasextra; - dol_print_error('', 'include of file extrafieldsinimport.inc.php was done but var $keyforselect or $keyforelement or $keyforaliasextra was not set'); + dol_print_error(null, 'include of file extrafieldsinimport.inc.php was done but var $keyforselect or $keyforelement or $keyforaliasextra was not set'); exit; } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index c0d7baad366..24d69b93348 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -565,7 +565,7 @@ function dolibarr_del_const($db, $name, $entity = 1) global $conf; if (empty($name)) { - dol_print_error('', 'Error call dolibar_del_const with parameter name empty'); + dol_print_error(null, 'Error call dolibar_del_const with parameter name empty'); return -1; } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index bd33a0d2007..7b93617a698 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1621,7 +1621,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin // Check parameters if (!is_object($filterobj) && !is_object($objcon)) { - dol_print_error('', 'BadParameter'); + dol_print_error(null, 'BadParameter'); } $out = ''; diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index aa99d09dfe6..6ef05ecb79b 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -102,7 +102,7 @@ function getServerTimeZoneInt($refgmtdate = 'now') //print $refgmtdate.'='.$tmp; } else { $tmp = 0; - dol_print_error('', 'PHP version must be 5.3+'); + dol_print_error(null, 'PHP version must be 5.3+'); } $tz = round(($tmp < 0 ? 1 : -1) * abs($tmp / 3600)); return $tz; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index cc48b80acc7..c842276835d 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -3264,7 +3264,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if (preg_match('/^([a-z]+)_user_temp$/i', $modulepart, $reg)) { $tmpmodule = $reg[1]; if (empty($conf->$tmpmodule->dir_temp)) { // modulepart not supported - dol_print_error('', 'Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')'); + dol_print_error(null, 'Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')'); exit; } if ($fuser->hasRight($tmpmodule, $lire) || $fuser->hasRight($tmpmodule, $read) || $fuser->hasRight($tmpmodule, $download)) { @@ -3274,7 +3274,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } elseif (preg_match('/^([a-z]+)_temp$/i', $modulepart, $reg)) { $tmpmodule = $reg[1]; if (empty($conf->$tmpmodule->dir_temp)) { // modulepart not supported - dol_print_error('', 'Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')'); + dol_print_error(null, 'Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')'); exit; } if ($fuser->hasRight($tmpmodule, $lire) || $fuser->hasRight($tmpmodule, $read) || $fuser->hasRight($tmpmodule, $download)) { @@ -3284,7 +3284,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } elseif (preg_match('/^([a-z]+)_user$/i', $modulepart, $reg)) { $tmpmodule = $reg[1]; if (empty($conf->$tmpmodule->dir_output)) { // modulepart not supported - dol_print_error('', 'Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')'); + dol_print_error(null, 'Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')'); exit; } if ($fuser->hasRight($tmpmodule, $lire) || $fuser->hasRight($tmpmodule, $read) || $fuser->hasRight($tmpmodule, $download)) { @@ -3294,7 +3294,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } elseif (preg_match('/^massfilesarea_([a-z]+)$/i', $modulepart, $reg)) { $tmpmodule = $reg[1]; if (empty($conf->$tmpmodule->dir_output)) { // modulepart not supported - dol_print_error('', 'Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')'); + dol_print_error(null, 'Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')'); exit; } if ($fuser->hasRight($tmpmodule, $lire) || preg_match('/^specimen/i', $original_file)) { @@ -3303,7 +3303,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->$tmpmodule->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file; } else { if (empty($conf->$modulepart->dir_output)) { // modulepart not supported - dol_print_error('', 'Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.'). The module for this modulepart value may not be activated.'); + dol_print_error(null, 'Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.'). The module for this modulepart value may not be activated.'); exit; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 00adc0bffae..07aa39b3f11 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2946,7 +2946,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = // Analyze date $reg = array(); if (preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) { // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000 - dol_print_error('', "Functions.lib::dol_print_date function called with a bad value from page ".(empty($_SERVER["PHP_SELF"]) ? 'unknown' : $_SERVER["PHP_SELF"])); + dol_print_error(null, "Functions.lib::dol_print_date function called with a bad value from page ".(empty($_SERVER["PHP_SELF"]) ? 'unknown' : $_SERVER["PHP_SELF"])); return ''; } elseif (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg)) { // Still available to solve problems in extrafields of type date // This part of code should not be used anymore. @@ -9111,7 +9111,7 @@ function setEventMessages($mesg, $mesgs, $style = 'mesgs', $messagekey = '', $no } if (empty($messagekey) || empty($_COOKIE["DOLHIDEMESSAGE".$messagekey])) { if (!in_array((string) $style, array('mesgs', 'warnings', 'errors'))) { - dol_print_error('', 'Bad parameter style='.$style.' for setEventMessages'); + dol_print_error(null, 'Bad parameter style='.$style.' for setEventMessages'); } if (empty($mesgs)) { setEventMessage($mesg, $style, $noduplicate); @@ -12755,7 +12755,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n // Check parameters if (!is_object($filterobj) && !is_object($objcon)) { - dol_print_error('', 'BadParameter'); + dol_print_error(null, 'BadParameter'); } $histo = array(); diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index d1ca7df5f7c..3218ee9212d 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -47,7 +47,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = } if (!empty($addfieldentry['arrayofkeyval']) && !is_array($addfieldentry['arrayofkeyval'])) { - dol_print_error('', 'Bad parameter addfieldentry with a property arrayofkeyval defined but that is not an array.'); + dol_print_error(null, 'Bad parameter addfieldentry with a property arrayofkeyval defined but that is not an array.'); return -7; } diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index c0fe5fcf494..ef2a7a55aab 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -1050,7 +1050,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl // If external user: Check permission for external users if ($user->socid > 0) { if (empty($dbt_keyfield)) { - dol_print_error('', 'Param dbt_keyfield is required but not defined'); + dol_print_error(null, 'Param dbt_keyfield is required but not defined'); } $sql = "SELECT COUNT(dbt.".$dbt_keyfield.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; @@ -1060,7 +1060,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl // If internal user without permission to see all thirdparties: Check permission for internal users that are restricted on their objects if ($feature != 'ticket') { if (empty($dbt_keyfield)) { - dol_print_error('', 'Param dbt_keyfield is required but not defined'); + dol_print_error(null, 'Param dbt_keyfield is required but not defined'); } $sql = "SELECT COUNT(sc.fk_soc) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 0a353042113..9632a893acd 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -115,7 +115,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di // If we use date_start and date_end, we must not use $y, $m, $q if (($date_start || $date_end) && (!empty($y) || !empty($m) || !empty($q))) { - dol_print_error('', 'Bad value of input parameter for tax_by_rate'); + dol_print_error(null, 'Bad value of input parameter for tax_by_rate'); } $list = array(); @@ -704,7 +704,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire // If we use date_start and date_end, we must not use $y, $m, $q if (($date_start || $date_end) && (!empty($y) || !empty($m) || !empty($q))) { - dol_print_error('', 'Bad value of input parameter for tax_by_rate'); + dol_print_error(null, 'Bad value of input parameter for tax_by_rate'); } $list = array(); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 1d5cacacb3f..a03c90612f7 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -1250,7 +1250,7 @@ function show_actions_done_user($conf, $langs, $db, $filterobj, $objcon = null, // Check parameters if (!is_object($filterobj) && !is_object($objcon)) { - dol_print_error('', 'BadParameter'); + dol_print_error(null, 'BadParameter'); } $out = ''; diff --git a/htdocs/core/modules/cheque/modules_chequereceipts.php b/htdocs/core/modules/cheque/modules_chequereceipts.php index 3d0477b59fd..0867e22bed7 100644 --- a/htdocs/core/modules/cheque/modules_chequereceipts.php +++ b/htdocs/core/modules/cheque/modules_chequereceipts.php @@ -122,7 +122,7 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs) return -1; } } else { - dol_print_error('', $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $dir.$file)); + dol_print_error(null, $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $dir.$file)); return -1; } } diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 4be27acc2c9..3f01e2fc938 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -271,7 +271,7 @@ class ExportExcel2007 extends ModeleExports $alias = $array_export_fields_label[$code]; //print "dd".$alias; if (empty($alias)) { - dol_print_error('', 'Bad value for field with code='.$code.'. Try to redefine export.'); + dol_print_error(null, 'Bad value for field with code='.$code.'. Try to redefine export.'); } $typefield = isset($array_types[$code]) ? $array_types[$code] : ''; @@ -322,7 +322,7 @@ class ExportExcel2007 extends ModeleExports $alias = substr($code, strpos($code, ' as ') + 4); } if (empty($alias)) { - dol_print_error('', 'Bad value for field with code='.$code.'. Try to redefine export.'); + dol_print_error(null, 'Bad value for field with code='.$code.'. Try to redefine export.'); } $newvalue = $objp->$alias; diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index fa90f362c06..f247b006f89 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -249,7 +249,7 @@ class ExportTsv extends ModeleExports $alias = substr($code, strpos($code, ' as ') + 4); } if (empty($alias)) { - dol_print_error('', 'Bad value for field with code='.$code.'. Try to redefine export.'); + dol_print_error(null, 'Bad value for field with code='.$code.'. Try to redefine export.'); } $newvalue = $outputlangs->convToOutputCharset($objp->$alias); // objp->$alias must be utf8 encoded as any var in memory // newvalue is now $outputlangs->charset_output encoded diff --git a/htdocs/core/modules/export/exportcsv.class.php b/htdocs/core/modules/export/exportcsv.class.php index 72e94904dbc..0808e9bdde9 100644 --- a/htdocs/core/modules/export/exportcsv.class.php +++ b/htdocs/core/modules/export/exportcsv.class.php @@ -236,7 +236,7 @@ class ExportCsv extends ModeleExports $alias = substr($code, strpos($code, ' as ') + 4); } if (empty($alias)) { - dol_print_error('', 'Bad value for field with key='.$code.'. Try to redefine export.'); + dol_print_error(null, 'Bad value for field with key='.$code.'. Try to redefine export.'); } $newvalue = $outputlangs->convToOutputCharset($objp->$alias); // objp->$alias must be utf8 encoded as any var in memory // newvalue is now $outputlangs->charset_output encoded diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index f5b5d004075..10d42804a9c 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -234,7 +234,7 @@ class mod_facture_mars extends ModeleNumRefFactures dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num); return $prefix.$yymm."-".$num; } else { - dol_print_error('', 'Bad parameter for getNextValue'); + dol_print_error(null, 'Bad parameter for getNextValue'); return -1; } } diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index f7937701a3b..12c722f6d9a 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -273,7 +273,7 @@ class mod_facture_terre extends ModeleNumRefFactures dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num); return $prefix.$yymm."-".$num; } else { - dol_print_error('', 'Bad parameter for getNextValue'); + dol_print_error(null, 'Bad parameter for getNextValue'); } return 0; diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index cbade8098ee..541c4644c8f 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -424,7 +424,7 @@ class ImportCsv extends ModeleImports } else { $resultload = dol_include_once($file); if (empty($resultload)) { - dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method); + dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method); break; } $classinstance = new $class($this->db); @@ -503,7 +503,7 @@ class ImportCsv extends ModeleImports } else { $resultload = dol_include_once($file); if (empty($resultload)) { - dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method.', code='.$code); + dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method.', code='.$code); break; } $classinstance = new $class($this->db); @@ -539,7 +539,7 @@ class ImportCsv extends ModeleImports } else { $resultload = dol_include_once($file); if (empty($resultload)) { - dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method.', units='.$units); + dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method.', units='.$units); break; } $classinstance = new $class($this->db); @@ -638,7 +638,7 @@ class ImportCsv extends ModeleImports $method = $objimport->array_import_convertvalue[0][$val]['method']; $resultload = dol_include_once($file); if (empty($resultload)) { - dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method); + dol_print_error(null, 'Error trying to call file='.$file.', class='.$class.', method='.$method); break; } $classinstance = new $class($this->db); @@ -808,7 +808,7 @@ class ImportCsv extends ModeleImports $method = $objimport->array_import_convertvalue[0][$fieldname]['method']; $resultload = dol_include_once($file); if (empty($resultload)) { - dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); + dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); break; } $classinstance = new $class($this->db); @@ -1036,7 +1036,7 @@ class ImportCsv extends ModeleImports } /*else { - dol_print_error('','ErrorFieldListEmptyFor '.$alias."/".$tablename); + dol_print_error(null,'ErrorFieldListEmptyFor '.$alias."/".$tablename); }*/ } diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index badf9469140..740603b836e 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -467,7 +467,7 @@ class ImportXlsx extends ModeleImports } else { $resultload = dol_include_once($file); if (empty($resultload)) { - dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); + dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); break; } $classinstance = new $class($this->db); @@ -546,7 +546,7 @@ class ImportXlsx extends ModeleImports } else { $resultload = dol_include_once($file); if (empty($resultload)) { - dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method . ', code=' . $code); + dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method . ', code=' . $code); break; } $classinstance = new $class($this->db); @@ -582,7 +582,7 @@ class ImportXlsx extends ModeleImports } else { $resultload = dol_include_once($file); if (empty($resultload)) { - dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method . ', units=' . $units); + dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method . ', units=' . $units); break; } $classinstance = new $class($this->db); @@ -681,7 +681,7 @@ class ImportXlsx extends ModeleImports $method = $objimport->array_import_convertvalue[0][$val]['method']; $resultload = dol_include_once($file); if (empty($resultload)) { - dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); + dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); break; } $classinstance = new $class($this->db); @@ -850,7 +850,7 @@ class ImportXlsx extends ModeleImports $method = $objimport->array_import_convertvalue[0][$fieldname]['method']; $resultload = dol_include_once($file); if (empty($resultload)) { - dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); + dol_print_error(null, 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); break; } $classinstance = new $class($this->db); @@ -1079,7 +1079,7 @@ class ImportXlsx extends ModeleImports } /*else { - dol_print_error('','ErrorFieldListEmptyFor '.$alias."/".$tablename); + dol_print_error(null,'ErrorFieldListEmptyFor '.$alias."/".$tablename); }*/ } diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index bf521d58c42..5b2e2ed5703 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -342,7 +342,7 @@ class pdf_standard extends CommonStickerGenerator $this->Tformat = $_Avery_Labels[$this->code]; if (empty($this->Tformat)) { - dol_print_error('', 'ErrorBadTypeForCard'.$this->code); + dol_print_error(null, 'ErrorBadTypeForCard'.$this->code); exit; } @@ -373,7 +373,7 @@ class pdf_standard extends CommonStickerGenerator $title = $outputlangs->transnoentities('MembersCards'); $keywords = $outputlangs->transnoentities('MembersCards')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->name); } else { - dol_print_error('', 'Bad value for $mode'); + dol_print_error(null, 'Bad value for $mode'); return -1; } diff --git a/htdocs/core/modules/member/modules_cards.php b/htdocs/core/modules/member/modules_cards.php index e58bb9b4e14..912c540f220 100644 --- a/htdocs/core/modules/member/modules_cards.php +++ b/htdocs/core/modules/member/modules_cards.php @@ -156,7 +156,7 @@ function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $o return -1; } } else { - dol_print_error('', $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file)); + dol_print_error(null, $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file)); return -1; } } diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 37a72f76df5..c87e770b5eb 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -242,7 +242,7 @@ class pdf_standardlabel extends CommonStickerGenerator $this->code = $srctemplatepath; $this->Tformat = $_Avery_Labels[$this->code]; if (empty($this->Tformat)) { - dol_print_error('', 'ErrorBadTypeForCard'.$this->code); + dol_print_error(null, 'ErrorBadTypeForCard'.$this->code); exit; } $this->type = 'pdf'; diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php index 4ad68cfe233..e133a2309c4 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php @@ -265,7 +265,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator $this->code = $srctemplatepath; $this->Tformat = $_Avery_Labels[$this->code]; if (empty($this->Tformat)) { - dol_print_error('', 'ErrorBadTypeForCard'.$this->code); + dol_print_error(null, 'ErrorBadTypeForCard'.$this->code); exit; } $this->type = 'pdf'; diff --git a/htdocs/core/modules/printsheet/modules_labels.php b/htdocs/core/modules/printsheet/modules_labels.php index d98d6ee8201..7e319e71112 100644 --- a/htdocs/core/modules/printsheet/modules_labels.php +++ b/htdocs/core/modules/printsheet/modules_labels.php @@ -185,7 +185,7 @@ function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outp return -1; } } else { - dol_print_error('', $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file)); + dol_print_error(null, $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file)); return -1; } } diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index 5c8bda2e854..ceea6f23f5b 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -247,7 +247,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num); return $prefix.$yymm."-".$num; } else { - dol_print_error('', 'Bad parameter for getNextValue'); + dol_print_error(null, 'Bad parameter for getNextValue'); return -1; } } diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php index ed0727a5ebf..af9b41f3f97 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php @@ -199,7 +199,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos dol_syslog(get_class($this)."::getNextValue return ".$this->prefix.$pos_source.'-'.$yymm.'-'.$num); return $this->prefix.$pos_source.'-'.$yymm.'-'.$num; } else { - dol_print_error('', 'Bad parameter for getNextValue'); + dol_print_error(null, 'Bad parameter for getNextValue'); return -1; } } diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index a8f89543134..09571f71e31 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -338,14 +338,14 @@ if ($cancel) { header("Location: ".$backtourl); exit; } else { - dol_print_error('', 'Cancel on photo_resize with a not supported value of modulepart='.$modulepart); + dol_print_error(null, 'Cancel on photo_resize with a not supported value of modulepart='.$modulepart); exit; } } if ($action == 'confirm_resize' && GETPOSTISSET("file") && GETPOSTISSET("sizex") && GETPOSTISSET("sizey")) { if (empty($dir)) { - dol_print_error('', 'Bug: Value for $dir could not be defined.'); + dol_print_error(null, 'Bug: Value for $dir could not be defined.'); exit; } @@ -398,7 +398,7 @@ if ($action == 'confirm_resize' && GETPOSTISSET("file") && GETPOSTISSET("sizex") header("Location: ".$backtourl); exit; } else { - dol_print_error('', 'confirm_resize on photo_resize without backtourl defined for modulepart='.$modulepart); + dol_print_error(null, 'confirm_resize on photo_resize without backtourl defined for modulepart='.$modulepart); exit; } } else { @@ -461,7 +461,7 @@ if ($action == 'confirm_crop') { header("Location: ".$backtourl); exit; } else { - dol_print_error('', 'confirm_crop on photo_resize without backtourl defined for modulepart='.$modulepart); + dol_print_error(null, 'confirm_crop on photo_resize without backtourl defined for modulepart='.$modulepart); exit; } } else { diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 7168304b765..b4df3e4311e 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -99,7 +99,7 @@ if ($module == 'propal') { } elseif ($module == 'user') { $permission = $user->hasRight("user", "self", "write"); } -//else dol_print_error('','Bad value '.$module.' for param module'); +//else dol_print_error(null,'Bad value '.$module.' for param module'); if (isModEnabled('fckeditor') && getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC')) { $typeofdatapub = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index 156fe3f37db..f12f4bfb0a4 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -167,7 +167,7 @@ if ($action == 'add' && $permissiontoadd) { } if (empty($dirfornewdir)) { $error++; - dol_print_error('', 'Bad value for module. Not supported.'); + dol_print_error(null, 'Bad value for module. Not supported.'); } if (!$error) { diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index 3d9dc31336f..d69b2495332 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -66,7 +66,7 @@ if (!$sortfield) { $section = GETPOST("section", 'alpha') ? GETPOST("section", 'alpha') : GETPOST("relativedir", 'alpha'); if (!$section) { - dol_print_error('', "ErrorSectionParamNotDefined"); + dol_print_error(null, "ErrorSectionParamNotDefined"); exit; } diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 75e0175ef5b..c580bd97f22 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -65,12 +65,12 @@ if (!$sortfield) { $section = GETPOST("section", 'alpha'); if (!$section) { - dol_print_error('', 'Error, section parameter missing'); + dol_print_error(null, 'Error, section parameter missing'); exit; } $urlfile = (string) dol_sanitizePathName(GETPOST("urlfile"), '_', 0); if (!$urlfile) { - dol_print_error('', "ErrorParamNotDefined"); + dol_print_error(null, "ErrorParamNotDefined"); exit; } diff --git a/htdocs/ecm/file_note.php b/htdocs/ecm/file_note.php index 6b732df75ee..4b4df1321ea 100644 --- a/htdocs/ecm/file_note.php +++ b/htdocs/ecm/file_note.php @@ -69,12 +69,12 @@ if (!$sortfield) { $section = GETPOST("section", 'alpha'); if (!$section) { - dol_print_error('', 'Error, section parameter missing'); + dol_print_error(null, 'Error, section parameter missing'); exit; } $urlfile = (string) dol_sanitizePathName(GETPOST("urlfile")); if (!$urlfile) { - dol_print_error('', "ErrorParamNotDefined"); + dol_print_error(null, "ErrorParamNotDefined"); exit; } diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index d81411b35b5..36bb980c1c2 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -985,7 +985,7 @@ class ConferenceOrBoothAttendee extends CommonObject } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index c304b4a82b5..105cccb1af8 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -309,7 +309,7 @@ class Expedition extends CommonObject } if (!$mybool) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index bd764eb966c..8ed2b44f37d 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1735,7 +1735,7 @@ if ($action == 'create') { $userauthor = new User($db); $result = $userauthor->fetch($object->fk_user_author); if ($result < 0) { - dol_print_error('', $userauthor->error); + dol_print_error(null, $userauthor->error); } elseif ($result > 0) { print $userauthor->getNomUrl(-1); } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index a46b61ad3b1..d3904027f41 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1676,7 +1676,7 @@ class ExpenseReport extends CommonObject } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 5f0fb215159..aa2bfdbe877 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -466,7 +466,7 @@ if ($action == 'create') { print "\n"; } else { - dol_print_error('', "Error, no fichinter ".$object->id); + dol_print_error(null, "Error, no fichinter ".$object->id); } } elseif ($action == 'selsocforcreatefrommodel') { print load_fiche_titre($langs->trans("CreateRepeatableIntervention"), '', 'intervention'); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 9b91f6bed23..bb7a79c09fa 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -96,7 +96,7 @@ if ($id > 0 || !empty($ref)) { $ret = $object->fetch_thirdparty(); } if ($ret < 0) { - dol_print_error('', $object->error); + dol_print_error(null, $object->error); } } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index b5e2fe02407..9c713578a5f 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -985,7 +985,7 @@ class Fichinter extends CommonObject } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index e5fabd8d3eb..7ca86eadacb 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1035,7 +1035,7 @@ class CommandeFournisseur extends CommonOrder } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index ea1bf8d16ca..58523506699 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2970,7 +2970,7 @@ class FactureFournisseur extends CommonInvoice } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 1a4e917134b..319a2dfe603 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -799,7 +799,7 @@ class PaiementFourn extends Paiement } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index d196d562ba6..94198ded8ca 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -1103,7 +1103,7 @@ if ($action == 'create') { print "\n"; } else { - dol_print_error('', "Error, no invoice " . $object->id); + dol_print_error(null, "Error, no invoice " . $object->id); } } else { /* diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index 81a72b609b9..a015d68976d 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -124,7 +124,7 @@ if ($action == 'uploadfile') { } $action = ''; } else { - dol_print_error('', $mesg); + dol_print_error(null, $mesg); } } @@ -148,7 +148,7 @@ if ($action == 'addfolder') { } $action = ''; } else { - dol_print_error('', $mesg); + dol_print_error(null, $mesg); } } @@ -193,7 +193,7 @@ if ($action == 'confirm_deletefile' && GETPOST('confirm') == 'yes') { $action = ''; } else { - dol_print_error('', $mesg); + dol_print_error(null, $mesg); } } @@ -232,7 +232,7 @@ if (GETPOST("const", 'array') && GETPOST("delete") && GETPOST("delete") == $lang } } } else { - dol_print_error('', $mesg); + dol_print_error(null, $mesg); } } @@ -262,7 +262,7 @@ if ($action == 'confirm_deletesection' && $confirm == 'yes') { $action = ''; } else { - dol_print_error('', $mesg); + dol_print_error(null, $mesg); } } @@ -321,7 +321,7 @@ if ($action == 'download') { setEventMessages($langs->transnoentitiesnoconv('FailedToGetFile', $file), null, 'errors'); } } else { - dol_print_error('', $mesg); + dol_print_error(null, $mesg); } //ftp_close($conn_id); Close later diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 73ce39159ff..62406ef94d3 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -209,7 +209,7 @@ class Holiday extends CommonObject } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } @@ -1233,7 +1233,7 @@ class Holiday extends CommonObject } } } else { - dol_print_error('', 'Bad value of parameter halfday when calling function verifDateHolidayCP'); + dol_print_error(null, 'Bad value of parameter halfday when calling function verifDateHolidayCP'); } } diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 6ac49d0291f..7f752387952 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -970,7 +970,7 @@ class Evaluation extends CommonObject } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index d5989b0f71e..f1e8f2b006d 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -938,7 +938,7 @@ class EvaluationLine extends CommonObjectLine } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 82f0affcd34..7f3f8ef399c 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -977,7 +977,7 @@ class Job extends CommonObject } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index de76565d035..7b3a9a5681c 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -1020,7 +1020,7 @@ class Position extends CommonObject } if ($mybool === false) { - dol_print_error('', "Failed to include file " . $file); + dol_print_error(null, "Failed to include file " . $file); return ''; } diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index aa731a9e487..82d151b49cb 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -1019,7 +1019,7 @@ class Skill extends CommonObject } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index ee5deedac9a..762352f8d74 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -906,7 +906,7 @@ class Skilldet extends CommonObjectLine } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index c43318b59ef..860e1daa80c 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -980,7 +980,7 @@ class SkillRank extends CommonObject } if ($mybool === false) { - dol_print_error('', "Failed to include file ".$file); + dol_print_error(null, "Failed to include file ".$file); return ''; } diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index d0b5b20610e..99170d4c9c6 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -69,7 +69,7 @@ if ($dolibarr_main_db_type == "sqlite") { if ($dolibarr_main_db_type == "sqlite3") { $choix = 5; } -//if (empty($choix)) dol_print_error('','Database type '.$dolibarr_main_db_type.' not supported into step2.php page'); +//if (empty($choix)) dol_print_error(null,'Database type '.$dolibarr_main_db_type.' not supported into step2.php page'); // Now we load forced values from install.forced.php file. diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index 1b1cbe8f103..a757ceb7c8d 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -423,7 +423,7 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) { print $langs->trans("ErrorFailedToConnect")."