| @@ 3119-3146 (lines=28) @@ | ||
| 3116 | if (isset($row['i_id'])) { |
|
| 3117 | $person = Individual::getInstance($row['i_id'], $this->tree); |
|
| 3118 | } |
|
| 3119 | switch ($type) { |
|
| 3120 | default: |
|
| 3121 | case 'full': |
|
| 3122 | if ($family->canShow()) { |
|
| 3123 | $result = $family->formatList('span', false, $person->getFullName()); |
|
| 3124 | } else { |
|
| 3125 | $result = I18N::translate('This information is private and cannot be shown.'); |
|
| 3126 | } |
|
| 3127 | break; |
|
| 3128 | case 'name': |
|
| 3129 | $result = '<a href="' . $family->getHtmlUrl() . '">' . $person->getFullName() . '</a>'; |
|
| 3130 | break; |
|
| 3131 | case 'age': |
|
| 3132 | $age = $row['age']; |
|
| 3133 | if ($show_years) { |
|
| 3134 | if ((int) ($age / 365.25) > 0) { |
|
| 3135 | $age = (int) ($age / 365.25) . 'y'; |
|
| 3136 | } elseif ((int) ($age / 30.4375) > 0) { |
|
| 3137 | $age = (int) ($age / 30.4375) . 'm'; |
|
| 3138 | } else { |
|
| 3139 | $age = $age . 'd'; |
|
| 3140 | } |
|
| 3141 | $result = FunctionsDate::getAgeAtEvent($age); |
|
| 3142 | } else { |
|
| 3143 | $result = I18N::number((int) ($age / 365.25)); |
|
| 3144 | } |
|
| 3145 | break; |
|
| 3146 | } |
|
| 3147 | ||
| 3148 | return $result; |
|
| 3149 | } |
|
| @@ 3417-3444 (lines=28) @@ | ||
| 3414 | if (isset($row['id'])) { |
|
| 3415 | $person = Individual::getInstance($row['id'], $this->tree); |
|
| 3416 | } |
|
| 3417 | switch ($type) { |
|
| 3418 | default: |
|
| 3419 | case 'full': |
|
| 3420 | if ($person->canShow()) { |
|
| 3421 | $result = $person->formatList('span', false, $person->getFullName()); |
|
| 3422 | } else { |
|
| 3423 | $result = I18N::translate('This information is private and cannot be shown.'); |
|
| 3424 | } |
|
| 3425 | break; |
|
| 3426 | case 'name': |
|
| 3427 | $result = '<a href="' . $person->getHtmlUrl() . '">' . $person->getFullName() . '</a>'; |
|
| 3428 | break; |
|
| 3429 | case 'age': |
|
| 3430 | $age = $row['age']; |
|
| 3431 | if ($show_years) { |
|
| 3432 | if ((int) ($age / 365.25) > 0) { |
|
| 3433 | $age = (int) ($age / 365.25) . 'y'; |
|
| 3434 | } elseif ((int) ($age / 30.4375) > 0) { |
|
| 3435 | $age = (int) ($age / 30.4375) . 'm'; |
|
| 3436 | } else { |
|
| 3437 | $age = $age . 'd'; |
|
| 3438 | } |
|
| 3439 | $result = FunctionsDate::getAgeAtEvent($age); |
|
| 3440 | } else { |
|
| 3441 | $result = (int) ($age / 365.25); |
|
| 3442 | } |
|
| 3443 | break; |
|
| 3444 | } |
|
| 3445 | ||
| 3446 | return $result; |
|
| 3447 | } |
|