| 1433 | | $existing=core_did_get($directdid,"",""); |
|---|
| 1434 | | $existing_directdid = empty($existing)?core_users_directdid_get($directdid):$existing; |
|---|
| 1435 | | if (!empty($existing) || !empty($existing_directdid)) { |
|---|
| 1436 | | if (!empty($existing)) { |
|---|
| 1437 | | echo "<script>javascript:alert('"._("A route with this DID already exists:")." ".$existing['extension']."')</script>"; |
|---|
| 1438 | | } else { |
|---|
| 1439 | | echo "<script>javascript:alert('"._("This DID is already associated with extension:")." ".$existing_directdid['extension']." (".$existing_directdid['name'].")')</script>"; |
|---|
| 1440 | | } |
|---|
| 1441 | | return false; |
|---|
| | 1433 | if ($directdid != "") { |
|---|
| | 1434 | $existing=core_did_get($directdid,"",""); |
|---|
| | 1435 | $existing_directdid = empty($existing)?core_users_directdid_get($directdid):$existing; |
|---|
| | 1436 | if (!empty($existing) || !empty($existing_directdid)) { |
|---|
| | 1437 | if (!empty($existing)) { |
|---|
| | 1438 | echo "<script>javascript:alert('"._("A route with this DID already exists:")." ".$existing['extension']."')</script>"; |
|---|
| | 1439 | } else { |
|---|
| | 1440 | echo "<script>javascript:alert('"._("This DID is already associated with extension:")." ".$existing_directdid['extension']." (".$existing_directdid['name'].")')</script>"; |
|---|
| | 1441 | } |
|---|
| | 1442 | return false; |
|---|
| | 1443 | } |
|---|