Project

General

Profile

« Previous | Next » 

Revision 791e1c94

Added by Andreas Kohlbecker over 10 years ago

fixing #2877 (microreference not shown in distribution references (sources))

View differences:

5.x/modules/cdm_dataportal/cdm_api/cdm_api.module
713 713
    }
714 714
}
715 715

  
716
/**
717
 * returns the NomenclaturalReference string with correctly placed microreference (= reference detail) e.g. in Phytotaxa 43: 1-48. 2012
718
 * @param unknown_type $referenceUuid
719
 * @param unknown_type $microreference
720
 * @return string
721
 */
722
function cdm_ws_getNomenclaturalReference($referenceUuid, $microreference){
723

  
724
  $obj = cdm_ws_get(CDM_WS_NOMENCLATURAL_REFERENCE_CITATION, array($referenceUuid), "microReference=".urlencode($microreference));
725
  if($obj){
726
    return $obj->String;
727
  } else {
728
    return null;
729
  }
730
}
731

  
732

  
716 733
function _mergeFeatureTreeDescriptions($featureNodes, $descriptionElements){
717 734

  
718 735
  foreach($featureNodes as &$node){
5.x/modules/cdm_dataportal/theme/cdm_dataportal.name.theme
591 591
			if(isset($renderTemplate['referencePart']['microreference'])){
592 592
				$microreference = $taxonName->nomenclaturalMicroReference;
593 593
			}
594
			$citation = cdm_ws_get(CDM_WS_NOMENCLATURAL_REFERENCE_CITATION, array($taxonName->nomenclaturalReference->uuid), "microReference=".urlencode($microreference));
595
			$citation = $citation->String;
594
			$citation = cdm_ws_getNomenclaturalReference($taxonName->nomenclaturalReference->uuid, $microreference);
596 595
			// find preceding element of the refrence
597 596
			$precedingKey = get_preceding_contentElementKey('reference', $renderTemplate);
598 597
			if(str_beginsWith($citation, ", in")){
5.x/modules/cdm_dataportal/theme/cdm_dataportal.references.theme
46 46
  	$citation = $reference->titleCache;
47 47
  }
48 48

  
49

  
49 50
  if($doLink){
50 51
  	$out = l('<span class="reference">'.$citation.'</span>'
51 52
          , path_to_reference($reference->uuid)
......
55 56
  	$out = '<span class="reference">'.$citation.'</span>';
56 57
  }
57 58

  
58
  //FIXME use microreference webservice instead
59
  if(!empty($descriptionElementSource->citationMicroReference)){
60
      $out .= ': '. $descriptionElementSource->citationMicroReference;
59
  if(!empty($microReference)){
60
      $out .= ": " . $microReference;
61 61
  }
62 62

  
63 63
  return $out;

Also available in: Unified diff