Skip to content
Snippets Groups Projects
Commit 83e7c8a0 authored by Michael Fenton's avatar Michael Fenton
Browse files

Provide NotFound and Error return values

Providing a Not Found Message when a Third Party entity is not found to match with details provided, and providing an Error Message when the SQL Lookup fails.

This will help Asterisk Users determine whether the CallerID would be usable from Dolibarr or to reject and continue with existing CID from Asterisk
parent 81d2d120
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,8 @@
include '../master.inc.php';
$phone = GETPOST('phone');
$notfound = "Not found";
$error = "Error"
// Security check
if (empty($conf->clicktodial->enabled)) {
......@@ -64,13 +65,15 @@ if ($resql)
if ($obj)
{
$found = $obj->name;
} else {
$found = $notfound;
}
$db->free($resql);
}
else
{
dol_print_error($db,'Error');
$found = $error;
}
echo $found;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment