Forráskód Böngészése

Compatibility phpv8

Givriz 4 éve
szülő
commit
0c5a934e10

+ 3 - 3
htdocs/admin/mails.php

@@ -302,7 +302,7 @@ if ($action == 'edit') {
 
 	// Disable
 	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_MAILS").'</td><td>';
-	print $form->selectyesno('MAIN_DISABLE_ALL_MAILS', $conf->global->MAIN_DISABLE_ALL_MAILS, 1);
+	print $form->selectyesno('MAIN_DISABLE_ALL_MAILS', getDolGlobalString('MAIN_DISABLE_ALL_MAILS'), 1);
 	print '</td></tr>';
 
 	// Force e-mail recipient
@@ -514,7 +514,7 @@ if ($action == 'edit') {
 	$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')';
 
 	print '<tr class="oddeven"><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td><td>';
-	print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE, 0);
+	print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE'), 0);
 	print '</td></tr>';
 
 	// From
@@ -529,7 +529,7 @@ if ($action == 'edit') {
 
 	// Add user to select destinaries list
 	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").'</td><td>';
-	print $form->selectyesno('MAIN_MAIL_ENABLED_USER_DEST_SELECT', $conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT, 1);
+	print $form->selectyesno('MAIN_MAIL_ENABLED_USER_DEST_SELECT', getDolGlobalString('MAIN_MAIL_ENABLED_USER_DEST_SELECT'), 1);
 	print '</td></tr>';
 
 	print '</table>';

+ 2 - 2
htdocs/admin/system/security.php

@@ -156,7 +156,7 @@ $arrayoffilesinroot = dol_dir_list(DOL_DOCUMENT_ROOT, 'all', 1, '', array('\/cus
 $fileswithwritepermission = array();
 foreach ($arrayoffilesinroot as $fileinroot) {
 	// Test permission on file
-	if ($fileinroot['perm'] & 0222) {
+	if (isset($fileinroot['perm']) && ($fileinroot['perm'] & 0222)) {
 		$fileswithwritepermission[] = $fileinroot['relativename'];
 	}
 }
@@ -278,7 +278,7 @@ print '<br>';
 
 print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: ';
 print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' ';
-print yn($conf->global->MAIN_ANTIVIRUS_COMMAND ? 1 : 0);
+print yn(!empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 1 : 0);
 if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) {
 	print ' &nbsp; - '.$conf->global->MAIN_ANTIVIRUS_COMMAND;
 	if (defined('MAIN_ANTIVIRUS_COMMAND')) {

+ 1 - 1
htdocs/core/boxes/box_dolibarr_state_board.php

@@ -266,7 +266,7 @@ class box_dolibarr_state_board extends ModeleBoxes
 					$boxstatItem .= '<a href="' . $links[$val] . '" class="boxstatsindicator thumbstat nobold nounderline">';
 					$boxstatItem .= '<div class="boxstats">';
 					$boxstatItem .= '<span class="boxstatstext" title="' . dol_escape_htmltag($text) . '">' . $text . '</span><br>';
-					$boxstatItem .= '<span class="boxstatsindicator">' . img_object("", $board->picto, 'class="inline-block"') . ' ' . ($board->nb[$val] ? $board->nb[$val] : 0) . '</span>';
+					$boxstatItem .= '<span class="boxstatsindicator">' . img_object("", $board->picto, 'class="inline-block"') . ' ' . (!empty($board->nb[$val]) ? $board->nb[$val] : 0) . '</span>';
 					$boxstatItem .= '</div>';
 					$boxstatItem .= '</a>';
 

+ 2 - 2
htdocs/core/class/html.formfile.class.php

@@ -726,7 +726,7 @@ class FormFile
 			}
 
 			// Language code (if multilang)
-			if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && !$forcenomultilang && (!empty($modellist) || $showempty)) {
+			if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && !empty($conf->global->MAIN_MULTILANGS) && !$forcenomultilang && (!empty($modellist) || $showempty)) {
 				include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
 				$formadmin = new FormAdmin($this->db);
 				$defaultlang = $codelang ? $codelang : $langs->getDefaultLang();
@@ -812,7 +812,7 @@ class FormFile
 					completeFileArrayWithDatabaseInfo($file_list, $relativedir);
 
 					//var_dump($sortfield.' - '.$sortorder);
-					if ($sortfield && $sortorder) {	// If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name)
+					if (!empty($sortfield) && !empty($sortorder)) {	// If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name)
 						$file_list = dol_sort_array($file_list, $sortfield, $sortorder);
 					}
 				}

+ 1 - 1
htdocs/projet/class/task.class.php

@@ -1986,7 +1986,7 @@ class Task extends CommonObject
 		global $conf, $langs;
 
 		// For external user, no check is done on company because readability is managed by public status of project and assignement.
-		//$socid=$user->socid;
+		$socid = $user->socid;
 
 		$projectstatic = new Project($this->db);
 		$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);

+ 3 - 3
htdocs/user/card.php

@@ -1557,7 +1557,7 @@ if ($action == 'create' || $action == 'adduserldap') {
 			print "</tr>\n";
 
 			// Accountancy code
-			if ($conf->accounting->enabled) {
+			if (!empty($conf->accounting->enabled)) {
 				print '<tr><td>'.$langs->trans("AccountancyCode").'</td>';
 				print '<td>'.$object->accountancy_code.'</td></tr>';
 			}
@@ -2445,7 +2445,7 @@ if ($action == 'create' || $action == 'adduserldap') {
 			print '</table><hr><table class="border centpercent">';
 
 			// Accountancy code
-			if ($conf->accounting->enabled) {
+			if (!empty($conf->accounting->enabled)) {
 				print "<tr>";
 				print '<td class="titlefieldcreate">'.$langs->trans("AccountancyCode").'</td>';
 				print '<td>';
@@ -2726,7 +2726,7 @@ if ($action == 'create' || $action == 'adduserldap') {
 			$genallowed = $user->rights->user->user->lire;
 			$delallowed = $user->rights->user->user->creer;
 
-			print $formfile->showdocuments('user', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
+			print $formfile->showdocuments('user', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', empty($soc->default_lang) ? '' : $soc->default_lang);
 			$somethingshown = $formfile->numoffiles;
 
 			// Show links to link elements