Project

General

Profile

« Previous | Next » 

Revision 59781fc6

Added by Katja Luther over 5 years ago

fix problems in pages.inc

View differences:

modules/cdm_dataportal/includes/pages.inc
57 57
        $ws_string .= "s";
58 58
    }
59 59

  
60
    $specimensOrObservations = cdm_ws_get(CDM_WS_TAXON, array( $taxon->uuid, $ws_string));
61

  
60
   // $specimensOrObservations = cdm_ws_get(CDM_WS_TAXON, array( $taxon->uuid, $ws_string));
61
    $pager = cdm_ws_get(CDM_WS_OCCURRENCE_BY_ASSOCIATEDTAXON,
62
        null,
63
        $by_associatedtaxon_query . '&taxonUuid=' . $taxon->uuid
64
    );
65
    $specimensOrObservations = array();
66
    if(isset($pager->records[0])){
67
        $specimensOrObservations =  $pager->records;
68
    }
62 69
     // cdm_ws_get(CDM_WS_OCCURRENCE_FIELDUNIT_DTO_BY_ASSOCIATEDTAXON,
63 70
     // null,
64 71
     // $by_associatedtaxon_query . '&taxonUuid=' . $taxon->uuid
......
83 90
    $specimensOrObservations = array_merge($type_specimens, $other_occurrences);
84 91

  
85 92
    // Collect media (fieldObjectMedia, derivedUnitMedia) and add as a custom field
86
     $occurrence->_fieldObjectMedia;
93

  
87 94
    foreach ($specimensOrObservations as &$occurrence) {
88 95
        $occurrence->_fieldObjectMedia = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array(
89 96
            $occurrence->uuid,
......
205 212
            foreach ($specimensOrObservations as $specimenOrObservation) {
206 213

  
207 214
                $mediaList = array();
208
                if (is_array($specimenOrObservation->listOfMedia)) {
209
                    $mediaList = array_merge($mediaList, $specimenOrObservation->listOfMedia);
215
                if (is_array($specimenOrObservation->_fieldObjectMedia)) {
216
                    $mediaList = array_merge($mediaList, $specimenOrObservation->_fieldObjectMedia);
210 217
                }
211
               if (is_array($specimenOrObservation->_derivedUnitMedia)) {
218
                if (is_array($specimenOrObservation->_derivedUnitMedia)) {
212 219
                    $mediaList = array_merge($mediaList, $specimenOrObservation->_derivedUnitMedia);
213 220
                }
214 221

  
222

  
215 223
                // typelabel will contain the typeStatus
216 224
                $type_label = '';
217 225
                $typeDesignationPager = cdm_ws_get(CDM_WS_OCCURRENCE . '/$0/specimenTypeDesignations', $specimenOrObservation->uuid);

Also available in: Unified diff