Project

General

Profile

Revision b90ef618

IDb90ef61802d5882f5cf1b0b5a1c6cee8c32e3f61
Parent 72d57201
Child 0a02c62f

Added by Andreas Kohlbecker over 1 year ago

fix #8016 implementing display of registration event type

View differences:

modules/cdm_dataportal/includes/name.inc
600 600
    return $render_array;
601 601
  }
602 602

  
603
  $render_array['sub_headline'] = markup_to_render_array(ucfirst(join(" & ", registration_types($registration_dto))),false, '<h3 class="regsitration_type">' . t('Event: '), '</h3>' );
604

  
603 605
  // name and typedesignation in detail
604 606
  if($registration_dto->nameRef){
605 607
    $name = cdm_ws_get(CDM_WS_PORTAL_NAME, $registration_dto->nameRef->uuid);
......
1392 1394
function compare_name_relations_by_term_order_index($name_rel1, $name_rel2){
1393 1395
  return compare_terms_by_order_index($name_rel1->type, $name_rel2->type);
1394 1396
}
1397

  
1398
/**
1399
 * Provides an array with the different registration types covered by the passed registration.
1400
 *
1401
 * The labels in the returned array are translatable.
1402
 *
1403
 * See also https://dev.e-taxonomy.eu/redmine/issues/8016
1404
 *
1405
 * @param $registration_dto
1406
 * @return array
1407
 *    An array of the labels describing the different registration types covered by the passed registration.
1408
 */
1409
function registration_types($registration_dto){
1410
  $reg_type_labels = array();
1411
  if(isset($registration_dto->nameRef)){
1412
    $reg_type_labels[] = t("new name");
1413
    $reg_type_labels[] = t("new taxon");
1414
    $name_relations = cdm_ws_fetch_all(str_replace("$0", $registration_dto->nameRef->uuid, CDM_WS_PORTAL_NAME_NAME_RELATIONS));
1415
    foreach($name_relations as $name_rel){
1416
      if(isset($name_rel->type->uuid)){
1417
        $name_is_from_name = $registration_dto->nameRef->uuid == $name_rel->fromName->uuid;
1418
        switch($name_rel->type->uuid) {
1419
          case UUID_NAMERELATIONSHIPTYPE_BASIONYM:
1420
            if(!$name_is_from_name){
1421
              $reg_type_labels[] = t("new combination");
1422
            }
1423
            break;
1424
          case UUID_NAMERELATIONSHIPTYPE_REPLACED_SYNONYM:
1425
            if(!$name_is_from_name) {
1426
              $reg_type_labels[] = t("new name");
1427
            }
1428
            break;
1429
          case UUID_NAMERELATIONSHIPTYPE_VALIDATED_BY_NAME:
1430
            if(!$name_is_from_name) {
1431
              $reg_type_labels[] = t("validation");
1432
            }
1433
            break;
1434
          case UUID_NAMERELATIONSHIPTYPE_ORTHOGRAPHIC_VARIANT:
1435
            if(!$name_is_from_name) {
1436
              $reg_type_labels[] = t("orthographical correction");
1437
            }break;
1438
          default:
1439
            // NOTHING
1440
        }
1441
      }
1442
    }
1443
  }
1444
  if(isset($registration_dto->orderdTypeDesignationWorkingSets)){
1445
    $reg_type_labels[] = t("new nomeclatural type");
1446
  }
1447
  return $reg_type_labels;
1448
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)