Project

General

Profile

« Previous | Next » 

Revision 3049fdcd

Added by Andreas Kohlbecker almost 4 years ago

ref #9102 convering both cases for taxon in current classification test: TaxonNode and TaxonNodeDto

View differences:

modules/cdm_dataportal/cdm_dataportal.module
2703 2703
 */
2704 2704
function _cdm_dataportal_acceptedByCurrentView($taxon) {
2705 2705

  
2706
  $defaultTreeUuid = get_current_classification_uuid();
2706
  $default_classification_uuid = get_current_classification_uuid();
2707 2707

  
2708 2708
  if (isset($taxon->taxonNodes)) {
2709
    $taxonNodes = $taxon->taxonNodes;
2709
    $taxon_nodes = $taxon->taxonNodes;
2710 2710
  }
2711 2711
  else {
2712
    $taxonNodes = cdm_ws_get(CDM_WS_PORTAL_TAXON_TAXONNODES, $taxon->uuid);
2712
    $taxon_nodes = cdm_ws_get(CDM_WS_PORTAL_TAXON_TAXONNODES, $taxon->uuid);
2713 2713
  }
2714 2714

  
2715
  if ($taxon->class == "Taxon" && isset($taxonNodes)) {
2716
    foreach ($taxonNodes as $node) {
2717
      if (isset($node->classificationUUID)){
2718
        if ($node->classificationUUID == $defaultTreeUuid) {
2719
          return TRUE;
2720
        }
2721
      }
2722
      else {
2723
        if ($node->classification == $defaultTreeUuid) {
2724
          return TRUE;
2725
        }
2715
  if ($taxon->class == "Taxon" && isset($taxon_nodes)) {
2716
    foreach ($taxon_nodes as $node) {
2717
      if($node->class == 'TaxonNodeDto' && isset($node->classificationUUID)){
2718
        // case of TaxonNodeDto
2719
        return $node->classificationUUID == $default_classification_uuid;
2720
      } else if($node->class == 'TaxonNode' && isset($node->classification->uuid)) {
2721
         return $node->classification->uuid == $default_classification_uuid;
2726 2722
      }
2727 2723
    }
2728 2724
  }
2729

  
2730 2725
  return FALSE;
2731 2726
}
2732 2727

  

Also available in: Unified diff