|
|
@@ -143,7 +143,16 @@ function get_images($document_reference){ |
|
|
|
$xml = new SimpleXMLElement($response); |
|
|
|
|
|
|
|
// Retrieve image path from that XML |
|
|
|
$drawings_url = $_ENV["OPS_URL_IMAGES"] . '3.2/rest-services/' . $xml->xpath("///ops:document-instance[@desc='Drawing']/@link")[0][0]->__toString() . '?Range=1'; |
|
|
|
if (isset($xml->xpath("///ops:document-instance[@desc='Drawing']/@link")[0][0])) { |
|
|
|
|
|
|
|
$drawings_url = $_ENV["OPS_URL_IMAGES"] . '3.2/rest-services/' . $xml->xpath("///ops:document-instance[@desc='Drawing']/@link")[0][0]->__toString() . '?Range=1'; |
|
|
|
|
|
|
|
} |
|
|
|
else { |
|
|
|
|
|
|
|
$drawings_url = $_ENV["OPS_URL_IMAGES"] . '3.2/rest-services/' . $xml->xpath("///ops:document-instance[@desc='FullDocument']/@link")[0][0]->__toString() . '?Range=1'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Set up API call |
|
|
|
$ch = curl_init(); |