* @author Gabriele Droege (BGBM, GGBN/DNA Bank Network) * @version 1.0 * @package View * @var $this SearchController * @var $processor XSLTProcessor * @var $xsl DOMDocument * @var $response SOLR response object * @var $html transformed xslt result * @copyright Copyright © 2011 DNA Bank Network http://www.dnabank-network.org *
The contents of this file are subject to the Mozilla Public License Version 1.1 * @filesource * @license http://www.mozilla.org/MPL/ MPL */ use yii\helpers\Html; use yii\helpers\Url; use yii\jui\Tabs; use yii\web\View; use ggbn\SingleRecordManager; use kartik\widgets\ActiveForm; use yii\widgets\Pjax; use annosys\ExploreAnnosys; $this->title = 'Specimen Explorer'; // $this->title = 'Results'; // $this->params ['breadcrumbs'] [] = $this->title; $abcdDocuments = [ ]; $contentLeft = ""; $contentRight = ""; echo ''; $this->registerJs ( " $(document).ready(function() { $('.tabs .tab-links a').on('click', function(e) { var currentAttrValue = $(this).attr('href'); // Show/Hide Tabs $(currentAttrValue).show(); $(currentAttrValue).siblings().hide(); // Change/remove current tab to active $(this).parent('li').addClass('active hop').siblings().removeClass('active'); e.preventDefault(); }); } ); ", View::POS_READY ); echo ''; echo '
' . Html::button ( $model->newSearchButtonLabel, [ 'onclick' => 'js:document.location.href="' . Yii::$app->getUrlManager ()->createUrl ( [ 'search/index' ] ) . '"', 'class' => 'btn btn-success' ] ) . '




'; if (isset ( Yii::$app->session ['multiunits'] )) { $units = Yii::$app->session ['multiunits']; if (sizeof ( $units ) > 1) { echo "Selected units:"; } } ?>
params ['useLogin'] && ( in_array ( Yii::$app->request->userIP, Yii::$app->params ['authorizedIPs'] ) || in_array("all", Yii::$app->params['authorizedIPs'] ))) { if (! Yii::$app->user->isGuest) { Pjax::begin ( [ 'enablePushState' => false ] ); ?> Add this record to your cart! 'btn btn-success', 'name' => 'add-button']);?> 'btn btn-success', 'name' => 'cart-button'])?> Explore ' . $canonicalName . ''; echo '
'; echo '

'; // echo $model->detailsTitle; echo $collectors; if(!empty($collectornb)) echo " ".implode(" ",$collectornb); echo " (".$indexHerbarorium.")"; echo '

'; echo '
'; $xsl = new DOMDocument (); $xslsequence = new DOMDocument (); $xsltissue = new DOMDocument (); $xslTab = new DOMDocument (); $xslHeader = new DOMDocument (); $xslspecimen = new DOMDocument (); $noHeader = true; $Dataset=""; if (! isset ( $QueryForTissueTab )) { $QueryForTissueTab = ""; } if (! isset ( $QueryForCultureTab )) { $QueryForCultureTab = ""; } if (! isset ( $QueryForEnviroTab )) { $QueryForEnviroTab = ""; } if (! isset ( $QueryForSpecimenTab )) { $QueryForSpecimenTab = ""; } if (! isset ( $QueryForSpecimenTab2 )) { $QueryForSpecimenTab2 = ""; } if (! isset ( $QueryForMultimediaTab )) { $QueryForMultimediaTab = $multimedia; } if (! isset ( $DNAcontent )) { $DNAcontent = ""; } $otherDNA = [ ]; $otherTissue = [ ]; $citesStatus = NULL; $headerSample = "specimen"; if (isset ( $unitID2 )) { $headerSample = "DNA"; foreach ( $unitID2 as $index => $associatedUnitID ) { $associatedSampletype = $sampletype2 [$index]; if ($associatedSampletype == "unknown") if ($headerSample != "specimen") $headerSample = "unknown"; if ($associatedSampletype == "tissue") if ($headerSample != "specimen") $headerSample = "tissue"; if ($associatedSampletype == "culture") if ($headerSample != "specimen") $headerSample = "specimen"; if ($associatedSampletype == "specimen") $headerSample = "specimen"; // echo "
"; if ($citesStatus == NULL) { $citesStatus = $citesStatus2 [$index]; if ($citesStatus == "N/A") { $citesStatus = NULL; } } } // if ($citesStatus != NULL || ! empty ( $loan )) { // echo "

Loan information

"; // $dnaAvail = false; // if (! empty ( $loan )) { // foreach ( $loan as $k => $v ) { // echo $v [0]; // if (strpos ( $v [0], "DNA" ) > 0) // $dnaAvail = true; // if ($v [1] == "OK" && $v [4] != "consumed") { // if (substr ( $v [2], 0, 3 ) == "was") // echo "" . $v [2] . ""; // else // echo "not blocked"; // } else // echo "" . $v [2] . ""; // if (! empty ( $v [3] )) // echo "  Conditions: " . $v [3]; // if (! empty ( $v [4] )) // echo "  Disposition (quantity): " . $v [4]; // echo "
"; // } // if (! $dnaAvail) // echo " DNA available upon request
"; // } // if ($citesStatus != NULL) // echo "This species or genus was found in the CITES list (UNEP-WCMC (Comps.) 2015. // More details here"; // // echo "headerSample should be from : " . $headerSample . "
"; // echo "
"; // echo "
"; // } echo "
"; foreach ( $unitID2 as $index => $associatedUnitID ) { if($associatedUnitID != $filters['unitID']){ // echo $associatedUnitID; $associatedCollectionCode = $collectioncode2 [$index]; $associatedInstitutionCode = $institutioncode2 [$index]; $associatedAccessPoint = $accesspoint2 [$index]; $associatedSchemaUrl = $schemaurl2 [$index]; $associatedSchemaName = $schemaname2 [$index]; $associatedBaseDirectory = $basedirectory2 [$index]; $associatedDigirResourcename = $digirresourcename2 [$index]; $associatedMultimedia = $multimedia2 [$index]; $associatedSampletype = $sampletype2 [$index]; $latitude = $latitude2 [$index]; $longitude = $longitude2 [$index]; $tripleid = $tripleid2 [$index]; $associatedOccurrenceFile = $occurrenceFile2 [$index]; // echo "$associatedMultimedia ".$associatedMultimedia; // echo"dir ".$associatedBaseDirectory. "
"; // echo "schema version: ".$associatedSchemaUrl."
"; // echo "associatedSampletype: " . $associatedSampletype . "
"; $query2 = SingleRecordManager::createAssociatedRecordQuery ( $associatedUnitID, $associatedCollectionCode, $associatedInstitutionCode, $associatedSchemaUrl, $associatedDigirResourcename, $associatedAccessPoint ); // for all associated records and record without association if (isset ( $associatedAccessPoint )) { $query = $query2; if (strcasecmp ( $associatedSampletype, "dna" ) != 0 && $associatedSampletype != "missing") { $noHeader = false; if ($associatedSampletype == "specimen" or $associatedSampletype == "unknown" or $associatedSampletype == "culture") { if ($associatedSchemaUrl == "http://www.tdwg.org/schemas/abcd/2.1") { $xsltfileHeader = 'XSLT/en_ABCD2.1_Summary_Header.xslt'; $xsltfileTab = 'XSLT/specimen/en_ABCD2.1_Summary_Tab.xslt'; echo ""; } if ($associatedSchemaUrl == "http://www.tdwg.org/schemas/abcd/2.06") { $xsltfileHeader = 'XSLT/en_ABCD2.0_Summary_Header.xslt'; $xsltfileTab = 'XSLT/specimen/en_ABCD2.0_Summary_Tab.xslt'; echo ""; } } else if ($associatedSampletype == "tissue") { if ($associatedSchemaUrl == "http://www.tdwg.org/schemas/abcd/2.1") { $xsltfileHeader = 'XSLT/en_ABCD2.1_Summary_Header.xslt'; $xsltfileTab = 'XSLT/tissue/en_ABCD2.1_Summary_Tab.xslt'; echo ""; } if ($associatedSchemaUrl == "http://www.tdwg.org/schemas/abcd/2.06") { $xsltfileHeader = 'XSLT/en_ABCD2.0_Summary_Header.xslt'; $xsltfileTab = 'XSLT/en_ABCD2.0_Summary_Tab.xslt'; echo ""; } } if ($associatedSampletype == "tissue" && sizeof ( $unitID2 ) > 1) $otherTissue [$associatedUnitID] = "/" . Yii::$app->params ['siteName'] . "/search/record?unitID=" . $associatedUnitID . "&collectioncode=" . $associatedCollectionCode . "&institutioncode=" . $associatedInstitutionCode; if ($associatedSchemaName == "abcd") { echo ""; // echo"ok $headerSample vs ".$associatedSampletype; // get xslt: echo ""; $xslHeader->load ( $xsltfileHeader ); $xslTab->load ( $xsltfileTab ); $abcdXML = SingleRecordManager::getABCD ( $associatedAccessPoint, $query, $associatedUnitID )[0]; $parsedABCDHeader = SingleRecordManager::parseABCD ( $xslHeader, $abcdXML, $tripleid ); $outs = SingleRecordManager::parseABCD ( $xslTab, $abcdXML, $tripleid ); $out=$outs[0]; if($outs[1]) $abcdDocuments [] = $associatedUnitID; // $tmpTab=explode('
', $out); // $out=$tmpTab[0]; // try{ // $Dataset='
'.$tmpTab[1]; // } catch (Exception $e) { // $Dataset=""; // } if ($associatedSampletype == "tissue") { $QueryForTissueTab = $QueryForTissueTab . $out; if ($headerSample == 'tissue') { echo "
"; if (isset ( $latitude ) && isset ( $longitude )) { echo $this->render ( '/search/show/mapView', [ "latitude" => $latitude, "longitude" => $longitude, "localityText" => $parsedABCDHeader ], true ); } else echo "
" . $parsedABCDHeader . "
"; echo "
"; } } else { if ($associatedSampletype == "culture") { $QueryForCultureTab = $QueryForCultureTab . $out; } if ($associatedSampletype == "enviro") { $QueryForEnviroTab = $QueryForEnviroTab . $out; } if ($QueryForSpecimenTab == "") { if ($headerSample == 'specimen' || $headerSample == "unknown") { if ($associatedSampletype == "specimen" || $associatedSampletype == "unknown") $QueryForSpecimenTab = $QueryForSpecimenTab . $out; echo "
"; if (isset ( $latitude ) && isset ( $longitude )) { echo $this->render ( '/search/show/mapView', [ "latitude" => $latitude, "longitude" => $longitude, "localityText" => $parsedABCDHeader ], true ); } else echo "
" . $parsedABCDHeader . "
"; echo "
"; } } else { if ($associatedSampletype != "culture" && $associatedSampletype != "enviro") $QueryForSpecimenTab2 = $QueryForSpecimenTab2 . $out; } } if (! empty ( $associatedMultimedia ) && strpos ( $QueryForMultimediaTab, $associatedMultimedia ) === FALSE) { $QueryForMultimediaTab = $QueryForMultimediaTab . $associatedMultimedia; } // echo $parsedABCDHeader; } else if ($associatedSchemaUrl == "http://rs.tdwg.org/dwc/") { $dom = new DOMDocument (); $folder = Yii::$app->params ['dwcArchivesPath'] . $associatedBaseDirectory . "/associated/smallArchive/"; $file = $folder . "meta.xml"; try { $dom->Load ( $file ); } catch ( Exception $e ) { echo "Aouch Could not find the archive under the location " . $file; echo $e; } echo ""; if ($associatedSampletype == "tissue") { // only want to see the current tissue and not all associated ones // TODO check what happens for DNA with tissue... if (empty ( $otherTissue [$associatedUnitID] )) { if ($headerSample == 'tissue') { $out = SingleRecordManager::readDwCA ( $associatedUnitID, $folder, $dom, $associatedSampletype, $associatedOccurrenceFile ); $QueryForTissueTab = $out ["tissue"]; echo "
"; if (isset ( $latitude ) && isset ( $longitude )) { echo $this->render ( '/search/show/mapView', [ "latitude" => $latitude, "longitude" => $longitude, "localityText" => $out ["locality"] ], true ); } else echo "
" . $out ["locality"] . "
"; echo "
"; } } } else { if ($associatedSampletype != "tissue" && $headerSample == 'specimen') { $out = SingleRecordManager::readDwCA ( $associatedUnitID, $folder, $dom, $associatedSampletype, $associatedOccurrenceFile ); echo "
"; if (isset ( $latitude ) && isset ( $longitude )) { echo $this->render ( '/search/show/mapView', [ "latitude" => $latitude, "longitude" => $longitude, "localityText" => $out ["locality"] ], true ); } else echo "
" . $out ["locality"] . "
"; echo "
"; } if ($QueryForSpecimenTab == "") { $QueryForSpecimenTab = $out ["specimen"]; } else { // if there is already one specimen, put a second tabulation $QueryForSpecimenTab2 = $out ["specimen"]; } } } // end if DwC-A else if ($associatedSchemaName == "darwincore") { // get xslt: $xsl->load ( 'XSLT/specimen/en_DarwinCore_UnitDetail.xslt' ); $digirresourcename = $associatedDigirResourcename; $out = SingleRecordManager::readDwC ( $xsl, $associatedAccessPoint, $digirresourcename, $query, $tripleid ); if (! empty ( $out )) echo $out; else { $noHeader = true; echo "The associated unit could not be found - not all info will be displayed"; } } else { echo "The associated records are missing or do not exist.
"; } } else { if ($associatedSampletype == "missing") { echo "The associated unit could not be found - not all info will be displayed"; } else { if ($associatedSchemaName == "abcd") { if ($associatedSchemaUrl == "http://www.tdwg.org/schemas/abcd/2.1") { $xsl->load ( 'XSLT/DNA/en_ABCD2.1_Summary_Tab.xslt' ); echo ""; $abcd = "true"; } if ($associatedSchemaUrl == "http://www.tdwg.org/schemas/abcd/2.06") { $xsl->load ( 'XSLT/DNA/en_ABCD2.0_Summary_Tab.xslt' ); $abcd = "true"; echo ""; } if (strtolower ( $associatedSampletype ) === "dna") { if ($associatedUnitID === $filters ['unitID']) { $abcdXML=SingleRecordManager::getABCD ( $associatedAccessPoint, $query, $associatedUnitID ); // $abcdDocuments [] = $associatedUnitID; echo ""; // $DNAcontent = $DNAcontent . SingleRecordManager::parseABCD ( $xsl, $abcdXML ); } else $otherDNA [$associatedUnitID] = "/" . Yii::$app->params ['siteName'] . "/search/record?unitID=" . $associatedUnitID . "&collectioncode=" . $associatedCollectionCode . "&institutioncode=" . $associatedInstitutionCode; } } if ($associatedSchemaUrl == "http://rs.tdwg.org/dwc/") { $dom = new DOMDocument (); $folder = Yii::$app->params ['dwcArchivesPath'] . $associatedBaseDirectory . "/associated/smallArchive/"; $file = $folder . "meta.xml"; try { $dom->Load ( $file ); } catch ( Exception $e ) { echo "Problem: Could not find the archive under the location " . $file; } $out = SingleRecordManager::readDwCA ( $associatedUnitID, $folder, $dom, $associatedSampletype, $associatedOccurrenceFile ); $otherDNA [$associatedUnitID] = "/" . Yii::$app->params ['siteName'] . "/search/record?unitID=" . $associatedUnitID . "&collectioncode=" . $associatedCollectionCode . "&institutioncode=" . $associatedInstitutionCode; $abcd = "false"; } } } } } // if(isset($associatedAccessPoint) else { echo "Something went wrong"; } } echo "
"; } // if(isset($unitID2)) if (! isset ( $unitID2 ) || $noHeader) { if (! isset ( $unitID2 )) { // echo "There is no associated unit - not all info will be displayed"; $associatedCollectionCode = $filters ['collectioncode']; $associatedInstitutionCode = $filters ['institutioncode']; $associatedUnitID = $filters ['unitID']; $associatedAccessPoint = $accesspoint; $associatedSchemaUrl = $schemaurl; $associatedSchemaName = $schemaname; $associatedBaseDirectory = $basedirectory; $associatedDigirResourcename = $digirresourcename; $associatedMultimedia = $multimedia; $associatedSampletype = $sampletype; $associatedOccurrenceFile = $occurrenceFile; if (empty ( $associatedSampletype ) || $associatedSampletype=='unknown') $associatedSampletype = "specimen"; $noHeader = false; $query2 = SingleRecordManager::createAssociatedRecordQuery ( $associatedUnitID, $associatedCollectionCode, $associatedInstitutionCode, $associatedSchemaUrl, $associatedDigirResourcename, $associatedAccessPoint ); // for all associated records and record without association if (isset ( $associatedAccessPoint )) { $query = $query2; // if (strcasecmp ( $associatedSampletype, "dna" ) != 0 && $associatedSampletype != "missing") { $noHeader = false; // if (in_array ( $associatedSampletype, [ // "specimen", // "unknown", // "culture", // "tissue" // ] ) or // try with tissue also // empty ( $associatedSampletype )) { if ($associatedSchemaUrl == "http://www.tdwg.org/schemas/abcd/2.1") { $xslspecimen->load ( 'XSLT/specimen/en_ABCD2.1_Summary_Tab.xslt' ); $xsltfileHeader = 'XSLT/en_ABCD2.1_Summary_Header.xslt'; $xsltfileTab = 'XSLT/specimen/en_ABCD2.1_Summary_Tab.xslt'; echo ""; } if ($associatedSchemaUrl == "http://www.tdwg.org/schemas/abcd/2.06") { $xslspecimen->load ( 'XSLT/specimen/en_ABCD2.0_Summary_Tab.xslt' ); $xsltfileHeader = 'XSLT/en_ABCD2.0_Summary_Header.xslt'; $xsltfileTab = 'XSLT/specimen/en_ABCD2.0_Summary_Tab.xslt'; echo ""; } // } if ($associatedSampletype == "tissue" && isset ( $unitID2 ) && sizeof ( $unitID2 ) > 1) $otherTissue [$associatedUnitID] = "/" . Yii::$app->params ['siteName'] . "/search/record?unitID=" . $associatedUnitID . "&collectioncode=" . $associatedCollectionCode . "&institutioncode=" . $associatedInstitutionCode; if ($associatedSchemaName == "abcd") { echo ""; // echo"ok $headerSample vs ".$associatedSampletype; // get xslt: echo ""; $xslHeader->load ( $xsltfileHeader ); $xslTab->load ( $xsltfileTab ); $abcdXML = SingleRecordManager::getABCD ( $associatedAccessPoint, $query, $associatedUnitID ); $parsedABCDHeader = SingleRecordManager::parseABCD ( $xslHeader, $abcdXML, $tripleid )[0]; $outs = SingleRecordManager::parseABCD ( $xslTab, $abcdXML, $tripleid ); $out=$outs[0]; if($outs[1]) $abcdDocuments [] = $associatedUnitID; // $tmpTab=explode('
', $out); // $out=$tmpTab[0]; // try { // $Dataset='
'.$tmpTab[1]; // } catch (Exception $e) { // $Dataset=""; // } if ($associatedSampletype == "tissue") { $QueryForTissueTab = $QueryForTissueTab . $out; // if ($headerSample == 'tissue') { echo "
"; if (isset ( $latitude ) && isset ( $longitude )) { echo $this->render ( '/search/show/mapView', [ "latitude" => $latitude, "longitude" => $longitude, "localityText" => $parsedABCDHeader ], true ); } else echo "
" . $parsedABCDHeader . "
"; echo "
"; // } } else { if ($associatedSampletype == "culture") { $QueryForCultureTab = $QueryForCultureTab . $out; } if ($associatedSampletype == "enviro") { $QueryForEnviroTab = $QueryForEnviroTab . $out; } if ($QueryForSpecimenTab == "") { if (in_array ( $headerSample, [ 'specimen', "unknown", "dna" ] )) { // if ($associatedSampletype == "specimen" || $associatedSampletype == "unknown") $QueryForSpecimenTab = $QueryForSpecimenTab . $out; echo "
"; if (isset ( $latitude ) && isset ( $longitude )) { echo $this->render ( '/search/show/mapView', [ "latitude" => $latitude, "longitude" => $longitude, "localityText" => $parsedABCDHeader ], true ); } else echo "
" . $parsedABCDHeader . "
"; echo "
"; } } else { if ($associatedSampletype != "culture" && $associatedSampletype != "enviro") $QueryForSpecimenTab2 = $QueryForSpecimenTab2 . $out; } } if (! empty ( $associatedMultimedia ) && strpos ( $QueryForMultimediaTab, $associatedMultimedia ) === FALSE) { $QueryForMultimediaTab = $QueryForMultimediaTab . $associatedMultimedia; // echo $parsedABCDHeader; } } else if ($associatedSchemaUrl == "http://rs.tdwg.org/dwc/") { $dom = new DOMDocument (); $folder = Yii::$app->params ['dwcArchivesPath'] . $associatedBaseDirectory . "/associated/smallArchive/"; $file = $folder . "meta.xml"; try { $dom->Load ( $file ); } catch ( Exception $e ) { echo "Aouch Could not find the archive under the location " . $file; echo $e; } echo ""; if ($associatedSampletype == "tissue") { // only want to see the current tissue and not all associated ones // TODO check what happens for DNA with tissue... if (empty ( $otherTissue [$associatedUnitID] )) { if ($headerSample == 'tissue') { $out = SingleRecordManager::readDwCA ( $associatedUnitID, $folder, $dom, $associatedSampletype, $associatedOccurrenceFile ); $QueryForTissueTab = $out ["tissue"]; echo "
"; if (isset ( $latitude ) && isset ( $longitude )) { echo $this->render ( '/search/show/mapView', [ "latitude" => $latitude, "longitude" => $longitude, "localityText" => $out ["locality"] ], true ); } else echo "
" . $out ["locality"] . "
"; echo "
"; } } } else { if ($associatedSampletype != "tissue" && $headerSample == 'specimen') { $out = SingleRecordManager::readDwCA ( $associatedUnitID, $folder, $dom, $associatedSampletype, $associatedOccurrenceFile ); echo "
"; if (isset ( $latitude ) && isset ( $longitude )) { echo $this->render ( '/search/show/mapView', [ "latitude" => $latitude, "longitude" => $longitude, "localityText" => $out ["locality"] ], true ); } else echo "
" . $out ["locality"] . "
"; echo "
"; } if ($QueryForSpecimenTab == "" || empty($QueryForSpecimenTab)) { $QueryForSpecimenTab = $out ["specimen"]; } else { // if there is already one specimen, put a second tabulation $QueryForSpecimenTab2 = $out ["specimen"]; } } } // end if DwC-A else if ($associatedSchemaName == "darwincore") { // get xslt: $xsl->load ( 'XSLT/specimen/en_DarwinCore_UnitDetail.xslt' ); $digirresourcename = $associatedDigirResourcename; $out = SingleRecordManager::readDwC ( $xsl, $associatedAccessPoint, $digirresourcename, $query, $tripleid ); if (! empty ( $out )) echo $out; else { $noHeader = true; echo "DwCThe associated unit could not be found - not all info will be displayed"; } } else { echo "The associated records are missing or do not exist.
"; } // } else { // if ($associatedSampletype == "missing") { // echo "Missing The associated unit could not be found - not all info will be displayed"; // } else { // if ($associatedSchemaName == "abcd") { // if ($associatedSchemaUrl == "http://www.tdwg.org/schemas/abcd/2.1") { // $xsl->load ( 'XSLT/DNA/en_ABCD2.1_Summary_Tab.xslt' ); // echo ""; // $abcd = "true"; // } // if ($associatedSchemaUrl == "http://www.tdwg.org/schemas/abcd/2.06") { // $xsl->load ( 'XSLT/DNA/en_ABCD2.0_Summary_Tab.xslt' ); // $abcd = "true"; // echo ""; // } // if (strtolower ( $associatedSampletype ) === "dna") { // if ($associatedUnitID === $filters ['unitID']) { // $abcdXML = SingleRecordManager::getABCD ( $associatedAccessPoint, $query, $associatedUnitID ); // $abcdDocuments [] = $associatedUnitID; // echo ""; // // $DNAcontent = $DNAcontent . SingleRecordManager::parseABCD ( $xsl, $abcdXML ); // } else // $otherDNA [$associatedUnitID] = "/" . Yii::$app->params ['siteName'] . "/search/record?unitID=" . $associatedUnitID . "&collectioncode=" . $associatedCollectionCode . "&institutioncode=" . $associatedInstitutionCode; // } // } // if ($associatedSchemaUrl == "http://rs.tdwg.org/dwc/") { // $dom = new DOMDocument (); // $folder = Yii::$app->params ['dwcArchivesPath'] . $associatedBaseDirectory . "/default/smallArchive/"; // $file = $folder . "meta.xml"; // try { // $dom->Load ( $file ); // } catch ( Exception $e ) { // echo "Problem: Could not find the archive under the location " . $file; // } // $out = SingleRecordManager::readDwCA ( $associatedUnitID, $folder, $dom, $associatedSampletype, $associatedOccurrenceFile ); // $otherDNA [$associatedUnitID] = "/" . Yii::$app->params ['siteName'] . "/search/record?unitID=" . $associatedUnitID . "&collectioncode=" . $associatedCollectionCode . "&institutioncode=" . $associatedInstitutionCode; // $abcd = "false"; // } // } // } } // if(isset($associatedAccessPoint) else { echo "Something went wrong"; } } } if (isset ( $schemaurl )) { $query = SingleRecordManager::createRecordQuery ( $filters, $schemaurl ); } $annotations = ExploreAnnosys::getAnnosysJSON ( $filters['unitID'], $filters['collectioncode'], $filters['institutioncode'] ); if (isset ( $accesspoint )) { $abcd = "false"; // echo $filters['unitID']; if ($schemaurl == "http://www.tdwg.org/schemas/abcd/2.1") { // get xslt: $xsl->load ( 'XSLT/DNA/en_ABCD2.1_Summary_DNA.xslt' ); $xsltissue->load ( 'XSLT/tissue/en_ABCD2.1_Summary_Tab.xslt' ); $xslsequence->load ( 'XSLT/DNA/en_ABCD2.1_Sequence_Tab.xslt' ); // echo ""; $abcd = "true"; if (isset ( $noAssoc ) && $noAssoc) { $xslspecimen->load ( 'XSLT/specimen/en_ABCD2.1_Summary_Tab.xslt' ); Yii::info ( "wants to load XSLT/specimen/en_ABCD2.1_Summary_Tab.xslt " ); echo ""; } if ($noHeader) { $xslHeader->load ( 'XSLT/en_ABCD2.1_Summary_Header.xslt' ); echo ""; } } if ($schemaurl == "http://www.tdwg.org/schemas/abcd/2.06") { // get xslt: $xsl->load ( 'XSLT/DNA/en_ABCD2.0_Summary_Tab.xslt' ); $xsltissue->load ( 'XSLT/en_ABCD2.0_Summary_Tab.xslt' ); $xslsequence->load ( 'XSLT/DNA/en_ABCD2.0_Sequence_Tab.xslt' ); echo ""; $abcd = "true"; if (isset ( $noAssoc ) && $noAssoc) { Yii::info ( "wants to load XSLT/specimen/en_ABCD2.0_Summary_Tab.xslt " ); $xslspecimen->load ( 'XSLT/specimen/en_ABCD2.0_Summary_Tab.xslt' ); echo ""; } if ($noHeader) $xslHeader->load ( 'XSLT/en_ABCD2.0_Summary_Header.xslt' ); } if ($abcd == "true") { $abcdXML = SingleRecordManager::getABCD ( $accesspoint, $query, $filters ['unitID'] ); // $abcdDocuments [] = $filters ['unitID']; if ($sampletype == "tissue"){ $QueryForTissueTab = SingleRecordManager::parseABCD ( $xsltissue, $abcdXML, $tripleid )[0]; $tmpTab=explode('
', $QueryForTissueTab); $QueryForTissueTab=$tmpTab[0]; try{ $Dataset='
'.$tmpTab[1]; } catch (Exception $e) { // $Dataset="764"; } } else { if ($sampletype == "culture"){ $QueryForCultureTab = SingleRecordManager::parseABCD ( $xslspecimen, $abcdXML, $tripleid )[0]; $tmpTab=explode('
', $QueryForCultureTab); $QueryForCultureTab=$tmpTab[0]; try{ $Dataset='
'.$tmpTab[1]; } catch (Exception $e) { // $Dataset="775"; } } else if ($sampletype == "specimen"){ $QueryForSpecimenTab = SingleRecordManager::parseABCD ( $xslspecimen, $abcdXML, $tripleid )[0]; $tmpTab=explode('
', $QueryForSpecimenTab); $QueryForSpecimenTab=$tmpTab[0]; try{ $Dataset='
'.$tmpTab[1]; } catch (Exception $e) { // $Dataset="785"; } } else if ($sampletype == "DNA") if (! isset ( $DNAcontent ) || $DNAcontent == "") { $DNAcontent = SingleRecordManager::parseABCD ( $xsl, $abcdXML, $tripleid )[0]; $tmpTab=explode('
', $DNAcontent); $DNAcontent=$tmpTab[0]; try{ $Dataset='
'.$tmpTab[1]; } catch (Exception $e) { // $Dataset="796"; } if (! strpos ( $DNAcontent, "Institution Code" )) $DNAcontent = ""; } } if (! isset ( $DNAsequence ) || $DNAsequence == "") { $DNAsequence = SingleRecordManager::parseABCD ( $xslsequence, $abcdXML, $tripleid )[0]; $tmpTab=explode('
', $DNAsequence); $DNAsequence=$tmpTab[0]; try{ $Dataset='
'.$tmpTab[1]; } catch (Exception $e) { // $Dataset="809"; } } if (strstr ( $schemaurl, "2.0" )) { if (! strstr ( $DNAsequence, "Amplification" )) $DNAsequence = ""; } else { if (! strstr ( $DNAsequence, "h3" )) { $DNAsequence = ""; } } if (isset ( $noAssoc ) && $noAssoc && ($sampletype == "specimen" || $sampletype == "unknown")) { $QueryForSpecimenTab = SingleRecordManager::parseABCD ( $xslspecimen, $abcdXML, $tripleid )[0]; $tmpTab=explode('
', $QueryForSpecimenTab); $QueryForSpecimenTab=$tmpTab[0]; try{ $Dataset='
'.$tmpTab[1]; } catch (Exception $e) { // $Dataset="827"; } } if ($noHeader) { $tmpH=SingleRecordManager::parseABCD ( $xslHeader, $abcdXML, $tripleid )[0]; echo "
" . $tmpH . "
"; $noHeader = false; $tmpTab=explode('
', $tmpH); try{$Dataset='
'.$tmpTab[1]; } catch (Exception $e) { // $Dataset="838"; } } echo '
'; echo '

'; echo '
'; echo '
'; $tabClass = "active"; if (strlen ( $DNAcontent ) > 1) { echo '
' . $DNAcontent . '
'; $tabClass = ""; } if (strlen ( $DNAsequence ) > 1) { echo '
' . $DNAsequence . '
'; $tabClass = ""; } if (strlen ( $QueryForTissueTab ) > 1) { echo '
' . $QueryForTissueTab . '
'; $tabClass = ""; } if (strlen ( $QueryForCultureTab ) > 1) { echo '
' . $QueryForCultureTab . '
'; $tabClass = ""; } if (strlen ( $QueryForEnviroTab ) > 1) { echo '
' . $QueryForEnviroTab . '
'; $tabClass = ""; } if (strlen ( $QueryForSpecimenTab ) > 1) { echo '
' . $QueryForSpecimenTab . '
'; $tabClass = ""; } if (strlen ( $QueryForSpecimenTab2 ) > 1) { echo '
' . $QueryForSpecimenTab2 . '
'; $tabClass = ""; } if (strlen ( $QueryForMultimediaTab ) > 1 && ! empty ( $QueryForMultimediaTab )) { echo '
' . $QueryForMultimediaTab . '
'; $tabClass = ""; } if (strlen ( $Dataset ) > 1 && ! empty ( $Dataset )) { echo '
' . $Dataset . '
'; $tabClass = ""; } if (! empty ( $annotations )) { echo '
'; $this->registerCssFile ( '/' . Yii::$app->params ['siteName'] . '/css/jquery.dataTables.css' ); echo ""; foreach ( $annotations as $annotation ) { $prefix = $annotation [0]; $url = $annotation [1]; $time = $annotation [2]; $annotator = $annotation [3]; $category = $annotation [4]; echo ""; } echo "
"; $tabClass = ""; } echo '
'; } if ($schemaurl == "http://rs.tdwg.org/dwc/") { $dom = new DOMDocument (); $folder = Yii::$app->params ['dwcArchivesPath'] . $basedirectory . "/default/smallArchive/"; $file = $folder . "meta.xml"; try { $dom->Load ( $file ); } catch ( Exception $e ) { echo "Could not find the archive under the location " . $file; } if( $filters ['unitID']!=$associatedUnitID) $out = SingleRecordManager::readDwCA ( $filters ['unitID'], $folder, $dom, $sampletype, $occurrenceFile ); if (! empty ( $out ["multimedia"] ) && strpos ( $QueryForMultimediaTab, $out ["multimedia"] ) === FALSE ) { $QueryForMultimediaTab = $QueryForMultimediaTab . $out ["multimedia"]; } if ($noHeader) { echo "
" . $out ['locality'] . "
"; $noHeader = false; } echo '
'; echo '

'; echo '
'; echo '
'; $tabClass = "active"; if (strlen ( $out ["dna"] ) > 1 && $sampletype == "DNA") { echo '
' . $out ["dna"] . "
"; $tabClass = ""; } if (strlen ( $out ["sequences"] ) > 1) { echo '
' . $out ["sequences"] . '
'; $tabClass = ""; } if (strlen ( $out ["tissue"] ) > 1 || (strlen ( $QueryForTissueTab ) > 1)) { if (strlen ( $out ["tissue"] ) > 1) echo '
' . $out ["tissue"] . '
'; // if (strlen ( $QueryForTissueTab ) > 1) // echo '
' . $QueryForTissueTab . '
'; $tabClass = ""; } if (strlen ( $out ["culture"] ) > 1 || (strlen ( $QueryForCultureTab ) > 1)) { if (strlen ( $out ["culture"] ) > 1) echo '
' . $out ["culture"] . '
'; // if (strlen ( $QueryForTissueTab ) > 1) // echo '
' . $QueryForCultureTab . '
'; $tabClass = ""; } if (strlen ( $out ["enviro"] ) > 1 || (strlen ( $QueryForEnviroTab ) > 1)) { if (strlen ( $out ["enviro"] ) > 1) echo '
' . $out ["enviro"] . '
'; // if (strlen ( $QueryForEnviroTab ) > 1) // echo '
' . $QueryForEnviroTab . '
'; $tabClass = ""; } if (strlen ( $out ["specimen"] ) > 1 || strlen ( $QueryForSpecimenTab ) > 1) { if (strlen ( $QueryForSpecimenTab ) > 1) echo '
' . $QueryForSpecimenTab . '
'; // if (strlen ( $out ["specimen"] ) > 1) // echo '
' . $out ["specimen"] . 'B
'; $tabClass = ""; } if (strlen ( $QueryForMultimediaTab ) > 1 && ! empty ( $QueryForMultimediaTab )) { echo '
' . $QueryForMultimediaTab . '
'; $tabClass = ""; } if (strlen ( $out ["dataset"] ) > 1 && ! empty ( $out ["dataset"] )) { echo '
' . $out ["dataset"] . '
'; $tabClass = ""; } if (! empty ( $annotations )) { echo '
'; $this->registerCssFile ( '/' . Yii::$app->params ['siteName'] . '/css/jquery.dataTables.css' ); echo ""; foreach ( $annotations as $annotation ) { $prefix = $annotation [0]; $url = $annotation [1]; $time = $annotation [2]; $annotator = $annotation [3]; $category = $annotation [4]; echo ""; } echo "
"; $tabClass = ""; } echo '
'; } // end if DwC-A } // end if isset(accesspoint) ?> params['displayMore']){ echo $this->render ( '/search/show/moreDNAtissue', [ "otherDNA" =>$otherDNA, "otherTissue" => $otherTissue ], true ); } ?> params['displayExternals']){ echo $this->render ( '/search/show/external', [ "GBIFs" =>$GBIFs, "NCBI" => $NCBI ], true ); } ?>