Fixes : contact webservice fix update using ref_ext
This commit is contained in:
parent
54ffaea000
commit
97fc99517e
@ -627,9 +627,15 @@ function updateContact($authentication,$contact)
|
|||||||
$error=0;
|
$error=0;
|
||||||
$fuser=check_authentication($authentication,$error,$errorcode,$errorlabel);
|
$fuser=check_authentication($authentication,$error,$errorcode,$errorlabel);
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (empty($contact['id'])) {
|
if (empty($contact['id']) && empty($contact['ref_ext']) {
|
||||||
$error++; $errorcode='KO'; $errorlabel="Contact id is mandatory.";
|
$error++; $errorcode='KO'; $errorlabel="Contact id or ref_ext is mandatory.";
|
||||||
}
|
}
|
||||||
|
// Check parameters
|
||||||
|
if (! $error && ($id && $ref_ext))
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
$errorcode='BAD_PARAMETERS'; $errorlabel="Parameter id and ref_ext can't be all provided. You must choose one of them.";
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -638,7 +644,7 @@ function updateContact($authentication,$contact)
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
|
|
||||||
$object=new Contact($db);
|
$object=new Contact($db);
|
||||||
$result=$object->fetch($contact['id']);
|
$result=$object->fetch($contact['id'],0,$contact['ref_ext']);
|
||||||
|
|
||||||
if (!empty($object->id)) {
|
if (!empty($object->id)) {
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user