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 '
'; diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 8a941c70d86..4e9a8f93b09 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -781,7 +781,7 @@ class AccountancyCategory // extends CommonObject global $conf, $mysoc; if (empty($mysoc->country_id)) { - 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(); } @@ -846,7 +846,7 @@ class AccountancyCategory // extends CommonObject $sql = ''; if (empty($mysoc->country_id) && empty($mysoc->country_code)) { - 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/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index 0906f7c4754..62bd97df17f 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -50,7 +50,7 @@ $result = $object->fetch($id_journal); if ($result > 0) { $id_journal = $object->id; } elseif ($result < 0) { - dol_print_error('', $object->error, $object->errors); + dol_print_error(null, $object->error, $object->errors); } elseif ($result == 0) { accessforbidden('ErrorRecordNotFound'); } diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 515c0bd46af..1af279d33d4 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -913,7 +913,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object = new Adherent($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/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index c47e745c8b8..1b4eb4979e1 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -245,7 +245,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) { } if ($result <= 0) { - dol_print_error('', $result); + dol_print_error(null, $result); } } else { dol_print_error($db); diff --git a/htdocs/adherents/partnership.php b/htdocs/adherents/partnership.php index 639adb8e950..2ec81fdbea9 100644 --- a/htdocs/adherents/partnership.php +++ b/htdocs/adherents/partnership.php @@ -197,7 +197,7 @@ if ($id > 0) { print dol_get_fiche_end(); } else { - dol_print_error('', 'Parameter rowid not defined'); + dol_print_error(null, 'Parameter rowid not defined'); } diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 4b8917f62c1..7c6647835d8 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -163,7 +163,7 @@ if (empty($reshook) && $action == 'setuserid' && ($user->hasRight('user', 'self' if (GETPOST("userid", 'int') != $object->user_id) { // If link differs from currently in database $result = $object->setUserId(GETPOST("userid", 'int')); if ($result < 0) { - dol_print_error('', $object->error); + dol_print_error(null, $object->error); } $action = ''; } @@ -192,7 +192,7 @@ if (empty($reshook) && $action == 'setsocid') { if (!$error) { $result = $object->setThirdPartyId(GETPOST('socid', 'int')); if ($result < 0) { - dol_print_error('', $object->error); + dol_print_error(null, $object->error); } $action = ''; } diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index ea37636f882..14ba0d5eddb 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -59,7 +59,7 @@ if ($action == 'updateik') { if ($id > 0) { $result = $expIk->fetch($id); if ($result < 0) { - dol_print_error('', $expIk->error, $expIk->errors); + dol_print_error(null, $expIk->error, $expIk->errors); } } @@ -85,7 +85,7 @@ if ($action == 'updateik') { if ($id > 0) { $result = $expIk->fetch($id); if ($result < 0) { - dol_print_error('', $expIk->error, $expIk->errors); + dol_print_error(null, $expIk->error, $expIk->errors); } $expIk->delete($user); diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index e8415d5704e..dc1dd8b6782 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -75,7 +75,7 @@ if (empty($reshook)) { if (!empty($id)) { $result = $object->fetch($id); if ($result < 0) { - dol_print_error('', $object->error, $object->errors); + dol_print_error(null, $object->error, $object->errors); } } diff --git a/htdocs/ai/lib/generate_content.lib.php b/htdocs/ai/lib/generate_content.lib.php index efe8a019c86..898bd2205ca 100644 --- a/htdocs/ai/lib/generate_content.lib.php +++ b/htdocs/ai/lib/generate_content.lib.php @@ -50,11 +50,11 @@ $rawData = file_get_contents('php://input'); $jsonData = json_decode($rawData, true); if (is_null($jsonData)) { - dol_print_error('data with format JSON valide.'); + dol_print_error(null, 'data with format JSON valide.'); } $token = GETPOST('token'); if ($token !== currentToken()) { // Remplacez 'newToken' par le nom de votre variable de session contenant le token - dol_print_error('CSRF token validation failed.'); + dol_print_error(null, 'CSRF token validation failed.'); exit; } $chatGPT = new Ai('API_ENDPOINT', 'API_KEY'); @@ -66,5 +66,5 @@ $generatedContent = $chatGPT->generateContent($instructions); if ($generatedContent) { print $generatedContent; } else { - dol_print_error('error!!'); + dol_print_error(null, 'error!!'); } diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index c40ed08734d..ac214b4fc64 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -1561,7 +1561,7 @@ class Asset 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/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 9d2e0babbe0..41bb5881d47 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -890,7 +890,7 @@ class BOM 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/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 87a4dc4d0f8..d80af0daa87 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -1019,7 +1019,7 @@ class Availabilities 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/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index c13266c7df9..12086607201 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -1007,7 +1007,7 @@ class Calendar 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/categories/edit.php b/htdocs/categories/edit.php index fd82b212feb..16965accb55 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -50,7 +50,7 @@ $visible = (int) GETPOST('visible', 'int'); $parent = (int) GETPOST('parent', 'int'); if ($id == "") { - dol_print_error('', 'Missing parameter id'); + dol_print_error(null, 'Missing parameter id'); exit(); } diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 0426e0fbf01..4757aab5fdd 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -43,7 +43,7 @@ $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); if ($id == '' && $label == '') { - dol_print_error('', 'Missing parameter id'); + dol_print_error(null, 'Missing parameter id'); exit(); } diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index f7cceea73be..9293c62219b 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -42,7 +42,7 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); if ($id == '' && $label == '') { - dol_print_error('', 'Missing parameter id'); + dol_print_error(null, 'Missing parameter id'); exit(); } diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 19459aa6806..75fcab83c19 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -66,7 +66,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; if ($id == "" && $label == "") { - dol_print_error('', 'Missing parameter id'); + dol_print_error(null, 'Missing parameter id'); exit(); } @@ -153,7 +153,7 @@ if ($id > 0 && $removeelem > 0 && $action == 'unlink') { $result = $object->del_type($tmpobject, $elementtype); if ($result < 0) { - dol_print_error('', $object->error); + dol_print_error(null, $object->error); } } diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 9890bf275d4..d876f75a595 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -127,7 +127,7 @@ if ($id > 0 && $action != 'add') { $ret1 = $object->fetch_userassigned(); } if ($ret < 0 || $ret1 < 0) { - dol_print_error('', $object->error); + dol_print_error(null, $object->error); } } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 0a5916135d1..3595296fec3 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -163,7 +163,7 @@ if (empty($reshook)) { $action = ''; } else { if ($object->statut == 0) { - dol_print_error('', 'ErrorMailIsNotValidated'); + dol_print_error(null, 'ErrorMailIsNotValidated'); exit; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 30cc87f0df4..a433e6b85e6 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3761,7 +3761,7 @@ class Propal 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/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 13b0f27c4ae..8e94ee5e645 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -436,7 +436,7 @@ class Commande 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/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 5689bde28ff..c12b7801f43 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1301,7 +1301,7 @@ if ($resql) { // If we are in a situation where we need/can show balance, we calculate the start of balance if (!$balancecalculated && (!empty($arrayfields['balancebefore']['checked']) || !empty($arrayfields['balance']['checked'])) && ($mode_balance_ok || $search_conciliated === '0')) { if (!$search_account) { - dol_print_error('', 'account is not defined but $mode_balance_ok is true'); + dol_print_error(null, 'account is not defined but $mode_balance_ok is true'); exit; } diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 479f09dabde..561ee0ac68c 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -235,7 +235,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) { $object->fetch($id); 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; } @@ -351,7 +351,7 @@ if ($action == "create" || $action == "start" || $action == 'close') { } elseif ($key == 'card') { $sql .= " AND cp.code = 'CB'"; } else { - dol_print_error('Value for key = '.$key.' not supported'); + dol_print_error(null, 'Value for key = '.$key.' not supported'); exit; } if ($syear && !$smonth) { diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index b8a062c0111..abf58daf200 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -114,7 +114,7 @@ $sql.= " AND f.entity IN (".getEntity('facture').")"; if ($syear && ! $smonth) $sql.= " AND dateo BETWEEN '".$db->idate(dol_get_first_day($syear, 1))."' AND '".$db->idate(dol_get_last_day($syear, 12))."'"; elseif ($syear && $smonth && ! $sday) $sql.= " AND dateo BETWEEN '".$db->idate(dol_get_first_day($syear, $smonth))."' AND '".$db->idate(dol_get_last_day($syear, $smonth))."'"; elseif ($syear && $smonth && $sday) $sql.= " AND dateo BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $smonth, $sday, $syear))."'"; -else dol_print_error('', 'Year not defined'); +else dol_print_error(null, 'Year not defined'); // Define filter on bank account $sql.=" AND (b.fk_account = ".((int) $conf->global->CASHDESK_ID_BANKACCOUNT_CASH); $sql.=" OR b.fk_account = ".((int) $conf->global->CASHDESK_ID_BANKACCOUNT_CB); @@ -133,7 +133,7 @@ elseif ($key == 'cheque') $sql.=" AND cp.code = 'CHQ'"; elseif ($key == 'card') $sql.=" AND cp.code = 'CB'"; else { - dol_print_error('Value for key = '.$key.' not supported'); + dol_print_error(null, 'Value for key = '.$key.' not supported'); exit; }*/ if ($syear && !$smonth) { @@ -143,7 +143,7 @@ if ($syear && !$smonth) { } elseif ($syear && $smonth && $sday) { $sql .= " AND datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $smonth, $sday, $syear))."'"; } else { - dol_print_error('', 'Year not defined'); + dol_print_error(null, 'Year not defined'); } $resql = $db->query($sql); diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index e6266ebf387..6bcae9c5d48 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1204,7 +1204,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/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")."
"; } } else { - dol_print_error('', 'step5.php: unknown choice of action'); + dol_print_error(null, 'step5.php: unknown choice of action'); } $db->close(); @@ -533,7 +533,7 @@ if ($action == "set") { $morehtml .= ''; } } else { - dol_print_error('', 'step5.php: unknown choice of action='.$action.' in create lock file seaction'); + dol_print_error(null, 'step5.php: unknown choice of action='.$action.' in create lock file seaction'); } // Clear cache files diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 5a44a0d939a..f4c1871401b 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -1019,7 +1019,7 @@ class KnowledgeRecord 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/loan/card.php b/htdocs/loan/card.php index 3a19d530054..dc7baa5885b 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -774,7 +774,7 @@ if ($id > 0) { } } else { // Loan not found - dol_print_error('', $object->error); + dol_print_error(null, $object->error); } } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e77cb81320c..967c8459ec6 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -707,7 +707,7 @@ if (!defined('NOLOGIN')) { // No authentication mode if (!count($authmode)) { $langs->load('main'); - dol_print_error('', $langs->trans("ErrorConfigParameterNotDefined", 'dolibarr_main_authentication')); + dol_print_error(null, $langs->trans("ErrorConfigParameterNotDefined", 'dolibarr_main_authentication')); exit; } diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 53008e78728..20c16c4fcbd 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -294,7 +294,7 @@ if ($socid > 0) { print '
'; $db->free($result); } else { - dol_print_error('', 'Parameter socid not defined'); + dol_print_error(null, 'Parameter socid not defined'); } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index e50d22b3a69..a319904e63d 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -1173,7 +1173,7 @@ class MyObject 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/modulebuilder/template/scripts/mymodule.php b/htdocs/modulebuilder/template/scripts/mymodule.php index 8d2e0060d0b..7ced7fd6c6f 100644 --- a/htdocs/modulebuilder/template/scripts/mymodule.php +++ b/htdocs/modulebuilder/template/scripts/mymodule.php @@ -102,7 +102,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/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 832158a22da..a950f4f9f57 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -987,7 +987,7 @@ class Mo 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/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 97819f7bf3a..87fe51a185a 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -198,7 +198,7 @@ if (empty($reshook)) { 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/opensurvey/exportcsv.php b/htdocs/opensurvey/exportcsv.php index d98720bfd45..4ca53fbd296 100644 --- a/htdocs/opensurvey/exportcsv.php +++ b/htdocs/opensurvey/exportcsv.php @@ -40,7 +40,7 @@ if (GETPOST('id')) { $object = new Opensurveysondage($db); $result = $object->fetch(0, $numsondage); if ($result <= 0) { - dol_print_error('', 'Failed to get survey id '.$numsondage); + dol_print_error(null, 'Failed to get survey id '.$numsondage); } // Security check diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index be6d3169cd3..6f33debeb00 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -42,7 +42,7 @@ $numsondage = GETPOST("id", 'alphanohtml'); $object = new Opensurveysondage($db); $result = $object->fetch(0, $numsondage); if ($result <= 0) { - dol_print_error('', 'Failed to get survey id '.$numsondage); + dol_print_error(null, 'Failed to get survey id '.$numsondage); } $nblines = $object->fetch_lines(); diff --git a/htdocs/opensurvey/wizard/choix_autre.php b/htdocs/opensurvey/wizard/choix_autre.php index 8422b1dfedc..aceb0cbe76d 100644 --- a/htdocs/opensurvey/wizard/choix_autre.php +++ b/htdocs/opensurvey/wizard/choix_autre.php @@ -105,7 +105,7 @@ $arrayofcss = array('/opensurvey/css/style.css'); llxHeader('', $langs->trans("OpenSurvey"), "", '', 0, 0, $arrayofjs, $arrayofcss); if (empty($_SESSION['title'])) { - dol_print_error('', $langs->trans('ErrorOpenSurveyFillFirstSection')); + dol_print_error(null, $langs->trans('ErrorOpenSurveyFillFirstSection')); llxFooter(); exit; } diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index c37b2c8deea..7906d244681 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -205,7 +205,7 @@ if (GETPOST('reset')) { */ if (!isset($_SESSION['description']) && !isset($_SESSION['mail'])) { - dol_print_error('', $langs->trans('ErrorOpenSurveyFillFirstSection')); + dol_print_error(null, $langs->trans('ErrorOpenSurveyFillFirstSection')); exit; } diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 2e8210b6e96..793cf118b64 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -1206,7 +1206,7 @@ class Partnership 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/paybox/lib/paybox.lib.php b/htdocs/paybox/lib/paybox.lib.php index 0faef11468e..7138646c8ca 100644 --- a/htdocs/paybox/lib/paybox.lib.php +++ b/htdocs/paybox/lib/paybox.lib.php @@ -72,19 +72,19 @@ function print_paybox_redirect($PRICE, $CURRENCY, $EMAIL, $urlok, $urlko, $TAG) } if (empty($IBS_DEVISE)) { - dol_print_error('', "Paybox setup param PAYBOX_IBS_DEVISE not defined"); + dol_print_error(null, "Paybox setup param PAYBOX_IBS_DEVISE not defined"); return -1; } if (empty($URLPAYBOX)) { - dol_print_error('', "Paybox setup param PAYBOX_CGI_URL_V1 and PAYBOX_CGI_URL_V2 undefined"); + dol_print_error(null, "Paybox setup param PAYBOX_CGI_URL_V1 and PAYBOX_CGI_URL_V2 undefined"); return -1; } if (empty($IBS_SITE)) { - dol_print_error('', "Paybox setup param PAYBOX_IBS_SITE not defined"); + dol_print_error(null, "Paybox setup param PAYBOX_IBS_SITE not defined"); return -1; } if (empty($IBS_RANG)) { - dol_print_error('', "Paybox setup param PAYBOX_IBS_RANG not defined"); + dol_print_error(null, "Paybox setup param PAYBOX_IBS_RANG not defined"); return -1; } diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index c33df050da0..5f54a8efa77 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -817,7 +817,7 @@ class ProductFournisseurPrice 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/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index d9cd71a4d29..6decd5e6f4a 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -430,7 +430,7 @@ llxHeader('', $langs->trans('Inventory'), $help_url); // Part to show record if ($object->id <= 0) { - dol_print_error('', 'Bad value for object id'); + dol_print_error(null, 'Bad value for object id'); exit; } diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 7535d4c2bb4..27a0cc5cf76 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -221,7 +221,7 @@ class MouvementStock extends CommonObject if ($reshook < 0) { if (!empty($hookmanager->resPrint)) { - dol_print_error('', $hookmanager->resPrint); + dol_print_error(null, $hookmanager->resPrint); } return $reshook; } elseif ($reshook > 0) { @@ -276,7 +276,7 @@ class MouvementStock extends CommonObject if ($result < 0) { $this->error = $product->error; $this->errors = $product->errors; - dol_print_error('', "Failed to fetch product"); + dol_print_error(null, "Failed to fetch product"); return -1; } if ($product->id <= 0) { // Can happen if database is corrupted (a product id exist in stock with product that has been removed) diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 48fdd6d27d8..84b8b8d0379 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -296,7 +296,7 @@ if ($action == 'createmovements' && $user->hasRight('stock', 'mouvement', 'creer } } } else { - // dol_print_error('',"Bad value saved into sessions"); + // dol_print_error(null,"Bad value saved into sessions"); $error++; } } diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index 513e7746200..08d1213c47b 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -993,7 +993,7 @@ class StockTransfer 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/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php index f1a19e3324a..a17df806b8f 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php @@ -948,7 +948,7 @@ class StockTransferLine 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/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 90a7d140341..6264dbf3f72 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -2085,7 +2085,7 @@ class Project extends CommonObject $this->weekWorkLoadPerTask = array(); if (empty($datestart)) { - dol_print_error('', 'Error datestart parameter is empty'); + dol_print_error(null, 'Error datestart parameter is empty'); } $sql = "SELECT ptt.rowid as taskid, ptt.element_duration, ptt.element_date, ptt.element_datehour, ptt.fk_element"; @@ -2149,7 +2149,7 @@ class Project extends CommonObject $this->monthWorkLoadPerTask = array(); if (empty($datestart)) { - dol_print_error('', 'Error datestart parameter is empty'); + dol_print_error(null, 'Error datestart parameter is empty'); } $sql = "SELECT ptt.rowid as taskid, ptt.element_duration, ptt.element_date, ptt.element_datehour, ptt.fk_element"; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 64ce3e64cfc..93b1bc246f2 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1303,7 +1303,7 @@ class Task extends CommonObjectLine // Check parameters if (!is_object($user)) { - dol_print_error('', "Method addTimeSpent was called with wrong parameter user"); + dol_print_error(null, "Method addTimeSpent was called with wrong parameter user"); return -1; } diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index be56c01ff31..0b41852d162 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -178,7 +178,7 @@ if ($object->id > 0) { $permtoedit = ($userWrite > 0); include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { - dol_print_error('', 'NoRecordFound'); + dol_print_error(null, 'NoRecordFound'); } // End of page diff --git a/htdocs/public/partnership/new.php b/htdocs/public/partnership/new.php index a3e6f0ffbc1..29de8a88ff1 100644 --- a/htdocs/public/partnership/new.php +++ b/htdocs/public/partnership/new.php @@ -491,7 +491,7 @@ if (empty($reshook) && $action == 'add') { } } } else { - dol_print_error('', "Autosubscribe form is setup to ask an online payment for a not managed online payment"); + dol_print_error(null, "Autosubscribe form is setup to ask an online payment for a not managed online payment"); exit; } }*/ diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 7f0490629b0..f566c080d62 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1345,7 +1345,7 @@ if ($source == 'contractline') { $amount = $pu_ttc; if (empty($amount)) { - dol_print_error('', 'ErrorNoPriceDefinedForThisProduct'); + dol_print_error(null, 'ErrorNoPriceDefinedForThisProduct'); exit; } } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 0aaae6bdcee..7c307ef3b24 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -317,7 +317,7 @@ if (isModEnabled('paypal')) { $ErrorShortMsg = "Session expired"; dol_syslog($ErrorLongMsg, LOG_WARNING, 0, '_payment'); - dol_print_error('', 'Session expired'); + dol_print_error(null, 'Session expired'); } } else { $ErrorCode = "PAYPALTOKENNOTDEFINED"; @@ -325,7 +325,7 @@ if (isModEnabled('paypal')) { $ErrorShortMsg = "Parameter PAYPALTOKEN not defined"; dol_syslog($ErrorLongMsg, LOG_WARNING, 0, '_payment'); - dol_print_error('', 'PAYPALTOKEN not defined'); + dol_print_error(null, 'PAYPALTOKEN not defined'); } } } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index a24bb2814d0..a67f9691c53 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -183,7 +183,7 @@ class Reception 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/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index 3dc1ff59e3d..479874fea05 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -966,7 +966,7 @@ class RecruitmentCandidature 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/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 44fe7f53501..9dd025a2470 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -1023,7 +1023,7 @@ class RecruitmentJobPosition 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/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index b835aefb480..e13889971df 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -374,7 +374,7 @@ class Dolresource extends CommonObject $error++; } } - }diction + } } if (!$error) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b9d390a47d9..ba5cab1e5b8 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -859,7 +859,7 @@ if (isModEnabled('accounting')) { if ($socid > 0 && empty($object->id)) { $result = $object->fetch($socid); if ($result <= 0) { - dol_print_error('', $object->error); + dol_print_error(null, $object->error); exit(-1); } } diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 612336ea797..e2522b534d5 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -146,7 +146,7 @@ $formcompany = new FormCompany($db); if ($socid > 0 && empty($object->id)) { $result = $object->fetch($socid); if ($result <= 0) { - dol_print_error('', $object->error); + dol_print_error(null, $object->error); } } diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index d095ddc258a..c85afa9b9c5 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -516,7 +516,7 @@ if ($result > 0) { print ''; } else { - dol_print_error('', 'RecordNotFound'); + dol_print_error(null, 'RecordNotFound'); } // End of page diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 8d11b49434d..7018339149d 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2429,7 +2429,7 @@ class SupplierProposal 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/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index c6443027d0f..20a2ea638ae 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -634,7 +634,7 @@ class Ticket extends CommonObject // Check parameters if (empty($id) && empty($ref) && empty($track_id) && empty($email_msgid)) { $this->error = 'ErrorWrongParameters'; - dol_print_error('', get_class($this)."::fetch ".$this->error); + dol_print_error(null, get_class($this)."::fetch ".$this->error); return -1; } diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index ca36da62add..37e8e780067 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -539,7 +539,7 @@ if ($result > 0) { print ''; } else { - dol_print_error('', 'RecordNotFound'); + dol_print_error(null, 'RecordNotFound'); } // End of page diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 9ae8dc6ee45..c5dbafc3183 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -949,7 +949,7 @@ class Target 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/website/index.php b/htdocs/website/index.php index 162fc6520d5..da87ca8a43a 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -213,7 +213,7 @@ if (empty($pageid) && empty($pageref) && $object->id > 0 && $action != 'createco if (empty($pageid)) { $array = $objectpage->fetchAll($object->id, 'ASC,ASC', 'type_container,pageurl'); if (!is_array($array) && $array < 0) { - dol_print_error('', $objectpage->error, $objectpage->errors); + dol_print_error(null, $objectpage->error, $objectpage->errors); } $atleastonepage = (is_array($array) && count($array) > 0); @@ -370,7 +370,7 @@ if (GETPOST('refreshsite', 'alpha') || GETPOST('refreshsite.x', 'alpha') || GETP if (empty($pageid)) { $array = $objectpage->fetchAll($object->id, 'ASC,ASC', 'type_container,pageurl'); if (!is_array($array) && $array < 0) { - dol_print_error('', $objectpage->error, $objectpage->errors); + dol_print_error(null, $objectpage->error, $objectpage->errors); } $atleastonepage = (is_array($array) && count($array) > 0); @@ -2885,7 +2885,7 @@ if (!GETPOST('hide_websitemenu')) { $object->lines = $array; } if (!is_array($array) && $array < 0) { - dol_print_error('', $objectpage->error, $objectpage->errors); + dol_print_error(null, $objectpage->error, $objectpage->errors); } $atleastonepage = (is_array($array) && count($array) > 0); diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index c3a03763d8f..85cd786b9b0 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -899,7 +899,7 @@ class Workstation 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/scripts/doc/regenerate_docs.php b/scripts/doc/regenerate_docs.php index e4aa60b1e4a..34e732d9827 100755 --- a/scripts/doc/regenerate_docs.php +++ b/scripts/doc/regenerate_docs.php @@ -70,7 +70,7 @@ print '--- start'."\n"; $dir = DOL_DATA_ROOT; $subdir = $argv[1]; if (empty($dir) || empty($subdir)) { - dol_print_error('', 'dir not defined'); + dol_print_error(null, 'dir not defined'); exit(1); } if (!dol_is_dir($dir.'/'.$subdir)) { diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index eb2e0a60828..ea183191086 100755 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -304,11 +304,11 @@ if ($result >= 0) { } print "\n"; } else { - dol_print_error('', $ldap->error); + dol_print_error(null, $ldap->error); $error++; } } else { - dol_print_error('', $ldap->error); + dol_print_error(null, $ldap->error); $error++; } diff --git a/scripts/members/sync_members_types_ldap2dolibarr.php b/scripts/members/sync_members_types_ldap2dolibarr.php index 8d4624bbc55..0ef44facabb 100755 --- a/scripts/members/sync_members_types_ldap2dolibarr.php +++ b/scripts/members/sync_members_types_ldap2dolibarr.php @@ -186,11 +186,11 @@ if ($result >= 0) { } print "\n"; } else { - dol_print_error('', $ldap->error); + dol_print_error(null, $ldap->error); $error++; } } else { - dol_print_error('', $ldap->error); + dol_print_error(null, $ldap->error); $error++; } diff --git a/scripts/product/regenerate_thumbs.php b/scripts/product/regenerate_thumbs.php index 3b123fd614c..b81e93c053e 100755 --- a/scripts/product/regenerate_thumbs.php +++ b/scripts/product/regenerate_thumbs.php @@ -70,7 +70,7 @@ print '--- start'."\n"; $dir = DOL_DATA_ROOT; $subdir = $argv[1]; if (empty($dir) || empty($subdir)) { - dol_print_error('', 'dir not defined'); + dol_print_error(null, 'dir not defined'); exit(1); } if (!dol_is_dir($dir.'/'.$subdir)) { diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index a737f412301..7712e688e7c 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -236,11 +236,11 @@ if ($result >= 0) { } print "\n"; } else { - dol_print_error('', $ldap->error); + dol_print_error(null, $ldap->error); $error++; } } else { - dol_print_error('', $ldap->error); + dol_print_error(null, $ldap->error); $error++; } diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php index f3feb6084c0..145a8a7e41c 100755 --- a/scripts/user/sync_users_ldap2dolibarr.php +++ b/scripts/user/sync_users_ldap2dolibarr.php @@ -288,11 +288,11 @@ if ($result >= 0) { } print "\n"; } else { - dol_print_error('', $ldap->error); + dol_print_error(null, $ldap->error); $error++; } } else { - dol_print_error('', $ldap->error); + dol_print_error(null, $ldap->error); $error++; }