diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 9061fd150b7..6fc03a62189 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -606,7 +606,7 @@ complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqls // Defaut sortorder if (empty($sortfield)) { - $tmp1 = explode(',', $tabsqlsort[$id]); + $tmp1 = explode(',', empty($tabsqlsort[$id]) ? '' : $tabsqlsort[$id]); $tmp2 = explode(' ', $tmp1[0]); $sortfield = preg_replace('/^.*\./', '', $tmp2[0]); } @@ -1778,7 +1778,7 @@ if ($id) { while ($i < $num) { $obj = $db->fetch_object($resql); //print_r($obj); - print ''; + print ''; if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) { $tmpaction = 'edit'; $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); @@ -2024,7 +2024,7 @@ if ($id) { if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable = 0; } - if (in_array($obj->code, array('AC_OTH', 'AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { + if (in_array($obj->code, array('AC_OTH', 'AC_OTH_AUTO')) || in_array(empty($obj->type) ? '' : $obj->type, array('systemauto'))) { $canbedisabled = 0; $canbedisabled = 0; } $canbemodified = $iserasable; @@ -2042,7 +2042,7 @@ if ($id) { if (empty($rowidcol) || in_array($id, array(6, 7, 8, 13, 17, 19, 27, 32))) { $rowidcol = 'rowid'; } - $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((!empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0') ? $obj->{$rowidcol}:(!empty($obj->code) ?urlencode($obj->code) : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : ''); + $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((!empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0') ? $obj->{$rowidcol} : (!empty($obj->code) ? urlencode($obj->code) : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : ''); if (!empty($param)) { $url .= '&'.$param; } diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index f84425eda4d..080f06c6fa3 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -172,7 +172,7 @@ if ($action == 'edit') { // Disable print ''.$langs->trans("MAIN_DISABLE_ALL_SMS").''; - print $form->selectyesno('MAIN_DISABLE_ALL_SMS', $conf->global->MAIN_DISABLE_ALL_SMS, 1); + print $form->selectyesno('MAIN_DISABLE_ALL_SMS', empty($conf->global->MAIN_DISABLE_ALL_SMS) ? '' : $conf->global->MAIN_DISABLE_ALL_SMS, 1); print ''; // Separator @@ -189,7 +189,7 @@ if ($action == 'edit') { // From print ''.$langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")).''; - print ''; // Autocopy to @@ -213,14 +213,14 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; // Disable - print ''.$langs->trans("MAIN_DISABLE_ALL_SMS").''.yn($conf->global->MAIN_DISABLE_ALL_SMS).''; + print ''.$langs->trans("MAIN_DISABLE_ALL_SMS").''.yn(empty($conf->global->MAIN_DISABLE_ALL_SMS) ? '' : $conf->global->MAIN_DISABLE_ALL_SMS).''; // Separator print ' '; // Method print ''.$langs->trans("MAIN_SMS_SENDMODE").''; - $text = $listofmethods[$conf->global->MAIN_SMS_SENDMODE]; + $text = empty($conf->global->MAIN_SMS_SENDMODE) ? '' : $listofmethods[$conf->global->MAIN_SMS_SENDMODE]; if (empty($text)) { $text = $langs->trans("Undefined").' '.img_warning(); } @@ -229,7 +229,7 @@ if ($action == 'edit') { // From print ''.$langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")).''; - print ''.$conf->global->MAIN_MAIL_SMS_FROM; + print ''.(empty($conf->global->MAIN_MAIL_SMS_FROM) ? '' : $conf->global->MAIN_MAIL_SMS_FROM); if (!empty($conf->global->MAIN_MAIL_SMS_FROM) && !isValidPhone($conf->global->MAIN_MAIL_SMS_FROM)) { print ' '.img_warning($langs->trans("ErrorBadPhone")); } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index ed01d9d6e9f..779d8b10912 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1228,10 +1228,10 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab // We discard modules according to features level (PS: if module is activated we always show it) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod))); - if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && !$conf->global->$const_name) { + if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && empty($conf->global->$const_name)) { $modulequalified = 0; } - if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && !$conf->global->$const_name) { + if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && empty($conf->global->$const_name)) { $modulequalified = 0; } //If module is not activated disqualified diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php index 442e01b56f6..289300f5f29 100644 --- a/htdocs/core/modules/modPartnership.class.php +++ b/htdocs/core/modules/modPartnership.class.php @@ -177,7 +177,7 @@ class modPartnership extends DolibarrModules // Array to add new pages in new tabs $this->tabs = array(); - $tabtoadd = ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') ? 'member' : 'thirdparty'; + $tabtoadd = (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') ? 'member' : 'thirdparty'; if ($tabtoadd == 'member') { $this->tabs[] = array('data'=>'member:+partnership:Partnership:partnership@partnership:$user->rights->partnership->read:/partnership/partnership.php?socid=__ID__');