Compatibility phpv8

This commit is contained in:
Givriz 2021-04-23 18:01:11 +02:00
parent 51176deb41
commit a451fee68f
5 changed files with 27 additions and 27 deletions

View File

@ -48,7 +48,7 @@ $substitutionarrayfortest = array(
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
'__ID__' => 'RecipientIdRecord',
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
'__CHECK_READ__' => (is_object($object) && !empty($object->thirdparty) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
'__CHECK_READ__' => (!empty($object) && is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
'__LOGIN__' => 'RecipientLogin',
'__LASTNAME__' => 'RecipientLastname',
@ -737,14 +737,14 @@ if ($action == 'edit') {
print '<tr class="oddeven"><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td>';
print '<td>';
if (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') {
if (getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE') === 'robot') {
print $langs->trans('RobotEmail');
} elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') {
} elseif (getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE') === 'user') {
print $langs->trans('UserEmail');
} elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') {
} elseif (getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE') === 'company') {
print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>');
} else {
$id = preg_replace('/senderprofile_/', '', !empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : '');
$id = preg_replace('/senderprofile_/', '', getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE'));
if ($id > 0) {
include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php';
$emailsenderprofile = new EmailSenderProfile($db);
@ -756,7 +756,7 @@ if ($action == 'edit') {
// Errors To
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ERRORS_TO").'</td>';
print '<td>'.(!empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : '');
print '<td>'.(getDolGlobalString('MAIN_MAIL_ERRORS_TO'));
if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) {
print img_warning($langs->trans("ErrorBadEMail"));
}

View File

@ -53,8 +53,8 @@ print '<span class="opacitymedium">'.$langs->trans("FileCheckDesc").'</span><br>
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastUpgrade").'</td><td>'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastInstall").'</td><td>'.getDolGlobalString('MAIN_VERSION_LAST_INSTALL').'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastUpgrade").'</td><td>'.getDolGlobalString('MAIN_VERSION_LAST_UPGRADE').'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionProgram").'</td><td>'.DOL_VERSION;
// If current version differs from last upgrade
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) {
@ -171,7 +171,7 @@ if (GETPOST('target') == 'remote') {
}
if (!$error && $xml) {
if (empty($error) && !empty($xml)) {
$checksumconcat = array();
$file_list = array();
$out = '';

View File

@ -157,7 +157,7 @@ $title = $langs->trans("BackupDumpWizard");
print load_fiche_titre($title);
print '<table width="100%" class="'.($useinecm ? 'nobordernopadding' : 'liste').' nohover">';
print '<table width="100%" class="'.(!empty($useinecm) ? 'nobordernopadding' : 'liste').' nohover">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b><br>';

View File

@ -234,7 +234,7 @@ $nbtotalofrecords = '';
$sql .= $db->plimit($conf->liste_limit + 1, $offset);
//print $sql;
$result = $db->query($sql);
if ($result) {
if (!empty($result)) {
$num = $db->num_rows($result);
$i = 0;
@ -245,55 +245,55 @@ if ($result) {
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit);
}
if ($optioncss != '') {
if (!empty($optioncss) && $optioncss != '') {
$param .= '&optioncss='.urlencode($optioncss);
}
if ($search_code) {
if (!empty($search_code)) {
$param .= '&search_code='.urlencode($search_code);
}
if ($search_ip) {
if (!empty($search_ip)) {
$param .= '&search_ip='.urlencode($search_ip);
}
if ($search_user) {
if (!empty($search_user)) {
$param .= '&search_user='.urlencode($search_user);
}
if ($search_desc) {
if (!empty($search_desc)) {
$param .= '&search_desc='.urlencode($search_desc);
}
if ($search_ua) {
if (!empty($search_ua)) {
$param .= '&search_ua='.urlencode($search_ua);
}
if ($search_prefix_session) {
if (!empty($search_prefix_session)) {
$param .= '&search_prefix_session='.urlencode($search_prefix_session);
}
if ($date_startmonth) {
if (!empty($date_startmonth)) {
$param .= "&date_startmonth=".urlencode($date_startmonth);
}
if ($date_startday) {
if (!empty($date_startday)) {
$param .= "&date_startday=".urlencode($date_startday);
}
if ($date_startyear) {
if (!empty($date_startyear)) {
$param .= "&date_startyear=".urlencode($date_startyear);
}
if ($date_endmonth) {
if (!empty($date_endmonth)) {
$param .= "&date_endmonth=".urlencode($date_endmonth);
}
if ($date_endday) {
if (!empty($date_endday)) {
$param .= "&date_endday=".urlencode($date_endday);
}
if ($date_endyear) {
if (!empty($date_endyear)) {
$param .= "&date_endyear=".urlencode($date_endyear);
}
$langs->load('withdrawals');
if ($num) {
if (!empty($num)) {
$center = '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=purge">'.$langs->trans("Purge").'</a>';
}
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print_barre_liste($langs->trans("ListOfSecurityEvents"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $nbtotalofrecords, 'setup', 0, '', '', $limit);
print_barre_liste($langs->trans("ListOfSecurityEvents"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, empty($center) ? '' : $center, $num, $nbtotalofrecords, 'setup', 0, '', '', $limit);
if ($action == 'purge') {
$formquestion = array();

View File

@ -906,7 +906,7 @@ function listOfSessions()
if (preg_match('/dol_login/i', $sessValues) && // limit to dolibarr session
(preg_match('/dol_entity\|i:'.$conf->entity.';/i', $sessValues) || preg_match('/dol_entity\|s:([0-9]+):"'.$conf->entity.'"/i', $sessValues)) && // limit to current entity
preg_match('/dol_company\|s:([0-9]+):"('.$conf->global->MAIN_INFO_SOCIETE_NOM.')"/i', $sessValues)) { // limit to company name
preg_match('/dol_company\|s:([0-9]+):"('.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').')"/i', $sessValues)) { // limit to company name
$tmp = explode('_', $file);
$idsess = $tmp[1];
$regs = array();