Revision a584de6a
Added by Andreas Kohlbecker over 3 years ago
modules/cdm_dataportal/includes/name.inc | ||
---|---|---|
641 | 641 |
$last_footnote_listkey = RenderHints::setFootnoteListKey("nomenclatural_act"); |
642 | 642 |
// name |
643 | 643 |
$name_relations = null; |
644 |
if($registration_dto->nameRef){ |
|
644 |
if(isset($registration_dto->nameRef) && $registration_dto->nameRef){
|
|
645 | 645 |
$name = cdm_ws_get(CDM_WS_PORTAL_NAME, $registration_dto->nameRef->uuid); |
646 | 646 |
cdm_load_tagged_full_title($name); |
647 | 647 |
$render_array['nomenclatural_act']['published_name'] = markup_to_render_array('<div class="published-name">' . render_taxon_or_name($name, url(path_to_name($name->uuid))) . '</div>', 0); |
... | ... | |
868 | 868 |
if(isset($registration->identifier) && $registration->status == 'PUBLISHED'){ |
869 | 869 |
$office_class_attribute = ''; |
870 | 870 |
if(isset($registration->institution->titleCache)){ |
871 |
$office_class_attribute = registration_intitute_class_attribute($registration);
|
|
871 |
$office_class_attribute = registration_institution_class_attribute($registration);
|
|
872 | 872 |
} |
873 | 873 |
$markup = "<span class=\"registration $office_class_attribute\">" . render_link_to_registration($registration->identifier) . ', ' |
874 | 874 |
. preg_replace('/^([^T]*)(.*)$/', '${1}', $registration->registrationDate) |
... | ... | |
881 | 881 |
* @param $registration |
882 | 882 |
* @return string |
883 | 883 |
*/ |
884 |
function registration_intitute_class_attribute($registration_dto)
|
|
884 |
function registration_institution_class_attribute($registration_dto)
|
|
885 | 885 |
{ |
886 | 886 |
if(isset($registration_dto->institutionTitleCache)){ |
887 | 887 |
$institutionTitleCache = $registration_dto->institutionTitleCache; |
... | ... | |
1081 | 1081 |
return $out; |
1082 | 1082 |
} |
1083 | 1083 |
|
1084 |
/** |
|
1085 |
* Creates markup for a list of SpecimenTypedesignationDTO |
|
1086 |
* |
|
1087 |
* @param array $specimen_typedesignation_dtos |
|
1088 |
* The SpecimenTypedesignationDTOs to be rendered |
|
1089 |
* |
|
1090 |
* @return string |
|
1091 |
* The markup. |
|
1092 |
*/ |
|
1093 |
function render_specimen_typedesignation_dto($specimen_typedesignation_dtos, $enclosing_tag = 'ul', $element_tag = 'li', $link_to_specimen_page = true){ |
|
1094 |
|
|
1095 |
// need to add element to render path since type designations |
|
1096 |
// need other name render template |
|
1097 |
RenderHints::pushToRenderStack('typedesignations'); |
|
1098 |
|
|
1099 |
$out = '<' . $enclosing_tag .' class="typeDesignations">'; |
|
1100 |
$separator = ','; |
|
1101 |
|
|
1102 |
if (!empty($specimen_typedesignation_dtos)) { |
|
1103 |
// usort($specimen_type_designations, "compare_specimen_type_designation"); // FIXME create compare function for SpecimenTypedesignationDTO |
|
1104 |
foreach ($specimen_typedesignation_dtos as $std_dto) { |
|
1105 |
$type_citation_markup = ''; |
|
1106 |
|
|
1107 |
if (!empty($std_dto->source->citation)) { |
|
1108 |
|
|
1109 |
$citation_footnote_str = cdm_reference_markup($std_dto->source->citation, null, false, true); |
|
1110 |
$author_team = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $std_dto->source->citation->uuid); |
|
1111 |
|
|
1112 |
if (!empty($author_team->titleCache)) { |
|
1113 |
$year = @timePeriodToString($std_dto->source->citation->datePublished, true, 'YYYY'); |
|
1114 |
$authorteam_str = $author_team->titleCache . ($year ? ' ' : '') . $year; |
|
1115 |
if ($authorteam_str == $std_dto->source->citation->titleCache) { |
|
1116 |
$citation_footnote_str = ''; |
|
1117 |
} |
|
1118 |
} else { |
|
1119 |
$authorteam_str = $citation_footnote_str; |
|
1120 |
// no need for a footnote in case in case it is used as replacement for missing author teams |
|
1121 |
$citation_footnote_str = ''; |
|
1122 |
} |
|
1123 |
|
|
1124 |
// for being registered a typedesignation MUST HAVE a citation, so it is save to handle the |
|
1125 |
// Registration output in the conditional block which has been checked that the citation is present |
|
1126 |
$registration_markup = render_registrations($std_dto->registrations); |
|
1127 |
$citation_footnote_str .= ($citation_footnote_str ? ' ' : '') . $registration_markup; |
|
1128 |
|
|
1129 |
$footnote_key_markup = ''; |
|
1130 |
if ($citation_footnote_str) { |
|
1131 |
// footnotes should be rendered in the parent element so we |
|
1132 |
// are relying on the FootnoteListKey set there |
|
1133 |
$_fkey2 = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $citation_footnote_str); |
|
1134 |
$footnote_key_markup = render_footnote_key($_fkey2, $separator, TRUE); |
|
1135 |
} |
|
1136 |
|
|
1137 |
$type_citation_markup .= ' (' . t('designated by') . ' <span class="typeReference">' . $authorteam_str . '</span>'; |
|
1138 |
if (!empty($std_dto->source->citationMicroReference)) { |
|
1139 |
$type_citation_markup .= ': ' . trim($std_dto->source->citationMicroReference); |
|
1140 |
} |
|
1141 |
$type_citation_markup .= $footnote_key_markup . ')'; |
|
1142 |
} |
|
1143 |
|
|
1144 |
$out .= '<'. $element_tag .' class="' . html_class_attribute_ref($std_dto) . '">'; |
|
1145 |
$out .= type_designation_dto_status_label_markup($std_dto) . $type_citation_markup; |
|
1146 |
|
|
1147 |
$derivedUnitFacadeInstance = null; |
|
1148 |
if (isset($std_dto->typeSpecimen)) { |
|
1149 |
$derivedUnitFacadeInstance = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, $std_dto->typeSpecimen->uuid); |
|
1150 |
} |
|
1151 |
|
|
1152 |
if (!empty($derivedUnitFacadeInstance->titleCache)) { |
|
1153 |
$specimen_markup = $derivedUnitFacadeInstance->titleCache; |
|
1154 |
if($link_to_specimen_page && isset($derivedUnitFacadeInstance->specimenLabel) && $derivedUnitFacadeInstance->specimenLabel){ |
|
1155 |
$specimen_markup = str_replace($derivedUnitFacadeInstance->specimenLabel, l($derivedUnitFacadeInstance->specimenLabel, path_to_specimen($std_dto->typeSpecimen->uuid)), $specimen_markup); |
|
1156 |
} |
|
1157 |
RenderHints::setAnnotationsAndSourceConfig(annotations_and_sources_config_typedesignations()); |
|
1158 |
$annotations_and_sources = handle_annotations_and_sources($derivedUnitFacadeInstance); |
|
1159 |
$out .= ': <span class="' . html_class_attribute_ref($std_dto->typeSpecimen) . '">' |
|
1160 |
. $specimen_markup |
|
1161 |
. '</span>'; // . ': ' . theme('cdm_specimen', array('specimenTypeDesignation' => $derivedUnitFacadeInstance)); |
|
1162 |
if(!empty($derivedUnitFacadeInstance->preferredStableUri)){ |
|
1163 |
$out .= ' ' . l($derivedUnitFacadeInstance->preferredStableUri, $derivedUnitFacadeInstance->preferredStableUri, array('absolute' => true)); |
|
1164 |
} |
|
1165 |
$out .= $annotations_and_sources->footNoteKeysMarkup(); |
|
1166 |
} |
|
1167 |
$out .= '</'. $element_tag .'>'; |
|
1168 |
} |
|
1169 |
} |
|
1170 |
return $out; |
|
1171 |
} |
|
1172 |
|
|
1084 | 1173 |
|
1085 | 1174 |
/** |
1086 | 1175 |
* Composes the textual representation for the type designation of taxon name identified by the uuid in with a map for the location data. |
... | ... | |
1748 | 1837 |
* in the $synonymy_group and must therefor passed in this second parameter. |
1749 | 1838 |
* |
1750 | 1839 |
* @return array |
1751 |
* The type designations
|
|
1840 |
* The CDM TypeDesignation entities
|
|
1752 | 1841 |
*/ |
1753 | 1842 |
function type_designations_for_synonymy_group($synonymy_group, $accepted_taxon_name_uuid = null) |
1754 | 1843 |
{ |
... | ... | |
1954 | 2043 |
. ((isset($type_designation->typeStatus->representation_L10n)) ? ucfirst($type_designation->typeStatus->representation_L10n) : t('Type')) . '</span>' |
1955 | 2044 |
; |
1956 | 2045 |
} |
2046 |
|
|
2047 |
/** |
|
2048 |
* Creates markup for the status of a type designation DTO. |
|
2049 |
* In case the status or its representation is missing the label will be set to "Type" |
|
2050 |
* |
|
2051 |
* @param $type_designation |
|
2052 |
* @return string |
|
2053 |
*/ |
|
2054 |
function type_designation_dto_status_label_markup($type_designation) |
|
2055 |
{ |
|
2056 |
return '<span class="type-status">' |
|
2057 |
. ((isset($type_designation->typeStatus_L10n)) ? ucfirst($type_designation->typeStatus_L10n) : t('Type')) . '</span>' |
|
2058 |
; |
|
2059 |
} |
modules/cdm_dataportal/includes/occurrences.inc | ||
---|---|---|
376 | 376 |
if (isset($specimen_or_observation->specimenTypeDesignations)) { |
377 | 377 |
$type_status = array(); |
378 | 378 |
foreach ($specimen_or_observation->specimenTypeDesignations as $typeDesignation) { |
379 |
if (isset($typeDesignation->typeStatus->representation_L10n)) {
|
|
380 |
$type_status[] = $typeDesignation->typeStatus->representation_L10n;
|
|
379 |
if (isset($typeDesignation->typeStatus_L10n)) { |
|
380 |
$type_status[] = $typeDesignation->typeStatus_L10n; |
|
381 | 381 |
} |
382 | 382 |
} |
383 | 383 |
if (count($type_status) > 0) { |
... | ... | |
980 | 980 |
} |
981 | 981 |
|
982 | 982 |
/** |
983 |
* Crates an array which can be used in render arrays to be passed to the |
|
984 |
* theme_table() and theme_list(). |
|
983 |
* Creates render array items for FieldUnitDTO or DerivateDTO. |
|
985 | 984 |
* |
986 | 985 |
* @param array $fieldunit_dtos |
987 | 986 |
* list of FieldUnitDTOs |
987 |
* @return array |
|
988 |
* An array which can be used in render arrays to be passed to the |
|
989 |
* theme_table() and theme_list(). |
|
988 | 990 |
*/ |
989 | 991 |
function specimen_render_array_items(array $fieldunit_dtos){ |
990 | 992 |
|
... | ... | |
993 | 995 |
|
994 | 996 |
//we need one more item to contain the items of one level (fieldunit, derivate data etc.) |
995 | 997 |
foreach ($fieldunit_dtos as &$fieldunit_dto) { |
996 |
|
|
997 | 998 |
$items['data'] = $fieldunit_dto->listLabel ; |
998 | 999 |
$specimen = compose_cdm_specimen_or_observation_tree_entry($fieldunit_dto); |
999 | 1000 |
$children = array(); |
... | ... | |
1247 | 1248 |
|
1248 | 1249 |
|
1249 | 1250 |
/** |
1250 |
* Compose an render array from a CDM DerivedUnitFacade object.
|
|
1251 |
* Renders a FieldUnitDTO or DerivateDTO
|
|
1251 | 1252 |
* |
1252 |
* compose_hook() implementation |
|
1253 |
* |
|
1254 |
* @param object $specimenOrObservation |
|
1255 |
* the CDM instance of type SpecimenOrObservation to compose |
|
1253 |
* @param object $specimen_or_observation_dto |
|
1254 |
* A FieldUnitDTO or DerivateDTO object |
|
1256 | 1255 |
* the render array for |
1257 |
* @param array $derivatives |
|
1258 |
* the render array which contains the compositions of the derivatives |
|
1259 |
* of the supplied $specimenOrObservation |
|
1260 | 1256 |
* |
1261 |
* @return array |
|
1262 |
* the supplied render array $derivatives to which the composition of the supplied |
|
1257 |
* @return string |
|
1258 |
* the supplied render array $derivatives to which the composition of the |
|
1259 |
* supplied |
|
1263 | 1260 |
* $specimenOrObservation has been added to |
1264 | 1261 |
* |
1265 | 1262 |
* @ingroup compose |
1263 |
* |
|
1264 |
* @throws \Exception |
|
1266 | 1265 |
*/ |
1267 |
|
|
1268 |
function compose_cdm_specimen_or_observation_tree_entry($specimen_or_observation) |
|
1269 |
{ |
|
1266 |
function compose_cdm_specimen_or_observation_tree_entry($specimen_or_observation_dto) { |
|
1270 | 1267 |
$exclude_occurrence_fields = &drupal_static(__FUNCTION__); |
1271 | 1268 |
if (!isset($exclude_occurrence_fields)) { |
1272 | 1269 |
$exclude_occurrence_fields = array( |
... | ... | |
1282 | 1279 |
'collection' |
1283 | 1280 |
); |
1284 | 1281 |
} |
1285 |
$items = array(); |
|
1286 | 1282 |
|
1287 | 1283 |
// only show uuid it the user is logged in |
1288 | 1284 |
if (user_is_logged_in() && ($a_idx = array_search('uuid', $exclude_occurrence_fields)) !== FALSE) { |
1289 | 1285 |
// unset($exclude_occurrence_fields[$a_idx]); |
1290 | 1286 |
} |
1291 | 1287 |
|
1288 |
if (is_object($specimen_or_observation_dto)) { |
|
1292 | 1289 |
|
1293 |
if (is_object($specimen_or_observation)) { |
|
1294 |
|
|
1295 |
$type_label = $specimen_or_observation->recordBase; |
|
1296 |
RenderHints::setFootnoteListKey($type_label . '-' . $specimen_or_observation->uuid); |
|
1290 |
$type_label = $specimen_or_observation_dto->recordBase; |
|
1291 |
RenderHints::setFootnoteListKey($type_label . '-' . $specimen_or_observation_dto->uuid); |
|
1297 | 1292 |
|
1298 | 1293 |
// collect typeStatus as label |
1299 |
if (isset($specimen_or_observation->specimenTypeDesignations)) { |
|
1294 |
if (isset($specimen_or_observation_dto->specimenTypeDesignations)) {
|
|
1300 | 1295 |
$type_status = array(); |
1301 |
foreach ($specimen_or_observation->specimenTypeDesignations as $typeDesignation) { |
|
1302 |
if (isset($typeDesignation->typeStatus->representation_L10n)) {
|
|
1303 |
$type_status[] = $typeDesignation->typeStatus->representation_L10n;
|
|
1296 |
foreach ($specimen_or_observation_dto->specimenTypeDesignations as $typeDesignation) {
|
|
1297 |
if (isset($typeDesignation->typeStatus_L10n)) { |
|
1298 |
$type_status[] = $typeDesignation->typeStatus_L10n; |
|
1304 | 1299 |
} |
1305 | 1300 |
} |
1306 | 1301 |
if (count($type_status) > 0) { |
... | ... | |
1314 | 1309 |
$title = $type_label; |
1315 | 1310 |
} |
1316 | 1311 |
|
1317 |
$items['data'] = $title; |
|
1318 |
|
|
1319 | 1312 |
$groups = array(); |
1320 |
$items['children'] = $groups; |
|
1321 | 1313 |
$children_items = array(); |
1322 | 1314 |
// --- add initialized fields |
1323 |
foreach (get_object_vars($specimen_or_observation) as $field => $value) { |
|
1315 |
foreach (get_object_vars($specimen_or_observation_dto) as $field => $value) {
|
|
1324 | 1316 |
$child_item = array(); |
1325 | 1317 |
|
1326 | 1318 |
if (!in_array($field, $exclude_occurrence_fields) && ($value && (!is_object($value) || isset($value->class)))) { |
... | ... | |
1344 | 1336 |
$groups, |
1345 | 1337 |
cdm_occurrence_field_name_label($field), |
1346 | 1338 |
array( |
1347 |
'#markup' => render_type_designations($value),
|
|
1339 |
'#markup' => render_specimen_typedesignation_dto($value),
|
|
1348 | 1340 |
) |
1349 | 1341 |
); |
1350 | 1342 |
break; |
1351 | 1343 |
|
1352 |
|
|
1353 |
|
|
1354 | 1344 |
case 'listOfMedia': |
1355 | 1345 |
$gallery_settings = getGallerySettings(CDM_DATAPORTAL_SPECIMEN_GALLERY_NAME); |
1356 | 1346 |
|
... | ... | |
1360 | 1350 |
); |
1361 | 1351 |
$gallery_html = compose_cdm_media_gallerie(array( |
1362 | 1352 |
'mediaList' => $value, |
1363 |
'galleryName' => $specimen_or_observation->uuid, |
|
1353 |
'galleryName' => $specimen_or_observation_dto->uuid,
|
|
1364 | 1354 |
'maxExtend' => $gallery_settings['cdm_dataportal_media_maxextend'], |
1365 | 1355 |
'cols' => $gallery_settings['cdm_dataportal_media_cols'], |
1366 | 1356 |
'maxRows' => isset($gallery_settings['cdm_dataportal_media_maxRows']) ? isset($gallery_settings['cdm_dataportal_media_maxRows']) : null, |
... | ... | |
1374 | 1364 |
//@_description_list_group_add($groups, cdm_occurrence_field_name_label($field), $gallery_html); |
1375 | 1365 |
break; |
1376 | 1366 |
|
1377 |
|
|
1378 |
|
|
1379 | 1367 |
/* ---- DerivedUnitBase --- */ |
1380 | 1368 |
|
1381 |
|
|
1382 | 1369 |
case 'collectionDTO': |
1383 | 1370 |
|
1384 | 1371 |
$sub_dl_groups = array(); |
... | ... | |
1395 | 1382 |
array('#theme' => 'description_list', '#groups' => $sub_dl_groups) |
1396 | 1383 |
) |
1397 | 1384 |
); |
1398 |
|
|
1399 | 1385 |
break; |
1400 | 1386 |
|
1401 |
|
|
1402 |
|
|
1403 |
|
|
1404 | 1387 |
/* ---- Specimen --- */ |
1405 | 1388 |
case 'sequences': |
1406 | 1389 |
$dd_elements = array(); |
... | ... | |
1414 | 1397 |
// TODO preservation |
1415 | 1398 |
// TODO exsiccatum |
1416 | 1399 |
|
1417 |
|
|
1418 | 1400 |
/* ---- FieldObservation --- */ |
1419 | 1401 |
case 'gatheringEvent': |
1420 | 1402 |
|
... | ... | |
1470 | 1452 |
); |
1471 | 1453 |
} |
1472 | 1454 |
} |
1473 |
|
|
1474 | 1455 |
break; |
1475 | 1456 |
|
1476 | 1457 |
/* ---- DerivationEvent --- */ |
... | ... | |
1491 | 1472 |
@_description_list_group_add($groups, cdm_occurrence_field_name_label("Identification(s)"), $dd_elements,'', 100); |
1492 | 1473 |
break; |
1493 | 1474 |
|
1494 |
|
|
1495 | 1475 |
default: |
1496 | 1476 |
if (is_object($value) || is_array($value)) { |
1497 | 1477 |
drupal_set_message("Unhandled type in compose_cdm_specimenOrObservation() for field " . $field, "warning"); |
... | ... | |
1512 | 1492 |
// '#title' => $title, |
1513 | 1493 |
'#theme' => 'description_list', |
1514 | 1494 |
'#groups' => $groups, |
1515 |
'#attributes' => array('class' => html_class_attribute_ref($specimen_or_observation)), |
|
1495 |
'#attributes' => array('class' => html_class_attribute_ref($specimen_or_observation_dto)),
|
|
1516 | 1496 |
); |
1517 | 1497 |
$output = drupal_render($occurrence_elements); |
1518 | 1498 |
if (isset($gallery_html)){ |
1519 | 1499 |
$output .= $gallery_html; |
1520 | 1500 |
} |
1521 |
$pathToSpecimen = path_to_specimen($specimen_or_observation->uuid); |
|
1501 |
$pathToSpecimen = path_to_specimen($specimen_or_observation_dto->uuid);
|
|
1522 | 1502 |
$output .= l("Detail page", $pathToSpecimen); |
1523 | 1503 |
} // END of $specimenOrObservation exists |
1524 | 1504 |
|
... | ... | |
1763 | 1743 |
/** |
1764 | 1744 |
* Orders occurrences by date but types should be on top of the list. |
1765 | 1745 |
* |
1766 |
* @param $specimensOrObservations_or_fieldUnitDTO |
|
1746 |
* @param array $specimens_or_observations |
|
1747 |
* Array of SpecimenOrObservation or fieldUnitDTOs |
|
1767 | 1748 |
* |
1768 | 1749 |
* @return array |
1769 | 1750 |
*/ |
1770 |
function order_specimens_or_observations_by_date_and_type($specimensOrObservations)
|
|
1751 |
function order_specimens_or_observations_by_date_and_type($specimens_or_observations)
|
|
1771 | 1752 |
{ |
1772 | 1753 |
// order occurrences by date but types should be on top of the list |
1773 | 1754 |
$type_specimens = array(); |
1774 | 1755 |
$other_occurrences = array(); |
1775 |
foreach ($specimensOrObservations as &$occurrence) { |
|
1776 |
$typeDesignationsPager = cdm_ws_get(CDM_WS_OCCURRENCE . '/$0/specimenTypeDesignations', $occurrence->uuid); |
|
1777 |
if (isset($typeDesignationsPager->count) && $typeDesignationsPager->count > 0) { |
|
1778 |
$type_specimens[] = $occurrence; |
|
1779 |
} else { |
|
1780 |
$other_occurrences[] = $occurrence; |
|
1756 |
if(is_array($specimens_or_observations)){ |
|
1757 |
foreach ($specimens_or_observations as &$occurrence) { |
|
1758 |
$typeDesignationsPager = cdm_ws_get(CDM_WS_OCCURRENCE . '/$0/specimenTypeDesignations', $occurrence->uuid); |
|
1759 |
if (isset($typeDesignationsPager->count) && $typeDesignationsPager->count > 0) { |
|
1760 |
$type_specimens[] = $occurrence; |
|
1761 |
} else { |
|
1762 |
$other_occurrences[] = $occurrence; |
|
1763 |
} |
|
1781 | 1764 |
} |
1782 | 1765 |
} |
1783 |
$specimensOrObservations = array_merge($type_specimens, $other_occurrences);
|
|
1784 |
return $specimensOrObservations;
|
|
1766 |
$specimens_or_observations = array_merge($type_specimens, $other_occurrences);
|
|
1767 |
return $specimens_or_observations;
|
|
1785 | 1768 |
} |
1786 | 1769 |
|
1787 | 1770 |
/** |
... | ... | |
1789 | 1772 |
* |
1790 | 1773 |
* Delegates internally to order_specimens_or_observations_by_date_and_type() |
1791 | 1774 |
* |
1792 |
* @param $fieldUnitDTOs |
|
1775 |
* @param array $fieldUnitDTOs
|
|
1793 | 1776 |
* |
1794 | 1777 |
* @return array |
1795 | 1778 |
*/ |
modules/cdm_dataportal/includes/pages.inc | ||
---|---|---|
37 | 37 |
$render_array = array(); |
38 | 38 |
RenderHints::pushToRenderStack('taxon_page_specimens'); |
39 | 39 |
|
40 |
$fieldUnitDTOs = null; |
|
41 |
$specimensOrObservations = array(); |
|
42 |
if (variable_get(CDM_SPECIMEN_LIST_VIEW_MODE, CDM_SPECIMEN_LIST_VIEW_MODE_DEFAULT) == CDM_SPECIMEN_LIST_VIEW_MODE_OPTION_DERIVATE_TREE){ |
|
40 |
$fieldUnitDTOs = null; |
|
41 |
$specimensOrObservations = array(); |
|
42 |
$current_view_mode = variable_get(CDM_SPECIMEN_LIST_VIEW_MODE, CDM_SPECIMEN_LIST_VIEW_MODE_DEFAULT); |
|
43 |
if ($current_view_mode == CDM_SPECIMEN_LIST_VIEW_MODE_OPTION_DERIVATE_TABLE || $current_view_mode == CDM_SPECIMEN_LIST_VIEW_MODE_OPTION_DERIVATE_TREE){ |
|
43 | 44 |
// get fieldUnitDTOs |
44 | 45 |
$fieldUnitDTOs = cdm_ws_get(CDM_WS_TAXON_FIELDUNIT_DTOS, array( $taxon->uuid)); |
45 | 46 |
$fieldUnitDTOs = order_fieldUnitDtos_by_date_and_type($fieldUnitDTOs); |
... | ... | |
89 | 90 |
|
90 | 91 |
// ------------------------------------------------------- |
91 | 92 |
|
92 |
if((variable_get(CDM_SPECIMEN_LIST_VIEW_MODE, CDM_SPECIMEN_LIST_VIEW_MODE_DEFAULT) == CDM_SPECIMEN_LIST_VIEW_MODE_OPTION_DERIVATE_TABLE)){
|
|
93 |
if(($current_view_mode == CDM_SPECIMEN_LIST_VIEW_MODE_OPTION_DERIVATE_TABLE)){
|
|
93 | 94 |
|
94 | 95 |
//COMPRESSED SPECIMEN DERIVATE TABLE |
95 | 96 |
$pager_field_units = cdm_ws_page( |
... | ... | |
119 | 120 |
10 // weight |
120 | 121 |
); |
121 | 122 |
} |
122 |
else if((variable_get(CDM_SPECIMEN_LIST_VIEW_MODE, CDM_SPECIMEN_LIST_VIEW_MODE_DEFAULT) == CDM_SPECIMEN_LIST_VIEW_MODE_OPTION_DERIVATE_TREE)){ // FIXME this seems to be wrong
|
|
123 |
else if(($current_view_mode == CDM_SPECIMEN_LIST_VIEW_MODE_OPTION_DERIVATE_TREE)){ // FIXME this seems to be wrong
|
|
123 | 124 |
$render_array['specimen_list'] = compose_specimen_table_top_down($fieldUnitDTOs); |
124 | 125 |
$render_array['specimen_list']['#weight'] = 2; |
125 | 126 |
} else { |
modules/cdm_dataportal/theme/cdm_dataportal.references.theme | ||
---|---|---|
22 | 22 |
* - cdm_reference_pager |
23 | 23 |
* - cdm_taxonRelationships |
24 | 24 |
* |
25 |
* @param array $variables
|
|
26 |
* An associative array containing:
|
|
27 |
* - reference
|
|
28 |
* - microReference
|
|
29 |
* - doTextLink:
|
|
25 |
* @param reference
|
|
26 |
* The entity to be rendered
|
|
27 |
* @param string $microReference
|
|
28 |
* The citation detail like page number
|
|
29 |
* @param boolean doTextLink
|
|
30 | 30 |
* Show the citation string as link to the reference page. This option does not affect links to the reference URI or DOI. |
31 | 31 |
* These links are always created when this data is available |
32 |
* - doIconLink:
|
|
32 |
* @param boolean doIconLink
|
|
33 | 33 |
* Append an icon to the citation string which links to the reference page, links to the reference URI or DOI are always |
34 | 34 |
* created when this data is available |
35 | 35 |
* |
36 | 36 |
* @return string |
37 | 37 |
* the markup for the reference |
38 |
* |
|
39 |
* @ingroup themeable |
|
40 | 38 |
*/ |
41 | 39 |
function cdm_reference_markup($reference, $microReference = NULL, $doTextLink = FALSE, $doIconLink = FALSE) { |
42 | 40 |
|
... | ... | |
80 | 78 |
return $out; |
81 | 79 |
} |
82 | 80 |
|
81 |
/** |
|
82 |
* Creates a HTML representations for a CDM ReferenceDTO object |
|
83 |
* |
|
84 |
* In terms of rendering the entity and dto are interchangeable, |
|
85 |
* therefore this method simply delegates to the according entity method. |
|
86 |
* |
|
87 |
* @param $reference_dto |
|
88 |
* The dto to be rendered |
|
89 |
* @param string $microReference |
|
90 |
* The citation detail like page number |
|
91 |
* @param boolean doTextLink |
|
92 |
* Show the citation string as link to the reference page. This option does not affect links to the reference URI or DOI. |
|
93 |
* These links are always created when this data is available |
|
94 |
* @param boolean doIconLink |
|
95 |
* Append an icon to the citation string which links to the reference page, links to the reference URI or DOI are always |
|
96 |
* created when this data is available |
|
97 |
* |
|
98 |
* @return string |
|
99 |
* the markup for the referenceDTO |
|
100 |
* |
|
101 |
*/ |
|
102 |
function cdm_reference_dto_markup($reference_dto, $microReference = NULL, $doTextLink = FALSE, $doIconLink = FALSE) { |
|
103 |
return cdm_reference_markup($reference_dto, $microReference, $doTextLink, $doIconLink); |
|
104 |
} |
|
105 |
|
|
83 | 106 |
/** |
84 | 107 |
* Creates a anchor tag as clickable link to an external resource, either as text link or as icon. |
85 | 108 |
* The resulting link will have no 'target' attribute, so the link will open in the same tab by default. |
src/test/java/eu/etaxonomy/dataportal/selenium/tests/reference/SpecimensTreeViewTest.java | ||
---|---|---|
64 | 64 |
assertEquals("Germany, Berlin, alt. 165 m, 52°31'1.2\"N, 13°21'E (WGS84), 28 Mar 2016, Ehrenberg D047.", summaryRows.get(1).getText()); |
65 | 65 |
assertEquals("Germany, Berlin, 2 Apr 1835.", summaryRows.get(2).getText()); |
66 | 66 |
|
67 |
|
|
68 |
// Germany, Berlin, 52°31'1.2\"N, 13°21'E, 28.3.2016, D047.
|
|
67 |
// ------------------------------------------------------------------------------------------- |
|
68 |
// Germany, Berlin, alt. 165 m, 52°31'1.2"N, 13°21'E (WGS84), 28 Mar 2016, Ehrenberg D047.
|
|
69 | 69 |
summaryRows.get(0).click(); // make the row visible |
70 | 70 |
|
71 | 71 |
WebElement descriptionListContainerElement = detailRows.get(0).findElement(By.cssSelector("div.description_list")); |
... | ... | |
76 | 76 |
assertEquals(3, dls.size()); |
77 | 77 |
DescriptionList dl1 = new DescriptionList(dls.get(0).findElement(By.tagName("dl"))); |
78 | 78 |
assertEquals("Field Unit", dl1.joinedDescriptionElementText("Record base:")); |
79 |
assertEquals("Ehrenberg, C.G.", dl1.joinedDescriptionElementText("Collector:")); |
|
79 | 80 |
assertEquals("Germany", dl1.joinedDescriptionElementText("Country:")); |
80 | 81 |
assertEquals("Berlin", dl1.joinedDescriptionElementText("Locality:")); |
81 | 82 |
BaseElement descriptionListContainer = new BaseElement(derivateTreeContainer); |
... | ... | |
101 | 102 |
assertEquals("CEDiT 2017E68", specimenTypeDesignationLinks.get(1).getText()); |
102 | 103 |
assertTrue(specimenTypeDesignationLinks.get(1).getUrl().endsWith("cdm_dataportal/occurrence/8585081c-b73b-440b-b349-582845cf3fb4")); |
103 | 104 |
|
104 |
// Germany, Berlin, 52°31'1.2"N, 13°21'E, 28.3.2016, D047. |
|
105 |
|
|
106 |
// ------------------------------------------------------------------------------------------- |
|
107 |
// Germany, Berlin, alt. 165 m, 52°31'1.2"N, 13°21'E (WGS84), 28 Mar 2016, Ehrenberg D047. |
|
105 | 108 |
summaryRows.get(1).click(); // make the row visible |
106 | 109 |
descriptionListContainerElement = detailRows.get(1).findElement(By.cssSelector("div.description_list")); |
107 | 110 |
derivateTreeContainer = descriptionListContainerElement.findElement(By.xpath("./parent::li")); |
Also available in: Unified diff
ref #7599 adapting derivate tree view to DTOs and solving code inconsistencies