diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 25fb809b9b1..98b9f120a6d 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1609,7 +1609,7 @@ if ($id > 0) { $i = 0; // There is several pages - if ($num > $listlimit || $page) { + if (($num > $listlimit) || $page) { print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print '
'; } @@ -1621,6 +1621,7 @@ if ($id > 0) { print ''."\n"; print ''; $filterfound = 0; + $colspan = 0; foreach ($fieldlist as $field => $value) { if ($value == 'entity') { continue; @@ -1638,28 +1639,35 @@ if ($id > 0) { print $form->select_country($search_country_id, 'search_country_id', '', 28, 'minwidth100 maxwidth150 maxwidthonsmartphone'); print ''; $filterfound++; + $colspan++; } elseif ($value == 'code') { print ''; print ''; print ''; $filterfound++; + $colspan++; } else { print ''; print ''; + $colspan++; } } } if ($id == 4) { print ''; + $colspan++; print ''; + $colspan++; } print ''; + $colspan++; print ''; if ($filterfound) { $searchpicto = $form->showFilterAndCheckAddButtons(0); print $searchpicto; } print ''; + $colspan+=2; print ''; // Title of lines @@ -1905,8 +1913,10 @@ if ($id > 0) { // Lines with values while ($i < $num) { $obj = $db->fetch_object($resql); + //print_r($obj); print ''; + if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) { $tmpaction = 'edit'; $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); @@ -2252,6 +2262,8 @@ if ($id > 0) { } $i++; } + } else { + print ''.$langs->trans("NoRecordFound").''; } print ''; @@ -2372,8 +2384,12 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') continue; } // For state page, we do not show the country input (we link to region, not country) print ''; - $fieldname = 'country'; - print $form->select_country((!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : '')), $fieldname, '', 28, 'minwidth100 maxwidth150 maxwidthonsmartphone'); + + $selected = (!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : '')); + if (!GETPOSTISSET('code')) { + $selected = GETPOST('countryidforinsert'); + } + print $form->select_country($selected, $value, '', 28, 'minwidth100 maxwidth150 maxwidthonsmartphone'); print ''; } elseif ($value == 'country_id') { if (!in_array('country', $fieldlist)) { // If there is already a field country, we don't show country_id (avoid duplicate) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 504197fac7a..e4ad9c71bb6 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -809,7 +809,7 @@ if ($action == 'edit') { if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { $messagetoshow = $langs->trans("WarningPHPMail").'
'.$langs->trans("WarningPHPMailA").'
'.$langs->trans("WarningPHPMailB").'
'.$langs->trans("WarningPHPMailC").'

'.$langs->trans("WarningPHPMailD"); $messagetoshow .= ' '.$langs->trans("WarningPHPMailDbis", '{s1}', '{s2}'); - $linktosetvar1 = ''; + $linktosetvar1 = ''; $linktosetvar2 = ''; $messagetoshow = str_replace('{s1}', $linktosetvar1, $messagetoshow); $messagetoshow = str_replace('{s2}', $linktosetvar2, $messagetoshow); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0b601beedb0..8f11af63f4a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6256,13 +6256,13 @@ class Form /** * Load into the cache vat rates of a country * - * @param string $country_code Country code with quotes ("'CA'", or "'CA,IN,...'") - * @return int Nb of loaded lines, 0 if already loaded, <0 if KO + * @param string $country_code Country code with quotes ("'CA'", or "'CA,IN,...'") + * @return int Nb of loaded lines, 0 if already loaded, <0 if KO */ public function load_cache_vatrates($country_code) { // phpcs:enable - global $langs; + global $langs, $user; $num = count($this->cache_vatrates); if ($num > 0) { @@ -6313,7 +6313,16 @@ class Form return $num; } else { - $this->error = '' . $langs->trans("ErrorNoVATRateDefinedForSellerCountry", $country_code) . ''; + $this->error = ''; + $this->error .= $langs->trans("ErrorNoVATRateDefinedForSellerCountry", $country_code); + $reg = array(); + if (!empty($user) && $user->admin && preg_match('/\'(..)\'/', $country_code, $reg)) { + $langs->load("errors"); + $new_country_code = $reg[1]; + $country_id = dol_getIdFromCode($this->db, $new_country_code, 'c_pays', 'code', 'rowid'); + $this->error .= '
'.$langs->trans("ErrorFixThisHere", DOL_URL_ROOT.'/admin/dict.php?id=10'.($country_id > 0 ? '&countryidforinsert='.$country_id : '')); + } + $this->error .= '
'; return -1; } } else { diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 6c07dc05e98..57bd4a861d2 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -312,6 +312,7 @@ ErrorFieldValue=Value for %s is incorrect ErrorCoherenceMenu=%s is required when %s is 'left' ErrorUploadFileDragDrop=There was an error while the file(s) upload ErrorUploadFileDragDropPermissionDenied=There was an error while the file(s) upload : Permission denied +ErrorFixThisHere=Fix this here # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.