Fix empty and getDolGlobal...

This commit is contained in:
Laurent Destailleur 2023-08-27 17:11:28 +02:00
parent 45d323a6f8
commit 8fa06ccfa7
10 changed files with 12 additions and 12 deletions

View File

@ -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');
}

View File

@ -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>';

View File

@ -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>';

View File

@ -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 {

View File

@ -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;
}

View File

@ -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";

View File

@ -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',
),

View File

@ -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);

View File

@ -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'));

View File

@ -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);