diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 138cfdad4e0..0c6da346285 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -666,7 +666,7 @@ print ''.$langs->trans("FiscalYearInformation").'\n"; print ''; -print $formother->select_month(isset($conf->global->SOCIETE_FISCAL_MONTH_START) ? $conf->global->SOCIETE_FISCAL_MONTH_START : '', 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').''; +print $formother->select_month(!empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? $conf->global->SOCIETE_FISCAL_MONTH_START : '', 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').''; print ""; print '
'; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index b0c1cc5398b..00f05152a86 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -289,7 +289,7 @@ if ($action == 'edit') { print '
'; -if (!isset($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO != 1) { +if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO != 1) { // Show logo for weather print ''.$langs->trans("DescWeather").' '; @@ -302,7 +302,7 @@ if (!isset($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_MET $str_mode_enabled = $str_mode_percentage; } print ''.$str_mode_enabled.''; - print ''; + print ''; print '

'; } else { diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index ac23480bd4d..78b4012a6a2 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -48,7 +48,7 @@ $substitutionarrayfortest = array( '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, '__ID__' => 'RecipientIdRecord', //'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails - '__CHECK_READ__' => (isset($object->thirdparty) && is_object($object) && is_object($object->thirdparty)) ? '' : '', + '__CHECK_READ__' => (is_object($object) && !empty($object->thirdparty) && is_object($object->thirdparty)) ? '' : '', '__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails '__LOGIN__' => 'RecipientLogin', '__LASTNAME__' => 'RecipientLastname', @@ -554,7 +554,7 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; // Disable - print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.(isset($conf->global->MAIN_DISABLE_ALL_MAILS) ? yn($conf->global->MAIN_DISABLE_ALL_MAILS) : ''); + print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.yn(!empty($conf->global->MAIN_DISABLE_ALL_MAILS)); if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { print img_warning($langs->trans("Disabled")); } @@ -737,28 +737,26 @@ if ($action == 'edit') { print ''.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; print ''; - if (isset($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)) { - if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') { - print $langs->trans('RobotEmail'); - } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') { - print $langs->trans('UserEmail'); - } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') { - print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); - } else { - $id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE); - if ($id > 0) { - include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; - $emailsenderprofile = new EmailSenderProfile($db); - $emailsenderprofile->fetch($id); - print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); - } + if (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'robot') { + print $langs->trans('RobotEmail'); + } elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'user') { + print $langs->trans('UserEmail'); + } elseif (!empty($conf->global->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 : ''); + if ($id > 0) { + include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; + $emailsenderprofile = new EmailSenderProfile($db); + $emailsenderprofile->fetch($id); + print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); } } print ''; // Errors To print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''.(isset($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : ''); + print ''.(!empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->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")); } @@ -778,7 +776,7 @@ if ($action == 'edit') { print ''; //Add user to select destinaries list - print ''.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.(isset($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT) ? yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT) : '').''; + print ''.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.yn(!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)).''; print ''; print ''; diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 0d2356c00ac..3ff31a0df96 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -66,7 +66,7 @@ class box_dolibarr_state_board extends ModeleBoxes $this->enabled = 0; // disabled by this option } - $this->hidden = !(isset($user->rights->societe->lire) && empty($user->socid)); + $this->hidden = !(!empty($user->rights->societe->lire) && empty($user->socid)); } /** diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 6769fa9ccad..93d09fa2255 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1885,14 +1885,14 @@ function email_admin_prepare_head() $head[$h][2] = 'common'; $h++; - if (isset($conf->mailing->enabled)) { + if (!empty($conf->mailing->enabled)) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("EMailing")); $head[$h][2] = 'common_emailing'; $h++; } - if (isset($conf->ticket->enabled)) { + if (!empty($conf->ticket->enabled)) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_ticket.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("Ticket")); $head[$h][2] = 'common_ticket'; diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 05eaf9920bd..34388540831 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -132,7 +132,8 @@ class modDataPolicy extends DolibarrModules { array('DATAPOLICY_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0), ); - if (isset($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); + $country = array(); + if (!empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); // Some keys to add into the overwriting translation tables /* $this->overwrite_translation = array(