Revision dfbc27b0
Added by Andreas Kohlbecker over 4 years ago
modules/cdm_dataportal/cdm_api/webservice_uris.php | ||
---|---|---|
20 | 20 |
define('CDM_WS_PORTAL_NAME_FINDBYNAME', 'name/findByName/'); |
21 | 21 |
define('CDM_WS_PORTAL_NAME_DESCRIPTIONS', 'portal/name/$0/taxonNameDescriptions'); |
22 | 22 |
define('CDM_WS_PORTAL_NAME_TYPEDESIGNATIONS', 'portal/name/$0/typeDesignations'); |
23 |
define('CDM_WS_PORTAL_NAME_TYPEDESIGNATIONS_IN_HOMOTYPICAL_GROUP', 'portal/name/$0/typeDesignationsInHomotypicalGroup'); |
|
23 | 24 |
define('CDM_WS_PORTAL_NAME_NAME_RELATIONS', 'portal/name/$0/nameRelations'); |
24 | 25 |
|
25 | 26 |
define('CDM_WS_NOMENCLATURALSTATUS', 'nomenclaturalStatus/$0'); |
modules/cdm_dataportal/includes/name.inc | ||
---|---|---|
1561 | 1561 |
* @return array |
1562 | 1562 |
* The type designations |
1563 | 1563 |
*/ |
1564 |
function type_designations_for_synonymy_group($synonymy_group, $accepted_taxon_name_uuid = null) { |
|
1565 |
$type_designations_map = array(); |
|
1566 |
|
|
1567 |
// 1. |
|
1568 |
foreach ($synonymy_group as $synonym) { |
|
1569 |
$type_designations_by_name = cdm_ws_get(CDM_WS_PORTAL_NAME_TYPEDESIGNATIONS, $synonym->name->uuid); |
|
1570 |
if ($type_designations_by_name) { |
|
1571 |
foreach ($type_designations_by_name as $td) { |
|
1572 |
if (!isset($type_designations_map[$td->uuid])) { |
|
1573 |
$type_designations_map[$td->uuid] = $td; |
|
1574 |
} |
|
1575 |
} |
|
1576 |
} |
|
1577 |
} |
|
1578 |
|
|
1579 |
if($accepted_taxon_name_uuid){ |
|
1580 |
$accepted_name_type_designations = cdm_ws_get(CDM_WS_PORTAL_NAME_TYPEDESIGNATIONS, $accepted_taxon_name_uuid); |
|
1581 |
if($accepted_name_type_designations && count($accepted_name_type_designations) > 0){ |
|
1582 |
foreach ($accepted_name_type_designations as $td){ |
|
1583 |
$type_designations_map[$td->uuid] = $td; |
|
1584 |
} |
|
1585 |
} |
|
1564 |
function type_designations_for_synonymy_group($synonymy_group, $accepted_taxon_name_uuid = null) |
|
1565 |
{ |
|
1566 |
if (count($synonymy_group) > 0) { |
|
1567 |
$synonym = array_pop($synonymy_group); |
|
1568 |
$type_designations = cdm_ws_get(CDM_WS_PORTAL_NAME_TYPEDESIGNATIONS_IN_HOMOTYPICAL_GROUP, $synonym->name->uuid); |
|
1586 | 1569 |
} |
1587 |
|
|
1588 |
if(count($type_designations_map) > 0){ |
|
1589 |
return array_values($type_designations_map); |
|
1590 |
} else { |
|
1591 |
return array(); |
|
1570 |
if($type_designations) { |
|
1571 |
return $type_designations; |
|
1592 | 1572 |
} |
1573 |
return array(); |
|
1593 | 1574 |
} |
1594 | 1575 |
|
1595 | 1576 |
|
Also available in: Unified diff
fix #8415 using /portal/name/{uuuid}/typeDesignationsInHomotypicalGroup service to speed up the type designation display