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;
|
$i = 0;
|
||||||
|
|
||||||
// There is several pages
|
// 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_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>';
|
print '<div class="clearboth"></div>';
|
||||||
}
|
}
|
||||||
@ -1621,6 +1621,7 @@ if ($id > 0) {
|
|||||||
print '<!-- line title to search record -->'."\n";
|
print '<!-- line title to search record -->'."\n";
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
$filterfound = 0;
|
$filterfound = 0;
|
||||||
|
$colspan = 0;
|
||||||
foreach ($fieldlist as $field => $value) {
|
foreach ($fieldlist as $field => $value) {
|
||||||
if ($value == 'entity') {
|
if ($value == 'entity') {
|
||||||
continue;
|
continue;
|
||||||
@ -1638,28 +1639,35 @@ if ($id > 0) {
|
|||||||
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'minwidth100 maxwidth150 maxwidthonsmartphone');
|
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'minwidth100 maxwidth150 maxwidthonsmartphone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
$filterfound++;
|
$filterfound++;
|
||||||
|
$colspan++;
|
||||||
} elseif ($value == 'code') {
|
} elseif ($value == 'code') {
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input type="text" class="maxwidth100" name="search_code" value="'.dol_escape_htmltag($search_code).'">';
|
print '<input type="text" class="maxwidth100" name="search_code" value="'.dol_escape_htmltag($search_code).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
$filterfound++;
|
$filterfound++;
|
||||||
|
$colspan++;
|
||||||
} else {
|
} else {
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
$colspan++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($id == 4) {
|
if ($id == 4) {
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
$colspan++;
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
$colspan++;
|
||||||
}
|
}
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
|
$colspan++;
|
||||||
print '<td class="liste_titre right" colspan="2">';
|
print '<td class="liste_titre right" colspan="2">';
|
||||||
if ($filterfound) {
|
if ($filterfound) {
|
||||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
$colspan+=2;
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Title of lines
|
// Title of lines
|
||||||
@ -1905,8 +1913,10 @@ if ($id > 0) {
|
|||||||
// Lines with values
|
// Lines with values
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
//print_r($obj);
|
//print_r($obj);
|
||||||
print '<tr class="oddeven" id="rowid-'.(empty($obj->rowid) ? '' : $obj->rowid).'">';
|
print '<tr class="oddeven" id="rowid-'.(empty($obj->rowid) ? '' : $obj->rowid).'">';
|
||||||
|
|
||||||
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
|
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
|
||||||
$tmpaction = 'edit';
|
$tmpaction = 'edit';
|
||||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||||
@ -2252,6 +2262,8 @@ if ($id > 0) {
|
|||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -2372,8 +2384,12 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||||||
continue;
|
continue;
|
||||||
} // For state page, we do not show the country input (we link to region, not country)
|
} // For state page, we do not show the country input (we link to region, not country)
|
||||||
print '<td>';
|
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>';
|
print '</td>';
|
||||||
} elseif ($value == 'country_id') {
|
} elseif ($value == 'country_id') {
|
||||||
if (!in_array('country', $fieldlist)) { // If there is already a field country, we don't show country_id (avoid duplicate)
|
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)) {
|
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("WarningPHPMail").'<br>'.$langs->trans("WarningPHPMailA").'<br>'.$langs->trans("WarningPHPMailB").'<br>'.$langs->trans("WarningPHPMailC").'<br><br>'.$langs->trans("WarningPHPMailD");
|
||||||
$messagetoshow .= ' '.$langs->trans("WarningPHPMailDbis", '{s1}', '{s2}');
|
$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>';
|
$linktosetvar2 = '</a>';
|
||||||
$messagetoshow = str_replace('{s1}', $linktosetvar1, $messagetoshow);
|
$messagetoshow = str_replace('{s1}', $linktosetvar1, $messagetoshow);
|
||||||
$messagetoshow = str_replace('{s2}', $linktosetvar2, $messagetoshow);
|
$messagetoshow = str_replace('{s2}', $linktosetvar2, $messagetoshow);
|
||||||
|
|||||||
@ -6256,13 +6256,13 @@ class Form
|
|||||||
/**
|
/**
|
||||||
* Load into the cache vat rates of a country
|
* Load into the cache vat rates of a country
|
||||||
*
|
*
|
||||||
* @param string $country_code Country code with quotes ("'CA'", or "'CA,IN,...'")
|
* @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
|
* @return int Nb of loaded lines, 0 if already loaded, <0 if KO
|
||||||
*/
|
*/
|
||||||
public function load_cache_vatrates($country_code)
|
public function load_cache_vatrates($country_code)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs, $user;
|
||||||
|
|
||||||
$num = count($this->cache_vatrates);
|
$num = count($this->cache_vatrates);
|
||||||
if ($num > 0) {
|
if ($num > 0) {
|
||||||
@ -6313,7 +6313,16 @@ class Form
|
|||||||
|
|
||||||
return $num;
|
return $num;
|
||||||
} else {
|
} 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;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} 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'
|
ErrorCoherenceMenu=<b>%s</b> is required when <b>%s</b> is 'left'
|
||||||
ErrorUploadFileDragDrop=There was an error while the file(s) upload
|
ErrorUploadFileDragDrop=There was an error while the file(s) upload
|
||||||
ErrorUploadFileDragDropPermissionDenied=There was an error while the file(s) upload : Permission denied
|
ErrorUploadFileDragDropPermissionDenied=There was an error while the file(s) upload : Permission denied
|
||||||
|
ErrorFixThisHere=<a href="%s">Fix this here</a>
|
||||||
|
|
||||||
# Warnings
|
# Warnings
|
||||||
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
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