Project

General

Profile

Revision 46a93d1e

ID46a93d1e081d9dbf9480176c4dcb13fbd11cfd4a
Parent f02e26e1
Child afb1f504

Added by Andreas Kohlbecker about 2 months ago

ref #9222 adapting specimens and typedesignations to single sourced

View differences:

modules/cdm_dataportal/includes/name.inc
929 929
        $link_to_name_page = url(path_to_name($name_type_designation->typeName->uuid));
930 930
        $out .= '<'. $element_tag .' class="' . html_class_attribute_ref($name_type_designation) . '">' .  type_designation_status_label_markup($name_type_designation) ;
931 931

  
932
        if (!empty($name_type_designation->citation)) {
932
        if (!empty($name_type_designation->source->citation)) {
933 933
          $out .= type_designation_citation_layout($name_type_designation, $separator); // TODO type_designation_citation_layout() needs most probably to be replaced
934 934

  
935 935
        }
......
954 954
    foreach ($specimen_type_designations as $specimen_type_designation) {
955 955
      $type_citation_markup = '';
956 956

  
957
      if (!empty($specimen_type_designation->citation)) {
957
      if (!empty($specimen_type_designation->source->citation)) {
958 958

  
959
        $citation_footnote_str = cdm_reference_markup($specimen_type_designation->citation, null, false, true);
960
        $author_team = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $specimen_type_designation->citation->uuid);
959
        $citation_footnote_str = cdm_reference_markup($specimen_type_designation->source->citation, null, false, true);
960
        $author_team = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $specimen_type_designation->source->citation->uuid);
961 961

  
962 962
        if (!empty($author_team->titleCache)) {
963
          $year = @timePeriodToString($specimen_type_designation->citation->datePublished, true, 'YYYY');
963
          $year = @timePeriodToString($specimen_type_designation->source->citation->datePublished, true, 'YYYY');
964 964
          $authorteam_str = $author_team->titleCache . ($year ? ' ' : '') . $year;
965
          if ($authorteam_str == $specimen_type_designation->citation->titleCache) {
965
          if ($authorteam_str == $specimen_type_designation->source->citation->titleCache) {
966 966
            $citation_footnote_str = '';
967 967
          }
968 968
        } else {
......
985 985
        }
986 986

  
987 987
        $type_citation_markup .= '&nbsp;(' . t('designated by') . '&nbsp;<span class="typeReference">' . $authorteam_str . '</span>';
988
        if (!empty($specimen_type_designation->citationMicroReference)) {
989
          $type_citation_markup .= ': ' . trim($specimen_type_designation->citationMicroReference);
988
        if (!empty($specimen_type_designation->source->citationMicroReference)) {
989
          $type_citation_markup .= ': ' . trim($specimen_type_designation->source->citationMicroReference);
990 990
        }
991 991
        $type_citation_markup .= $footnote_key_markup . ')';
992 992

  
......
1909 1909
 */
1910 1910
function type_designation_citation_layout($typeDesignation, $footnote_separator = ',') {
1911 1911
  $res = '';
1912
  $citation = $typeDesignation->citation;
1913
  $pages = $typeDesignation->citationMicroReference;
1912
  $citation = $typeDesignation->source->citation;
1913
  $pages = $typeDesignation->source->citationMicroReference;
1914 1914
  if(isset($typeDesignation->typeStatus->uuid) && isset($typeDesignation->typeStatus->representation_L10n)) {
1915 1915
    if ( $typeDesignation->typeStatus->uuid == UUID_NTD_ORIGINAL_DESIGNATION || $typeDesignation->typeStatus->uuid == UUID_NTD_MONOTYPY) {
1916 1916
      $res = ' (' . $typeDesignation->typeStatus->representation_L10n . ')';
......
1930 1930

  
1931 1931
    // footnotes should be rendered in the parent element so we
1932 1932
    // are relying on the FootnoteListKey set there
1933
    $fkey_typeDesignation = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $typeDesignation->citation->titleCache);
1933
    $fkey_typeDesignation = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $citation->titleCache);
1934 1934
    $res .= render_footnote_key($fkey_typeDesignation, $footnote_separator,TRUE) . ')';
1935 1935
  }
1936 1936
  return $res;
modules/cdm_dataportal/includes/pages.inc
38 38
    RenderHints::pushToRenderStack('taxon_page_specimens');
39 39

  
40 40
    $fieldUnitDTOs = null;
41
    $specimensOrObservations = null;
41
    $specimensOrObservations = array();
42 42
    if (variable_get(CDM_SPECIMEN_LIST_VIEW_MODE, CDM_SPECIMEN_LIST_VIEW_MODE_DEFAULT) == CDM_SPECIMEN_LIST_VIEW_MODE_OPTION_DERIVATE_TREE){
43 43
      // get fieldUnitDTOs
44 44
      $fieldUnitDTOs = cdm_ws_get(CDM_WS_TAXON_FIELDUNIT_DTOS, array( $taxon->uuid));
......
56 56
        null,
57 57
        $by_associatedtaxon_query . '&taxonUuid=' . $taxon->uuid
58 58
      );
59
      $specimensOrObservations = array();
60 59
      if (isset($pager->records[0])) {
61 60
        $specimensOrObservations = $pager->records;
62 61
      }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)