Project

General

Profile

« Previous | Next » 

Revision 5606901a

Added by Andreas Kohlbecker over 12 years ago

fixing #2679 (Improve Concept Relationships for Dataportal)

View differences:

5.x/modules/cdm_dataportal/cdm_api/cdm_api.module
701 701
      if(is_array($annotationPager->records)){
702 702
        $annotations = array();
703 703
        foreach($annotationPager->records as $annotation){
704
          if(!$includeTypes || !isset($annotation->annotationType) || !isset($annotation->annotationType->uuid) ||in_array($annotation->annotationType->uuid, $includeTypes)){
705
            $annotations[] = $annotation;
704
          if(!$includeTypes || !isset($annotation->annotationType->uuid)) {
705
            if(in_array($annotation->annotationType->uuid, $includeTypes) || ($annotation->annotationType === null && in_array('NULL_VALUE', $includeTypes))){
706
              $annotations[] = $annotation;
707
            }
706 708
          }
707 709
        }
708 710
        return $annotations;
5.x/modules/cdm_dataportal/settings.php
14 14
$annotationTypeKeys = array_keys( cdm_Vocabulary_as_option(UUID_ANNOTATION_TYPE) );
15 15
if(in_array(UUID_ANNOTATION_TYPE_TECHNICAL, $annotationTypeKeys)) {
16 16
  $annotationTypeKeys = array_flip($annotationTypeKeys);
17

  
17 18
  // technical annotation are off by default
18 19
  unset($annotationTypeKeys[UUID_ANNOTATION_TYPE_TECHNICAL]);
19 20
  $annotationTypeKeys = array_flip($annotationTypeKeys);
......
450 451
  );
451 452

  
452 453
  $annotationTypeOptions = cdm_Vocabulary_as_option(UUID_ANNOTATION_TYPE);
454
  // additional option for the null case
455
  $annotationTypeOptions['NULL_VALUE']=t('unset (null)');
453 456
  $form['gen_layout']['footnotes']['annotations_types_as_footnotes'] = array(
454 457
      '#type' => 'checkboxes',
455 458
      '#title' => t('Annotation types as footnotes'),
5.x/modules/cdm_dataportal/theme/cdm_dataportal.common.theme
161 161
  if (variable_get('cdm_dataportal_annotations_footnotes', CDM_DATAPORTAL_ALL_FOOTNOTES)){
162 162
    return '';
163 163
  }
164
  $footNoteKeys = cdm_annotations_as_footnotekeys($cdmBase, $footnote_list_key);
164
  $footNoteKeys = cdm_annotations_as_footnotekeys($cdmBase_list, $footnote_list_key);
165 165
  foreach($footNoteKeys as $a){
166 166
    //$out .=  theme('cdm_footnote_key', $a, $a->footnoteListKey, (isset($out)? ',' : ''));
167 167
    $out .=  theme('cdm_footnote_key', $a, (isset($out)? ',' : ''));
5.x/modules/cdm_dataportal/theme/cdm_dataportal.taxon.theme
90 90

  
91 91
          $name = $taxonRelation->fromTaxon->name->titleCache;
92 92

  
93
          $author_team = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $taxonRelation->fromTaxon->sec->uuid);
94
          $authorteam = $author_team->titleCache;
93
          $authorteam = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $taxonRelation->fromTaxon->sec->uuid);
94
          $authorteam = $authorteam->titleCache;
95 95

  
96 96
          if(!isset($misapplied[$name])){
97 97
            $misapplied[$name]['out'] =
......
106 106
            $joinedAuthorTeams[$authorteam] = 'sensu '.theme('cdm_reference', $taxonRelation->fromTaxon->sec);
107 107
          }
108 108

  
109
          } else {
110
            // all relationsship types but misapplied_name_for invalid_designation_for
111
             $taxonRelationshipsLines[] = cdm_taxonRelationship($taxonRelation, true, _is_invers_taxonRelationship($taxonRelation, $focusedTaxon));
112
          }
113
       }
109
        } else {
110
          // all relationsship types but misapplied_name_for invalid_designation_for
111
           $taxonRelationshipsLines[] = cdm_taxonRelationship($taxonRelation, true, _is_invers_taxonRelationship($taxonRelation, $focusedTaxon), true);
112
        }
113
     }
114 114
  }
115 115

  
116 116
  // sort the joinedAuthorTeams and create footnotes and footnotekeys
......
156 156
    $tr_footnotes_aux .= $element;
157 157
  }
158 158
  $out .= '<ul>' . $tr_footnotes_aux . '</ul>';
159
  //$out .= '</ul>';
159

  
160 160
  RenderHints::popFromRenderStack();
161 161
  return $out;
162 162
}
......
282 282
 * @param unknown_type $taxonRelationType
283 283
 * @param unknown_type $doLinkTaxon
284 284
 */
285
function cdm_taxonRelationship($taxonRelationship, $doLinkTaxon = false, $inverse = false){
285
function cdm_taxonRelationship($taxonRelationship, $doLinkTaxon = false, $inverse = false, $showSecReference = false){
286 286

  
287 287
  // validate object
288 288
  if( ! (isset($taxonRelationship->toTaxon) && isset($taxonRelationship->fromTaxon) && isset($taxonRelationship->type)) ) {
......
307 307
    $reltype_representation = $taxonRelationType->representation_L10n;
308 308
  }
309 309

  
310
  return cdm_related_taxon($toTaxon, null, $relsign, $reltype_representation, $doLinkTaxon);
310
  return cdm_related_taxon($toTaxon, null, $relsign, $reltype_representation, $doLinkTaxon, $showSecReference);
311 311
}
312 312

  
313 313
/**
......
320 320
* @param unknown_type $taxonRelationType
321 321
* @param unknown_type $doLinkTaxon
322 322
*/
323
function cdm_related_taxon($taxon, $reltype_uuid = null, $relsign = null, $reltype_representation = null, $doLinkTaxon = false){
323
function cdm_related_taxon($taxon, $reltype_uuid = null, $relsign = null, $reltype_representation = null, $doLinkTaxon = false, $showSecReference = false){
324 324

  
325 325
  static $relsign_homo = '≡';
326 326
  static $relsign_hetero = '=';
327 327
  static $relsign_invalid = '&ndash;';
328 328

  
329
  $footnoteListKey = 'taxonRelationships';
330

  
329 331
  $name_prefix = '';
330 332
  $name_postfix = '';
331 333

  
......
378 380
  }
379 381
  //printing the taxonName and the handling the special case of annotations
380 382
  $out_taxon_part = theme('cdm_taxonName', $taxon->name, $taxonUri, $referenceUri, true, false, $skiptags);
381
  $out_taxon_part .= theme('cdm_annotations_as_footnotekeys', array($taxon->name, $taxon) );
382
  $out_taxon_part .= ' sec. ' . theme('cdm_reference',  $taxon->sec);
383
  $out_taxon_part .= theme('cdm_annotations_as_footnotekeys', array($taxon->name, $taxon), $footnoteListKey);
384

  
385
  if($showSecReference) {
386
    $out_taxon_part .= ' sensu ' . theme('cdm_reference',  $taxon->sec);
387
  }
383 388

  
384 389

  
385 390
  //later homonym or trated as later homonym AND bloking names

Also available in: Unified diff