diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index d8af6ac1b4f..15f4a27c8c7 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($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').''; +print (isset($conf->global->SOCIETE_FISCAL_MONTH_START) ? $formother->select_month($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 4fe21a8460b..71783b2a319 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -289,7 +289,7 @@ if ($action == 'edit') { print '
'; -if ($conf->global->MAIN_DISABLE_METEO != 1) { +if (isset($conf->global->MAIN_DISABLE_METEO) && $conf->global->MAIN_DISABLE_METEO != 1) { // Show logo for weather print ''.$langs->trans("DescWeather").' '; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 72d16569b25..ac23480bd4d 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__' => (is_object($object) && is_object($object->thirdparty)) ? '' : '', + '__CHECK_READ__' => (isset($object->thirdparty) && is_object($object) && 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").''.yn($conf->global->MAIN_DISABLE_ALL_MAILS); + print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.(isset($conf->global->MAIN_DISABLE_ALL_MAILS) ? yn($conf->global->MAIN_DISABLE_ALL_MAILS) : ''); if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { print img_warning($langs->trans("Disabled")); } @@ -737,26 +737,28 @@ if ($action == 'edit') { print ''.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; print ''; - 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 (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.'>'); + } } } print ''; // Errors To print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''.$conf->global->MAIN_MAIL_ERRORS_TO; + print ''.(isset($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")); } @@ -776,7 +778,7 @@ if ($action == 'edit') { print ''; //Add user to select destinaries list - print ''.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT).''; + 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 ''; print ''; diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 7d4a290f0bc..0d2356c00ac 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 = !($user->rights->societe->lire && empty($user->socid)); + $this->hidden = !(isset($user->rights->societe->lire) && empty($user->socid)); } /** diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 3088db079e3..6769fa9ccad 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 ($conf->mailing->enabled) { + if (isset($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 ($conf->ticket->enabled) { + if (isset($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 0e2027494e7..05eaf9920bd 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -132,7 +132,7 @@ class modDataPolicy extends DolibarrModules { array('DATAPOLICY_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0), ); - $country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); + if (isset($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(