NEW Add link to edit VAT list from error message of missing VAT
This commit is contained in:
parent
40ed102dfe
commit
b1c51954dd
@ -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), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page + 1).'</span></li>');
|
||||
print '<div class="clearboth"></div>';
|
||||
}
|
||||
@ -1621,6 +1621,7 @@ if ($id > 0) {
|
||||
print '<!-- line title to search record -->'."\n";
|
||||
print '<tr class="liste_titre_filter">';
|
||||
$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 '</td>';
|
||||
$filterfound++;
|
||||
$colspan++;
|
||||
} elseif ($value == 'code') {
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="maxwidth100" name="search_code" value="'.dol_escape_htmltag($search_code).'">';
|
||||
print '</td>';
|
||||
$filterfound++;
|
||||
$colspan++;
|
||||
} else {
|
||||
print '<td class="liste_titre">';
|
||||
print '</td>';
|
||||
$colspan++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($id == 4) {
|
||||
print '<td></td>';
|
||||
$colspan++;
|
||||
print '<td></td>';
|
||||
$colspan++;
|
||||
}
|
||||
print '<td class="liste_titre"></td>';
|
||||
$colspan++;
|
||||
print '<td class="liste_titre right" colspan="2">';
|
||||
if ($filterfound) {
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
}
|
||||
print '</td>';
|
||||
$colspan+=2;
|
||||
print '</tr>';
|
||||
|
||||
// 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 '<tr class="oddeven" id="rowid-'.(empty($obj->rowid) ? '' : $obj->rowid).'">';
|
||||
|
||||
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 '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
@ -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 '<td>';
|
||||
$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 '</td>';
|
||||
} elseif ($value == 'country_id') {
|
||||
if (!in_array('country', $fieldlist)) { // If there is already a field country, we don't show country_id (avoid duplicate)
|
||||
|
||||
@ -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").'<br>'.$langs->trans("WarningPHPMailA").'<br>'.$langs->trans("WarningPHPMailB").'<br>'.$langs->trans("WarningPHPMailC").'<br><br>'.$langs->trans("WarningPHPMailD");
|
||||
$messagetoshow .= ' '.$langs->trans("WarningPHPMailDbis", '{s1}', '{s2}');
|
||||
$linktosetvar1 = '<a href="'.$_SERVER["PHP_SELF"].'?action=disablephpmailwarning&token='.newToken().'">';
|
||||
$linktosetvar1 = '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=disablephpmailwarning&token='.newToken().'">';
|
||||
$linktosetvar2 = '</a>';
|
||||
$messagetoshow = str_replace('{s1}', $linktosetvar1, $messagetoshow);
|
||||
$messagetoshow = str_replace('{s2}', $linktosetvar2, $messagetoshow);
|
||||
|
||||
@ -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 = '<span class="error">' . $langs->trans("ErrorNoVATRateDefinedForSellerCountry", $country_code) . '</span>';
|
||||
$this->error = '<span class="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 .= '<br>'.$langs->trans("ErrorFixThisHere", DOL_URL_ROOT.'/admin/dict.php?id=10'.($country_id > 0 ? '&countryidforinsert='.$country_id : ''));
|
||||
}
|
||||
$this->error .= '</span>';
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -312,6 +312,7 @@ ErrorFieldValue=Value for <b>%s</b> is incorrect
|
||||
ErrorCoherenceMenu=<b>%s</b> is required when <b>%s</b> 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=<a href="%s">Fix this here</a>
|
||||
|
||||
# Warnings
|
||||
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user