FIX #15595
This commit is contained in:
parent
5bdd52500d
commit
9e18997e64
@ -117,6 +117,8 @@ $usercancreatewithdrarequest = $user->rights->prelevement->bons->creer;
|
|||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -287,13 +289,21 @@ if (empty($reshook))
|
|||||||
elseif ($action == 'setref' && $user->rights->facture->creer)
|
elseif ($action == 'setref' && $user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
//var_dump(GETPOST('ref', 'alpha'));exit;
|
//var_dump(GETPOST('ref', 'alpha'));exit;
|
||||||
$result = $object->setValueFrom('titre', GETPOST('ref', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY');
|
$result = $object->setValueFrom('titre', $ref, '', null, 'text', '', $user, 'BILLREC_MODIFY');
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$object->titre = GETPOST('ref', 'alpha'); // deprecated
|
$object->titre = GETPOST('ref', 'alpha'); // deprecated
|
||||||
$object->title = GETPOST('ref', 'alpha');
|
$object->title = GETPOST('ref', 'alpha');
|
||||||
$object->ref = $object->title;
|
$object->ref = $object->title;
|
||||||
} else dol_print_error($db, $object->error, $object->errors);
|
} else {
|
||||||
|
$error++;
|
||||||
|
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||||
|
$langs->load("errors");
|
||||||
|
setEventMessages($langs->trans('ErrorRefAlreadyExists', $ref), null, 'errors');
|
||||||
|
} else {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
} // Set bank account
|
} // Set bank account
|
||||||
elseif ($action == 'setbankaccount' && $user->rights->facture->creer)
|
elseif ($action == 'setbankaccount' && $user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4074,7 +4074,7 @@ if ($action == 'create')
|
|||||||
print $object->getLibType();
|
print $object->getLibType();
|
||||||
print '</span>';
|
print '</span>';
|
||||||
if ($object->module_source) {
|
if ($object->module_source) {
|
||||||
print ' <span class="opacitymediumbycolor paddingleft">('.$langs->trans("POS").' '.$object->module_source.' - '.$langs->trans("Terminal").' '.$object->pos_source.')</span>';
|
print ' <span class="opacitymediumbycolor paddingleft">('.$langs->trans("POS").' '.ucfirst($object->module_source).' - '.$langs->trans("Terminal").' '.$object->pos_source.')</span>';
|
||||||
}
|
}
|
||||||
if ($object->type == Facture::TYPE_REPLACEMENT) {
|
if ($object->type == Facture::TYPE_REPLACEMENT) {
|
||||||
$facreplaced = new Facture($db);
|
$facreplaced = new Facture($db);
|
||||||
|
|||||||
@ -1817,7 +1817,11 @@ abstract class CommonObject
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->error = $this->db->lasterror();
|
if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||||
|
$this->error = 'DB_ERROR_RECORD_ALREADY_EXISTS';
|
||||||
|
} else {
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
}
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ ErrorBadEMail=Email %s is wrong
|
|||||||
ErrorBadMXDomain=Email %s seems wrong (domain has no valid MX record)
|
ErrorBadMXDomain=Email %s seems wrong (domain has no valid MX record)
|
||||||
ErrorBadUrl=Url %s is wrong
|
ErrorBadUrl=Url %s is wrong
|
||||||
ErrorBadValueForParamNotAString=Bad value for your parameter. It appends generally when translation is missing.
|
ErrorBadValueForParamNotAString=Bad value for your parameter. It appends generally when translation is missing.
|
||||||
|
ErrorRefAlreadyExists=Reference <b>%s</b> already exists.
|
||||||
ErrorLoginAlreadyExists=Login %s already exists.
|
ErrorLoginAlreadyExists=Login %s already exists.
|
||||||
ErrorGroupAlreadyExists=Group %s already exists.
|
ErrorGroupAlreadyExists=Group %s already exists.
|
||||||
ErrorRecordNotFound=Record not found.
|
ErrorRecordNotFound=Record not found.
|
||||||
|
|||||||
@ -7,6 +7,7 @@ ErrorButCommitIsDone=Erreurs trouvées mais on valide malgré tout
|
|||||||
ErrorBadEMail=email %s invalide
|
ErrorBadEMail=email %s invalide
|
||||||
ErrorBadUrl=Url %s invalide
|
ErrorBadUrl=Url %s invalide
|
||||||
ErrorBadValueForParamNotAString=Mauvaise valeur de paramètre. Ceci arrive lors d'une tentative de traduction d'une clé non renseignée.
|
ErrorBadValueForParamNotAString=Mauvaise valeur de paramètre. Ceci arrive lors d'une tentative de traduction d'une clé non renseignée.
|
||||||
|
ErrorRefAlreadyExists=La référence %s existe déjà.
|
||||||
ErrorLoginAlreadyExists=L'identifiant %s existe déjà.
|
ErrorLoginAlreadyExists=L'identifiant %s existe déjà.
|
||||||
ErrorGroupAlreadyExists=Le groupe %s existe déjà.
|
ErrorGroupAlreadyExists=Le groupe %s existe déjà.
|
||||||
ErrorRecordNotFound=Enregistrement non trouvé.
|
ErrorRecordNotFound=Enregistrement non trouvé.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user