Project

General

Profile

« Previous | Next » 

Revision b427cd1f

Added by Katja Luther about 1 month ago

ref #10322: fix footnote order and continue deduplication

View differences:

modules/cdm_dataportal/includes/taxon.inc
327 327
                $sensu_reference_markup = $sensu_strings['markup'];
328 328
                $footnote_key = FootnoteManager::addNewFootnote($footnote_list_key, $sensu_reference_markup);
329 329
                $footnote_key = render_footnote_key($footnote_key);
330
                $joined_refs[$ref_key]['markup'] = '<span class="sensu">' . $sensu_strings['order_by_key'] . $footnote_key . '</span>';
330
                $joined_refs[$ref_key]['markup'] = '<span class="sensu">' . $sensu_strings['shortCitation'] . $footnote_key . '</span>';
331 331
           }
332 332
        }
333 333
    }
......
347 347
                foreach ($misapplied_name['sensu_uuids'] as $sensu_data) {
348 348
                    if($sensu_data['uuid']){
349 349
                        $joined_ref_key = $sensu_data['uuid'] . ($sensu_data['citation_detail'] ? '#' .  $sensu_data['citation_detail'] : '');
350
                        $sensu_refs_with_fkey[$sensu_data['prefix'] . $joined_refs[$joined_ref_key]['order_by_key']] = $sensu_data['prefix'] . $joined_refs[$joined_ref_key]['markup'];
350
                        $sensu_refs_with_fkey[$sensu_data['prefix'] . $joined_refs[$joined_ref_key]['shortCitation']] = $sensu_data['prefix'] . $joined_refs[$joined_ref_key]['markup'];
351 351
                    } else {
352 352
                        $sensu_refs_with_fkey[$sensu_data['prefix']] = $sensu_data['prefix'];
353 353
                    }
......
508 508
        if (isset_not_empty($taxon_relation->secSource) && isset_not_empty($taxon_relation->secSource->label[0])){
509 509
            $sensu_citation_long = $taxon_relation->secSource->label[0]->label;
510 510
        }
511
        $sensu_citation_short_markup = render_original_source($taxon_relation->secSource, FALSE);
511
        $sensu_citation_long_markup = render_original_source($taxon_relation->secSource, FALSE);
512 512
        $sensu_citation_short = cdm_tagged_text_to_string($sensu_tagged_text);
513
        //$sensu_citation_short = $taxon_relation->secSource->label;
513
        $sensu_citation_short_without_detail = cdm_tagged_text_to_string($sensu_tagged_text, array('secMicroReference'));
514 514
        $sensu_uuid = $sensu_tagged_text[0]->entityReference->uuid;
515 515
        $name_dedup_key = preg_replace('/\s+/', ' ', $name_dedup_key); // sanitize multiple whitespace characters
516 516
        $misapplied[$name_dedup_key]['sensu_uuids'][] = array('uuid' => $sensu_uuid, 'prefix' => $appended_phrase_text, 'citation_detail' => $sensu_citation_detail);
517 517
        $ref_key = $sensu_uuid . ($sensu_citation_detail ? '#' . $sensu_citation_detail : '');
518 518
        if (!isset($joined_refs[$ref_key])) {
519 519
            $joined_refs[$ref_key] = array(
520
                'order_by_key' => $sensu_citation_short,
521
                'markup' => $sensu_citation_short_markup,
520
                'order_by_key' => $sensu_citation_short_without_detail,
521
                'markup' => $sensu_citation_long_markup,
522
                'shortCitation' => $sensu_citation_short,
522 523
                'longCitation' => $sensu_citation_long// the footnote key will be appended later
523 524
            );
524 525
        }
......
531 532
    if (isset($relsec_tagged_text[1])) {
532 533
        $appended_phrase_text = array_shift($relsec_tagged_text)->text; // remove first element which contains the "err. sec", this will be added later in this code
533 534
        $relsec_citation_detail = trim(join(' ', cdm_tagged_text_values($relsec_tagged_text, array('secMicroReference'))));
534
        $relsec_citation_short_markup = render_original_source($taxon_relation->relSource, FALSE);
535
        $relsec_citation_long_markup = render_original_source($taxon_relation->relSource, FALSE);
535 536
        if (isset_not_empty($taxon_relation->relSource) && isset_not_empty($taxon_relation->relSource->label[0])){
536 537
            $relsec_citation_long = $taxon_relation->relSource->label[0]->label;
537 538
        }
538

  
539
        $relsec_citation_short_without_detail = cdm_tagged_text_to_string($relsec_tagged_text, array('secMicroReference'));
539 540
        $relsec_citation_short = cdm_tagged_text_to_string($relsec_tagged_text);
540 541
        $relsec_uuid = $relsec_tagged_text[0]->entityReference->uuid;
541 542
        $misapplied[$name_dedup_key]['relsec_uuids'][] = array('uuid' => $relsec_uuid, 'prefix' => $appended_phrase_text, 'citation_detail' => $relsec_citation_detail);;
542 543
        $ref_key = $relsec_uuid . ($relsec_citation_detail ? '#' . $relsec_citation_detail : '');
543 544
        if (!isset($joined_refs[$ref_key])) {
544

  
545 545
            $joined_refs[$ref_key] = array(
546
                'order_by_key' => $relsec_citation_short,
547
                'markup' => $relsec_citation_short_markup,
546
                'order_by_key' => $relsec_citation_short_without_detail,
547
                'markup' => $relsec_citation_long_markup,
548
                'shortCitation' => $relsec_citation_short,
548 549
                'longCitation' => $relsec_citation_long// the footnote key will be appended later
549 550
            );
550 551
        }

Also available in: Unified diff