浏览代码

Fix empty and getDolGlobal...

Laurent Destailleur 1 年之前
父节点
当前提交
8fa06ccfa7

+ 1 - 1
htdocs/adherents/class/adherent.class.php

@@ -499,7 +499,7 @@ class Adherent extends CommonObject
 
 		// Envoi mail confirmation
 		$from = $conf->email_from;
-		if (!empty(getDolGlobalString('ADHERENT_MAIL_FROM'))) {
+		if (getDolGlobalString('ADHERENT_MAIL_FROM')) {
 			$from = getDolGlobalString('ADHERENT_MAIL_FROM');
 		}
 

+ 1 - 1
htdocs/admin/dav.php

@@ -189,7 +189,7 @@ $message .= '</div>';
 $message .= ajax_autoselect('webdavpublicurl');
 
 $message .= '<br>';
-if (!empty(getDolGlobalString('DAV_ALLOW_PUBLIC_DIR'))) {
+if (getDolGlobalString('DAV_ALLOW_PUBLIC_DIR')) {
 	$urlEntity = (isModEnabled('multicompany') ? '?entity=' . $conf->entity : '');
 	$url = '<a href="' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '" target="_blank" rel="noopener noreferrer">' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '</a>';
 

+ 1 - 1
htdocs/admin/ticket_public.php

@@ -382,7 +382,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
 	// Show progression
 	print '<tr class="oddeven"><td>'.$langs->trans("TicketsShowProgression").'</td>';
 	print '<td class="left">';
-	if (empty(getDolGlobalInt('TICKET_SHOW_PROGRESSION'))) {
+	if (!getDolGlobalInt('TICKET_SHOW_PROGRESSION')) {
 		print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_SHOW_PROGRESSION">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>';
 	} else {
 		print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_SHOW_PROGRESSION">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>';

+ 1 - 1
htdocs/core/class/html.formaccounting.class.php

@@ -396,7 +396,7 @@ class FormAccounting extends Form
 
 			$num_rows = $this->db->num_rows($resql);
 
-			if ($num_rows == 0 && (empty(getDolGlobalInt('CHARTOFACCOUNTS')) || getDolGlobalInt('CHARTOFACCOUNTS') < 0)) {
+			if ($num_rows == 0 && getDolGlobalInt('CHARTOFACCOUNTS') <= 0) {
 				$langs->load("errors");
 				$showempty = $langs->trans("ErrorYouMustFirstSetupYourChartOfAccount");
 			} else {

+ 1 - 1
htdocs/core/tpl/card_presend.tpl.php

@@ -272,7 +272,7 @@ if ($action == 'presend') {
 	if (is_object($object) && is_object($object->thirdparty)) {
 		$checkRead= '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php';
 		$checkRead.='?tag='.(!empty($object->thirdparty->tag)?urlencode($object->thirdparty->tag):"");
-		$checkRead.='&securitykey='.(!empty(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY'))?urlencode(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')):"");
+		$checkRead.='&securitykey='.(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY') ? urlencode(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')) : "");
 		$checkRead.='" width="1" height="1" style="width:1px;height:1px" border="0"/>';
 		$substitutionarray['__CHECK_READ__'] = $checkRead;
 	}

+ 2 - 2
htdocs/modulebuilder/template/class/myobject.class.php

@@ -1073,11 +1073,11 @@ class MyObject extends CommonObject
 		global $langs, $conf;
 		$langs->load("mymodule@mymodule");
 
-		if (empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON'))) {
+		if (!getDolGlobalString('MYMODULE_MYOBJECT_ADDON')) {
 			$conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_myobject_standard';
 		}
 
-		if (!empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON'))) {
+		if (getDolGlobalString('MYMODULE_MYOBJECT_ADDON')) {
 			$mybool = false;
 
 			$file = getDolGlobalString('MYMODULE_MYOBJECT_ADDON').".php";

+ 2 - 2
htdocs/modulebuilder/template/core/modules/modMyModule.class.php

@@ -411,8 +411,8 @@ class modMyModule extends DolibarrModules
 		$this->import_convertvalue_array[$r] = array(
 			't.ref' => array(
 				'rule'=>'getrefifauto',
-				'class'=>(empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON')) ? 'mod_myobject_standard' : getDolGlobalString('MYMODULE_MYOBJECT_ADDON')),
-				'path'=>"/core/modules/commande/".(empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON')) ? 'mod_myobject_standard' : getDolGlobalString('MYMODULE_MYOBJECT_ADDON')).'.php'
+				'class'=>(!getDolGlobalString('MYMODULE_MYOBJECT_ADDON') ? 'mod_myobject_standard' : getDolGlobalString('MYMODULE_MYOBJECT_ADDON')),
+				'path'=>"/core/modules/commande/".(!getDolGlobalString('MYMODULE_MYOBJECT_ADDON') ? 'mod_myobject_standard' : getDolGlobalString('MYMODULE_MYOBJECT_ADDON')).'.php'
 				'classobject'=>'MyObject',
 				'pathobject'=>'/mymodule/class/myobject.class.php',
 			),

+ 1 - 1
htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php

@@ -163,7 +163,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
 
 		// Scan directories
 		$nbofiles = count($listoffiles);
-		if (!empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH'))) {
+		if (getDolGlobalString('MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH')) {
 			$texte .= $langs->trans("NumberOfModelFilesFound").': <b>';
 			//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
 			$texte .= count($listoffiles);

+ 1 - 1
htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php

@@ -179,7 +179,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
 		// Load translation files required by the page
 		$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies"));
 
-		if (!empty(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) && $outputlangs->defaultlang != getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) {
+		if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && $outputlangs->defaultlang != getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) {
 			global $outputlangsbis;
 			$outputlangsbis = new Translate('', $conf);
 			$outputlangsbis->setDefaultLang(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE'));

+ 1 - 1
htdocs/modulebuilder/template/myobject_agenda.php

@@ -187,7 +187,7 @@ $form = new Form($db);
 
 if ($object->id > 0) {
 	$title = $langs->trans("Agenda");
-	//if (!empty(getDolGlobalString('MAIN_HTML_TITLE')) && preg_match('/thirdpartynameonly/',getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) $title=$object->name." - ".$title;
+	//if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/thirdpartynameonly/',getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) $title=$object->name." - ".$title;
 	$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
 	llxHeader('', $title, $help_url);