2
0
forked from Wavyzz/dolibarr

Translation error messages numbering modules

This commit is contained in:
frederic34
2015-01-11 11:31:53 +01:00
parent fc78d632d3
commit 173d3aaa90
12 changed files with 106 additions and 119 deletions

View File

@@ -348,15 +348,13 @@ foreach ($dirmodels as $reldir)
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>'; $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$commande->type=0; $commande->type=0;
$nextval=$module->getNextValue($mysoc,$commande); $nextval=$module->getNextValue($mysoc,$commande);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
{
$htmltooltip.=''.$langs->trans("NextValue").': '; $htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval) if ($nextval) {
{ if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>'; $htmltooltip.=$nextval.'<br>';
} } else {
else
{
$htmltooltip.=$langs->trans($module->error).'<br>'; $htmltooltip.=$langs->trans($module->error).'<br>';
} }
} }

View File

@@ -299,15 +299,13 @@ foreach ($dirmodels as $reldir)
$htmltooltip=''; $htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>'; $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$contract); $nextval=$module->getNextValue($mysoc,$contract);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
{
$htmltooltip.=''.$langs->trans("NextValue").': '; $htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval) if ($nextval) {
{ if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>'; $htmltooltip.=$nextval.'<br>';
} } else {
else
{
$htmltooltip.=$langs->trans($module->error).'<br>'; $htmltooltip.=$langs->trans($module->error).'<br>';
} }
} }

View File

@@ -324,15 +324,13 @@ foreach ($dirmodels as $reldir)
$htmltooltip=''; $htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>'; $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$expedition); $nextval=$module->getNextValue($mysoc,$expedition);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
{
$htmltooltip.=''.$langs->trans("NextValue").': '; $htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval) if ($nextval) {
{ if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>'; $htmltooltip.=$nextval.'<br>';
} } else {
else
{
$htmltooltip.=$langs->trans($module->error).'<br>'; $htmltooltip.=$langs->trans($module->error).'<br>';
} }
} }

View File

@@ -393,30 +393,26 @@ foreach ($dirmodels as $reldir)
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>'; $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$facture->type=0; $facture->type=0;
$nextval=$module->getNextValue($mysoc,$facture); $nextval=$module->getNextValue($mysoc,$facture);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
{
$htmltooltip.=$langs->trans("NextValueForInvoices").': '; $htmltooltip.=$langs->trans("NextValueForInvoices").': ';
if ($nextval) if ($nextval) {
{ if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>'; $htmltooltip.=$nextval.'<br>';
} } else {
else
{
$htmltooltip.=$langs->trans($module->error).'<br>'; $htmltooltip.=$langs->trans($module->error).'<br>';
} }
} }
// Example for remplacement // Example for remplacement
$facture->type=1; $facture->type=1;
$nextval=$module->getNextValue($mysoc,$facture); $nextval=$module->getNextValue($mysoc,$facture);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
{
$htmltooltip.=$langs->trans("NextValueForReplacements").': '; $htmltooltip.=$langs->trans("NextValueForReplacements").': ';
if ($nextval) if ($nextval) {
{ if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>'; $htmltooltip.=$nextval.'<br>';
} } else {
else
{
$htmltooltip.=$langs->trans($module->error).'<br>'; $htmltooltip.=$langs->trans($module->error).'<br>';
} }
} }
@@ -424,30 +420,26 @@ foreach ($dirmodels as $reldir)
// Example for credit invoice // Example for credit invoice
$facture->type=2; $facture->type=2;
$nextval=$module->getNextValue($mysoc,$facture); $nextval=$module->getNextValue($mysoc,$facture);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
{
$htmltooltip.=$langs->trans("NextValueForCreditNotes").': '; $htmltooltip.=$langs->trans("NextValueForCreditNotes").': ';
if ($nextval) if ($nextval) {
{ if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>'; $htmltooltip.=$nextval.'<br>';
} } else {
else
{
$htmltooltip.=$langs->trans($module->error).'<br>'; $htmltooltip.=$langs->trans($module->error).'<br>';
} }
} }
// Example for deposit invoice // Example for deposit invoice
$facture->type=3; $facture->type=3;
$nextval=$module->getNextValue($mysoc,$facture); $nextval=$module->getNextValue($mysoc,$facture);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
{
$htmltooltip.=$langs->trans("NextValueForDeposit").': '; $htmltooltip.=$langs->trans("NextValueForDeposit").': ';
if ($nextval) if ($nextval) {
{ if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval; $htmltooltip.=$nextval;
} } else {
else
{
$htmltooltip.=$langs->trans($module->error); $htmltooltip.=$langs->trans($module->error);
} }
} }

View File

@@ -328,9 +328,15 @@ foreach ($dirmodels as $reldir)
$htmltooltip=''; $htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>'; $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$ficheinter); $nextval=$module->getNextValue($mysoc,$ficheinter);
if ($nextval != $langs->trans("NotAvailable")) if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
{ $htmltooltip.=''.$langs->trans("NextValue").': ';
$htmltooltip.=''.$langs->trans("NextValue").': '.$nextval; if ($nextval) {
if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>';
} else {
$htmltooltip.=$langs->trans($module->error).'<br>';
}
} }
print '<td align="center">'; print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,1,0); print $form->textwithpicto('',$htmltooltip,1,0);

View File

@@ -309,15 +309,13 @@ foreach ($dirmodels as $reldir)
$htmltooltip=''; $htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>'; $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$livraison); $nextval=$module->getNextValue($mysoc,$livraison);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
{
$htmltooltip.=''.$langs->trans("NextValue").': '; $htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval) if ($nextval) {
{ if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>'; $htmltooltip.=$nextval.'<br>';
} } else {
else
{
$htmltooltip.=$langs->trans($module->error).'<br>'; $htmltooltip.=$langs->trans($module->error).'<br>';
} }
} }

View File

@@ -344,15 +344,13 @@ foreach ($dirmodels as $reldir)
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>'; $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$propal->type=0; $propal->type=0;
$nextval=$module->getNextValue($mysoc,$propal); $nextval=$module->getNextValue($mysoc,$propal);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
{
$htmltooltip.=''.$langs->trans("NextValue").': '; $htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval) if ($nextval) {
{ if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>'; $htmltooltip.=$nextval.'<br>';
} } else {
else
{
$htmltooltip.=$langs->trans($module->error).'<br>'; $htmltooltip.=$langs->trans($module->error).'<br>';
} }
} }

View File

@@ -278,15 +278,13 @@ foreach ($dirmodels as $reldir)
$htmltooltip=''; $htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>'; $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$invoice); $nextval=$module->getNextValue($mysoc,$invoice);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
{
$htmltooltip.=''.$langs->trans("NextValue").': '; $htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval) if ($nextval) {
{ if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>'; $htmltooltip.=$nextval.'<br>';
} } else {
else
{
$htmltooltip.=$langs->trans($module->error).'<br>'; $htmltooltip.=$langs->trans($module->error).'<br>';
} }
} }

View File

@@ -279,15 +279,13 @@ foreach ($dirmodels as $reldir)
$htmltooltip=''; $htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>'; $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$commande); $nextval=$module->getNextValue($mysoc,$commande);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
{
$htmltooltip.=''.$langs->trans("NextValue").': '; $htmltooltip.=''.$langs->trans("NextValue").': ';
if ($nextval) if ($nextval) {
{ if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>'; $htmltooltip.=$nextval.'<br>';
} } else {
else
{
$htmltooltip.=$langs->trans($module->error).'<br>'; $htmltooltip.=$langs->trans($module->error).'<br>';
} }
} }

View File

@@ -608,7 +608,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$maskraz=-1; $maskraz=-1;
$maskoffset=0; $maskoffset=0;
$resetEveryMonth=false; $resetEveryMonth=false;
if (dol_strlen($maskcounter) < 3) return 'CounterMustHaveMoreThan3Digits'; if (dol_strlen($maskcounter) < 3) return 'ErrorCounterMustHaveMoreThan3Digits';
// Extract value for third party mask counter // Extract value for third party mask counter
if (preg_match('/\{(c+)(0*)\}/i',$mask,$regClientRef)) if (preg_match('/\{(c+)(0*)\}/i',$mask,$regClientRef))
@@ -620,7 +620,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$maskrefclient_clientcode=substr($valueforccc,0,dol_strlen($maskrefclient_maskclientcode));//get n first characters of client code where n is length in mask $maskrefclient_clientcode=substr($valueforccc,0,dol_strlen($maskrefclient_maskclientcode));//get n first characters of client code where n is length in mask
$maskrefclient_clientcode=str_pad($maskrefclient_clientcode,dol_strlen($maskrefclient_maskclientcode),"#",STR_PAD_RIGHT);//padding maskrefclient_clientcode for having exactly n characters in maskrefclient_clientcode $maskrefclient_clientcode=str_pad($maskrefclient_clientcode,dol_strlen($maskrefclient_maskclientcode),"#",STR_PAD_RIGHT);//padding maskrefclient_clientcode for having exactly n characters in maskrefclient_clientcode
$maskrefclient_clientcode=dol_string_nospecial($maskrefclient_clientcode);//sanitize maskrefclient_clientcode for sql insert and sql select like $maskrefclient_clientcode=dol_string_nospecial($maskrefclient_clientcode);//sanitize maskrefclient_clientcode for sql insert and sql select like
if (dol_strlen($maskrefclient_maskcounter) > 0 && dol_strlen($maskrefclient_maskcounter) < 3) return 'CounterMustHaveMoreThan3Digits'; if (dol_strlen($maskrefclient_maskcounter) > 0 && dol_strlen($maskrefclient_maskcounter) < 3) return 'ErrorCounterMustHaveMoreThan3Digits';
} }
else $maskrefclient=''; else $maskrefclient='';
@@ -672,8 +672,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$maskraz = $conf->global->SOCIETE_FISCAL_MONTH_START; $maskraz = $conf->global->SOCIETE_FISCAL_MONTH_START;
//print "maskraz=".$maskraz; // -1=no reset //print "maskraz=".$maskraz; // -1=no reset
if ($maskraz > 0) // A reset is required if ($maskraz > 0) { // A reset is required
{
if ($maskraz == 99) { if ($maskraz == 99) {
$maskraz = date('m', $date); $maskraz = date('m', $date);
$resetEveryMonth = true; $resetEveryMonth = true;
@@ -964,7 +963,7 @@ function check_value($mask,$value)
$maskcounter=$reg[1]; $maskcounter=$reg[1];
$maskraz=-1; $maskraz=-1;
$maskoffset=0; $maskoffset=0;
if (dol_strlen($maskcounter) < 3) return 'CounterMustHaveMoreThan3Digits'; if (dol_strlen($maskcounter) < 3) return 'ErrorCounterMustHaveMoreThan3Digits';
// Extract value for third party mask counter // Extract value for third party mask counter
if (preg_match('/\{(c+)(0*)\}/i',$mask,$regClientRef)) if (preg_match('/\{(c+)(0*)\}/i',$mask,$regClientRef))
@@ -976,7 +975,7 @@ function check_value($mask,$value)
$maskrefclient_clientcode=substr('',0,dol_strlen($maskrefclient_maskclientcode));//get n first characters of client code to form maskrefclient_clientcode $maskrefclient_clientcode=substr('',0,dol_strlen($maskrefclient_maskclientcode));//get n first characters of client code to form maskrefclient_clientcode
$maskrefclient_clientcode=str_pad($maskrefclient_clientcode,dol_strlen($maskrefclient_maskclientcode),"#",STR_PAD_RIGHT);//padding maskrefclient_clientcode for having exactly n characters in maskrefclient_clientcode $maskrefclient_clientcode=str_pad($maskrefclient_clientcode,dol_strlen($maskrefclient_maskclientcode),"#",STR_PAD_RIGHT);//padding maskrefclient_clientcode for having exactly n characters in maskrefclient_clientcode
$maskrefclient_clientcode=dol_string_nospecial($maskrefclient_clientcode);//sanitize maskrefclient_clientcode for sql insert and sql select like $maskrefclient_clientcode=dol_string_nospecial($maskrefclient_clientcode);//sanitize maskrefclient_clientcode for sql insert and sql select like
if (dol_strlen($maskrefclient_maskcounter) > 0 && dol_strlen($maskrefclient_maskcounter) < 3) return 'CounterMustHaveMoreThan3Digits'; if (dol_strlen($maskrefclient_maskcounter) > 0 && dol_strlen($maskrefclient_maskcounter) < 3) return 'ErrorCounterMustHaveMoreThan3Digits';
} }
else $maskrefclient=''; else $maskrefclient='';

View File

@@ -91,6 +91,8 @@ ErrorModuleSetupNotComplete=Setup of module looks to be uncomplete. Go on Setup
ErrorBadMask=Error on mask ErrorBadMask=Error on mask
ErrorBadMaskFailedToLocatePosOfSequence=Error, mask without sequence number ErrorBadMaskFailedToLocatePosOfSequence=Error, mask without sequence number
ErrorBadMaskBadRazMonth=Error, bad reset value ErrorBadMaskBadRazMonth=Error, bad reset value
ErrorMaxNumberReachForThisMask=Max number reach for this mask
ErrorCounterMustHaveMoreThan3Digits=Counter must have more than 3 digits
ErrorSelectAtLeastOne=Error. Select at least one entry. ErrorSelectAtLeastOne=Error. Select at least one entry.
ErrorProductWithRefNotExist=Product with reference '<i>%s</i>' don't exist ErrorProductWithRefNotExist=Product with reference '<i>%s</i>' don't exist
ErrorDeleteNotPossibleLineIsConsolidated=Delete not possible because record is linked to a bank transation that is conciliated ErrorDeleteNotPossibleLineIsConsolidated=Delete not possible because record is linked to a bank transation that is conciliated

View File

@@ -91,6 +91,8 @@ ErrorModuleSetupNotComplete=La configuration du module semble incomplète. Aller
ErrorBadMask=Erreur sur le masque ErrorBadMask=Erreur sur le masque
ErrorBadMaskFailedToLocatePosOfSequence=Erreur, masque sans numéro de séquence ErrorBadMaskFailedToLocatePosOfSequence=Erreur, masque sans numéro de séquence
ErrorBadMaskBadRazMonth=Erreur, mauvais valeur de remise à zéro ErrorBadMaskBadRazMonth=Erreur, mauvais valeur de remise à zéro
ErrorMaxNumberReachForThisMask=Valeur maximale atteinte pour ce masque
ErrorCounterMustHaveMoreThan3Digits=Le compteur doit avoir plus de 3 chiffres
ErrorSelectAtLeastOne=Erreur. Sélectionnez au moins une entrée. ErrorSelectAtLeastOne=Erreur. Sélectionnez au moins une entrée.
ErrorProductWithRefNotExist=La référence produit '<i>%s</i>' n'existe pas ErrorProductWithRefNotExist=La référence produit '<i>%s</i>' n'existe pas
ErrorDeleteNotPossibleLineIsConsolidated=Suppression impossible car l'enregistrement porte sur au moins une transaction bancaire rapprochée ErrorDeleteNotPossibleLineIsConsolidated=Suppression impossible car l'enregistrement porte sur au moins une transaction bancaire rapprochée