@@ -64,7 +64,7 @@ |
||
| 64 | 64 | |
| 65 | 65 | return [ |
| 66 | 66 | 'data-language' => json_encode($language), |
| 67 | - 'data-length-menu' => json_encode([array_keys($length_menu), array_values($length_menu)]) |
|
| 67 | + 'data-length-menu' => json_encode([array_keys($length_menu), array_values($length_menu)]) |
|
| 68 | 68 | ]; |
| 69 | 69 | } |
| 70 | 70 | |
@@ -90,9 +90,9 @@ |
||
| 90 | 90 | 'info' => 'fa fa-info-circle', |
| 91 | 91 | 'warning' => 'fa fa-exclamation-circle', |
| 92 | 92 | |
| 93 | - // Icons for file types |
|
| 94 | - 'mime-application-pdf' => '', |
|
| 95 | - 'mime-text-html' => '', |
|
| 93 | + // Icons for file types |
|
| 94 | + 'mime-application-pdf' => '', |
|
| 95 | + 'mime-text-html' => '', |
|
| 96 | 96 | |
| 97 | 97 | // Other icons |
| 98 | 98 | 'mail' => 'fa fa-envelope-o', |
@@ -1120,24 +1120,24 @@ |
||
| 1120 | 1120 | if ($latlongval[$i] == $latlongval[$k]) { |
| 1121 | 1121 | $dups++; |
| 1122 | 1122 | switch ($dups) { |
| 1123 | - case 1: |
|
| 1124 | - $marker_number = $curgen . 'L'; |
|
| 1125 | - break; |
|
| 1126 | - case 2: |
|
| 1127 | - $marker_number = $curgen . 'R'; |
|
| 1128 | - break; |
|
| 1129 | - case 3: |
|
| 1130 | - $marker_number = $curgen . 'Ls'; |
|
| 1131 | - break; |
|
| 1132 | - case 4: |
|
| 1133 | - $marker_number = $curgen . 'Rs'; |
|
| 1134 | - break; |
|
| 1135 | - case 5: //adjust position where markers have same coodinates |
|
| 1136 | - default: |
|
| 1137 | - $marker_number = $curgen; |
|
| 1138 | - $lon[$i] += 0.0025; |
|
| 1139 | - $lat[$i] += 0.0025; |
|
| 1140 | - break; |
|
| 1123 | + case 1: |
|
| 1124 | + $marker_number = $curgen . 'L'; |
|
| 1125 | + break; |
|
| 1126 | + case 2: |
|
| 1127 | + $marker_number = $curgen . 'R'; |
|
| 1128 | + break; |
|
| 1129 | + case 3: |
|
| 1130 | + $marker_number = $curgen . 'Ls'; |
|
| 1131 | + break; |
|
| 1132 | + case 4: |
|
| 1133 | + $marker_number = $curgen . 'Rs'; |
|
| 1134 | + break; |
|
| 1135 | + case 5: //adjust position where markers have same coodinates |
|
| 1136 | + default: |
|
| 1137 | + $marker_number = $curgen; |
|
| 1138 | + $lon[$i] += 0.0025; |
|
| 1139 | + $lat[$i] += 0.0025; |
|
| 1140 | + break; |
|
| 1141 | 1141 | } |
| 1142 | 1142 | } |
| 1143 | 1143 | } |
@@ -38,12 +38,12 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function generate(Individual $individual, Individual $head = null) { |
| 40 | 40 | switch ($individual->getSex()) { |
| 41 | - case 'M': |
|
| 42 | - return $this->male; |
|
| 43 | - case 'F': |
|
| 44 | - return $this->female; |
|
| 45 | - default: |
|
| 46 | - return ''; |
|
| 41 | + case 'M': |
|
| 42 | + return $this->male; |
|
| 43 | + case 'F': |
|
| 44 | + return $this->female; |
|
| 45 | + default: |
|
| 46 | + return ''; |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -35,59 +35,59 @@ discard block |
||
| 35 | 35 | * Class CensusAssistantModule |
| 36 | 36 | */ |
| 37 | 37 | class CensusAssistantModule extends AbstractModule { |
| 38 | - /** {@inheritdoc} */ |
|
| 39 | - public function getTitle() { |
|
| 40 | - return /* I18N: Name of a module */ |
|
| 41 | - I18N::translate('Census assistant'); |
|
| 42 | - } |
|
| 43 | - |
|
| 44 | - /** {@inheritdoc} */ |
|
| 45 | - public function getDescription() { |
|
| 46 | - return /* I18N: Description of the “Census assistant” module */ |
|
| 47 | - I18N::translate('An alternative way to enter census transcripts and link them to individuals.'); |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * This is a general purpose hook, allowing modules to respond to routes |
|
| 52 | - * of the form module.php?mod=FOO&mod_action=BAR |
|
| 53 | - * |
|
| 54 | - * @param string $mod_action |
|
| 55 | - */ |
|
| 56 | - public function modAction($mod_action) { |
|
| 57 | - global $WT_TREE; |
|
| 58 | - |
|
| 59 | - switch ($mod_action) { |
|
| 60 | - case 'census-header': |
|
| 61 | - header('Content-Type: text/html; charset=utf8'); |
|
| 62 | - $census = Filter::get('census'); |
|
| 63 | - echo $this->censusTableHeader(new $census); |
|
| 64 | - break; |
|
| 65 | - |
|
| 66 | - case 'census-individual': |
|
| 67 | - header('Content-Type: text/html; charset=utf8'); |
|
| 68 | - $census = Filter::get('census'); |
|
| 69 | - $individual = Individual::getInstance(Filter::get('xref'), $WT_TREE); |
|
| 70 | - $head = Individual::getInstance(Filter::get('head'), $WT_TREE); |
|
| 71 | - echo $this->censusTableRow(new $census, $individual, $head); |
|
| 72 | - break; |
|
| 73 | - |
|
| 74 | - case 'media_find': |
|
| 75 | - self::mediaFind(); |
|
| 76 | - break; |
|
| 77 | - case 'media_query_3a': |
|
| 78 | - self::mediaQuery(); |
|
| 79 | - break; |
|
| 80 | - default: |
|
| 81 | - http_response_code(404); |
|
| 82 | - } |
|
| 83 | - } |
|
| 84 | - |
|
| 85 | - /** |
|
| 86 | - * @param Individual $individual |
|
| 87 | - * @param CensusInterface $census |
|
| 88 | - */ |
|
| 89 | - public function createCensusAssistant(Individual $individual) { |
|
| 90 | - ?> |
|
| 38 | + /** {@inheritdoc} */ |
|
| 39 | + public function getTitle() { |
|
| 40 | + return /* I18N: Name of a module */ |
|
| 41 | + I18N::translate('Census assistant'); |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + /** {@inheritdoc} */ |
|
| 45 | + public function getDescription() { |
|
| 46 | + return /* I18N: Description of the “Census assistant” module */ |
|
| 47 | + I18N::translate('An alternative way to enter census transcripts and link them to individuals.'); |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * This is a general purpose hook, allowing modules to respond to routes |
|
| 52 | + * of the form module.php?mod=FOO&mod_action=BAR |
|
| 53 | + * |
|
| 54 | + * @param string $mod_action |
|
| 55 | + */ |
|
| 56 | + public function modAction($mod_action) { |
|
| 57 | + global $WT_TREE; |
|
| 58 | + |
|
| 59 | + switch ($mod_action) { |
|
| 60 | + case 'census-header': |
|
| 61 | + header('Content-Type: text/html; charset=utf8'); |
|
| 62 | + $census = Filter::get('census'); |
|
| 63 | + echo $this->censusTableHeader(new $census); |
|
| 64 | + break; |
|
| 65 | + |
|
| 66 | + case 'census-individual': |
|
| 67 | + header('Content-Type: text/html; charset=utf8'); |
|
| 68 | + $census = Filter::get('census'); |
|
| 69 | + $individual = Individual::getInstance(Filter::get('xref'), $WT_TREE); |
|
| 70 | + $head = Individual::getInstance(Filter::get('head'), $WT_TREE); |
|
| 71 | + echo $this->censusTableRow(new $census, $individual, $head); |
|
| 72 | + break; |
|
| 73 | + |
|
| 74 | + case 'media_find': |
|
| 75 | + self::mediaFind(); |
|
| 76 | + break; |
|
| 77 | + case 'media_query_3a': |
|
| 78 | + self::mediaQuery(); |
|
| 79 | + break; |
|
| 80 | + default: |
|
| 81 | + http_response_code(404); |
|
| 82 | + } |
|
| 83 | + } |
|
| 84 | + |
|
| 85 | + /** |
|
| 86 | + * @param Individual $individual |
|
| 87 | + * @param CensusInterface $census |
|
| 88 | + */ |
|
| 89 | + public function createCensusAssistant(Individual $individual) { |
|
| 90 | + ?> |
|
| 91 | 91 | |
| 92 | 92 | <div id="census-assistant-link" hidden> |
| 93 | 93 | <a href="#"> |
@@ -245,85 +245,85 @@ discard block |
||
| 245 | 245 | document.querySelector('#census-assistant-head').addEventListener('click', censusAssistantHead); |
| 246 | 246 | </script> |
| 247 | 247 | <?php |
| 248 | - } |
|
| 249 | - |
|
| 250 | - /** |
|
| 251 | - * @param Individual $individual |
|
| 252 | - * @param string $newged |
|
| 253 | - * |
|
| 254 | - * @return string |
|
| 255 | - */ |
|
| 256 | - public function updateCensusAssistant(Individual $individual, $fact_id, $newged, $keep_chan) { |
|
| 257 | - $ca_title = Filter::post('ca_title'); |
|
| 258 | - $ca_place = Filter::post('ca_place'); |
|
| 259 | - $ca_citation = Filter::post('ca_citation'); |
|
| 260 | - $ca_individuals = Filter::postArray('ca_individuals'); |
|
| 261 | - $ca_notes = Filter::post('ca_notes'); |
|
| 262 | - $ca_census = Filter::post('ca_census', 'Fisharebest\\\\Webtrees\\\\Census\\\\CensusOf[A-Za-z0-9]+'); |
|
| 263 | - |
|
| 264 | - if ($ca_census !== '' && !empty($ca_individuals)) { |
|
| 265 | - $census = new $ca_census; |
|
| 266 | - |
|
| 267 | - $note_text = $this->createNoteText($census, $ca_title, $ca_place, $ca_citation, $ca_individuals, $ca_notes); |
|
| 268 | - $note_gedcom = '0 @new@ NOTE ' . str_replace("\n", "\n1 CONT ", $note_text); |
|
| 269 | - $note = $individual->getTree()->createRecord($note_gedcom); |
|
| 270 | - |
|
| 271 | - $newged .= "\n2 NOTE @" . $note->getXref() . '@'; |
|
| 272 | - |
|
| 273 | - // Add the census fact to the rest of the household |
|
| 274 | - foreach (array_keys($ca_individuals) as $xref) { |
|
| 275 | - if ($xref !== $individual->getXref()) { |
|
| 276 | - Individual::getInstance($xref, $individual->getTree()) |
|
| 277 | - ->updateFact($fact_id, $newged, !$keep_chan); |
|
| 278 | - } |
|
| 279 | - } |
|
| 280 | - } |
|
| 281 | - |
|
| 282 | - return $newged; |
|
| 283 | - } |
|
| 284 | - |
|
| 285 | - /** |
|
| 286 | - * @param CensusInterface $census |
|
| 287 | - * @param string $ca_title |
|
| 288 | - * @param string $ca_place |
|
| 289 | - * @param string $ca_citation |
|
| 290 | - * @param string[][] $ca_individuals |
|
| 291 | - * @param string $ca_notes |
|
| 292 | - * |
|
| 293 | - * @return string |
|
| 294 | - */ |
|
| 295 | - private function createNoteText(CensusInterface $census, $ca_title, $ca_place, $ca_citation, $ca_individuals, $ca_notes) { |
|
| 296 | - $text = $ca_title . "\n" . $ca_citation . "\n" . $ca_place . "\n\n.start_formatted_area.\n\n"; |
|
| 297 | - |
|
| 298 | - foreach ($census->columns() as $n => $column) { |
|
| 299 | - if ($n > 0) { |
|
| 300 | - $text .= '|'; |
|
| 301 | - } |
|
| 302 | - $text .= '.b.' . $column->abbreviation(); |
|
| 303 | - } |
|
| 304 | - |
|
| 305 | - foreach ($ca_individuals as $xref => $columns) { |
|
| 306 | - $text .= "\n" . implode('|', $columns); |
|
| 307 | - } |
|
| 308 | - |
|
| 309 | - return $text . "\n.end_formatted_area.\n\n" . $ca_notes; |
|
| 310 | - } |
|
| 311 | - |
|
| 312 | - /** |
|
| 313 | - * Find a media object. |
|
| 314 | - */ |
|
| 315 | - private static function mediaFind() { |
|
| 316 | - global $WT_TREE; |
|
| 317 | - |
|
| 318 | - $controller = new SimpleController; |
|
| 319 | - $filter = Filter::get('filter'); |
|
| 320 | - $multiple = Filter::getBool('multiple'); |
|
| 321 | - |
|
| 322 | - $controller |
|
| 323 | - ->setPageTitle(I18N::translate('Find an individual')) |
|
| 324 | - ->pageHeader(); |
|
| 325 | - |
|
| 326 | - ?> |
|
| 248 | + } |
|
| 249 | + |
|
| 250 | + /** |
|
| 251 | + * @param Individual $individual |
|
| 252 | + * @param string $newged |
|
| 253 | + * |
|
| 254 | + * @return string |
|
| 255 | + */ |
|
| 256 | + public function updateCensusAssistant(Individual $individual, $fact_id, $newged, $keep_chan) { |
|
| 257 | + $ca_title = Filter::post('ca_title'); |
|
| 258 | + $ca_place = Filter::post('ca_place'); |
|
| 259 | + $ca_citation = Filter::post('ca_citation'); |
|
| 260 | + $ca_individuals = Filter::postArray('ca_individuals'); |
|
| 261 | + $ca_notes = Filter::post('ca_notes'); |
|
| 262 | + $ca_census = Filter::post('ca_census', 'Fisharebest\\\\Webtrees\\\\Census\\\\CensusOf[A-Za-z0-9]+'); |
|
| 263 | + |
|
| 264 | + if ($ca_census !== '' && !empty($ca_individuals)) { |
|
| 265 | + $census = new $ca_census; |
|
| 266 | + |
|
| 267 | + $note_text = $this->createNoteText($census, $ca_title, $ca_place, $ca_citation, $ca_individuals, $ca_notes); |
|
| 268 | + $note_gedcom = '0 @new@ NOTE ' . str_replace("\n", "\n1 CONT ", $note_text); |
|
| 269 | + $note = $individual->getTree()->createRecord($note_gedcom); |
|
| 270 | + |
|
| 271 | + $newged .= "\n2 NOTE @" . $note->getXref() . '@'; |
|
| 272 | + |
|
| 273 | + // Add the census fact to the rest of the household |
|
| 274 | + foreach (array_keys($ca_individuals) as $xref) { |
|
| 275 | + if ($xref !== $individual->getXref()) { |
|
| 276 | + Individual::getInstance($xref, $individual->getTree()) |
|
| 277 | + ->updateFact($fact_id, $newged, !$keep_chan); |
|
| 278 | + } |
|
| 279 | + } |
|
| 280 | + } |
|
| 281 | + |
|
| 282 | + return $newged; |
|
| 283 | + } |
|
| 284 | + |
|
| 285 | + /** |
|
| 286 | + * @param CensusInterface $census |
|
| 287 | + * @param string $ca_title |
|
| 288 | + * @param string $ca_place |
|
| 289 | + * @param string $ca_citation |
|
| 290 | + * @param string[][] $ca_individuals |
|
| 291 | + * @param string $ca_notes |
|
| 292 | + * |
|
| 293 | + * @return string |
|
| 294 | + */ |
|
| 295 | + private function createNoteText(CensusInterface $census, $ca_title, $ca_place, $ca_citation, $ca_individuals, $ca_notes) { |
|
| 296 | + $text = $ca_title . "\n" . $ca_citation . "\n" . $ca_place . "\n\n.start_formatted_area.\n\n"; |
|
| 297 | + |
|
| 298 | + foreach ($census->columns() as $n => $column) { |
|
| 299 | + if ($n > 0) { |
|
| 300 | + $text .= '|'; |
|
| 301 | + } |
|
| 302 | + $text .= '.b.' . $column->abbreviation(); |
|
| 303 | + } |
|
| 304 | + |
|
| 305 | + foreach ($ca_individuals as $xref => $columns) { |
|
| 306 | + $text .= "\n" . implode('|', $columns); |
|
| 307 | + } |
|
| 308 | + |
|
| 309 | + return $text . "\n.end_formatted_area.\n\n" . $ca_notes; |
|
| 310 | + } |
|
| 311 | + |
|
| 312 | + /** |
|
| 313 | + * Find a media object. |
|
| 314 | + */ |
|
| 315 | + private static function mediaFind() { |
|
| 316 | + global $WT_TREE; |
|
| 317 | + |
|
| 318 | + $controller = new SimpleController; |
|
| 319 | + $filter = Filter::get('filter'); |
|
| 320 | + $multiple = Filter::getBool('multiple'); |
|
| 321 | + |
|
| 322 | + $controller |
|
| 323 | + ->setPageTitle(I18N::translate('Find an individual')) |
|
| 324 | + ->pageHeader(); |
|
| 325 | + |
|
| 326 | + ?> |
|
| 327 | 327 | <script> |
| 328 | 328 | function pasterow (id, name, gend, yob, age, bpl) { |
| 329 | 329 | window.opener.opener.insertRowToTable(id, name, '', gend, '', yob, age, 'Y', '', bpl); |
@@ -333,8 +333,8 @@ discard block |
||
| 333 | 333 | if (thumb) { |
| 334 | 334 | window.opener.paste_id(id, name, thumb); |
| 335 | 335 | <?php if (!$multiple) { |
| 336 | - echo 'window.close();'; |
|
| 337 | - } ?> |
|
| 336 | + echo 'window.close();'; |
|
| 337 | + } ?> |
|
| 338 | 338 | } else { |
| 339 | 339 | // GEDFact_assistant ======================== |
| 340 | 340 | if (window.opener.document.getElementById('addlinkQueue')) { |
@@ -345,8 +345,8 @@ discard block |
||
| 345 | 345 | window.opener.pastename(name); |
| 346 | 346 | } |
| 347 | 347 | <?php if (!$multiple) { |
| 348 | - echo 'window.close();'; |
|
| 349 | - } ?> |
|
| 348 | + echo 'window.close();'; |
|
| 349 | + } ?> |
|
| 350 | 350 | } |
| 351 | 351 | } |
| 352 | 352 | |
@@ -369,27 +369,27 @@ discard block |
||
| 369 | 369 | </script> |
| 370 | 370 | |
| 371 | 371 | <?php |
| 372 | - echo '<div>'; |
|
| 373 | - echo '<table class="list_table width90" border="0">'; |
|
| 374 | - echo '<tr><td style="padding: 10px;" class="facts_label03 width90">'; // start column for find text header |
|
| 375 | - echo $controller->getPageTitle(); |
|
| 376 | - echo '</td>'; |
|
| 377 | - echo '</tr>'; |
|
| 378 | - echo '</table>'; |
|
| 379 | - echo '<br>'; |
|
| 380 | - echo '<button onclick="window.close();">', I18N::translate('close'), '</button>'; |
|
| 381 | - echo '<br>'; |
|
| 382 | - |
|
| 383 | - $filter = trim($filter); |
|
| 384 | - $filter_array = explode(' ', preg_replace('/ {2,}/', ' ', $filter)); |
|
| 385 | - echo '<table class="tabs_table width90"><tr>'; |
|
| 386 | - $myindilist = FunctionsDb::searchIndividualNames($filter_array, [$WT_TREE]); |
|
| 387 | - if ($myindilist) { |
|
| 388 | - echo '<td class="list_value_wrap"><ul>'; |
|
| 389 | - usort($myindilist, '\Fisharebest\Webtrees\GedcomRecord::compare'); |
|
| 390 | - foreach ($myindilist as $indi) { |
|
| 391 | - $nam = Filter::escapeHtml($indi->getFullName()); |
|
| 392 | - echo "<li><a href=\"#\" onclick=\"pasterow( |
|
| 372 | + echo '<div>'; |
|
| 373 | + echo '<table class="list_table width90" border="0">'; |
|
| 374 | + echo '<tr><td style="padding: 10px;" class="facts_label03 width90">'; // start column for find text header |
|
| 375 | + echo $controller->getPageTitle(); |
|
| 376 | + echo '</td>'; |
|
| 377 | + echo '</tr>'; |
|
| 378 | + echo '</table>'; |
|
| 379 | + echo '<br>'; |
|
| 380 | + echo '<button onclick="window.close();">', I18N::translate('close'), '</button>'; |
|
| 381 | + echo '<br>'; |
|
| 382 | + |
|
| 383 | + $filter = trim($filter); |
|
| 384 | + $filter_array = explode(' ', preg_replace('/ {2,}/', ' ', $filter)); |
|
| 385 | + echo '<table class="tabs_table width90"><tr>'; |
|
| 386 | + $myindilist = FunctionsDb::searchIndividualNames($filter_array, [$WT_TREE]); |
|
| 387 | + if ($myindilist) { |
|
| 388 | + echo '<td class="list_value_wrap"><ul>'; |
|
| 389 | + usort($myindilist, '\Fisharebest\Webtrees\GedcomRecord::compare'); |
|
| 390 | + foreach ($myindilist as $indi) { |
|
| 391 | + $nam = Filter::escapeHtml($indi->getFullName()); |
|
| 392 | + echo "<li><a href=\"#\" onclick=\"pasterow( |
|
| 393 | 393 | '" . $indi->getXref() . "' , |
| 394 | 394 | '" . $nam . "' , |
| 395 | 395 | '" . $indi->getSex() . "' , |
@@ -398,44 +398,44 @@ discard block |
||
| 398 | 398 | '" . $indi->getBirthPlace() . "'); return false;\"> |
| 399 | 399 | <b>" . $indi->getFullName() . '</b> '; |
| 400 | 400 | |
| 401 | - $born = I18N::translate('Birth'); |
|
| 402 | - echo '</span><br><span class="list_item">', $born, ' ', $indi->getBirthYear(), ' ', $indi->getBirthPlace(), '</span></a></li>'; |
|
| 403 | - echo '<hr>'; |
|
| 404 | - } |
|
| 405 | - echo '</ul></td></tr><tr><td class="list_label">', I18N::translate('Total individuals: %s', count($myindilist)), '</tr></td>'; |
|
| 406 | - } else { |
|
| 407 | - echo '<td class="list_value_wrap">'; |
|
| 408 | - echo I18N::translate('No results found.'); |
|
| 409 | - echo '</td></tr>'; |
|
| 410 | - } |
|
| 411 | - echo '</table>'; |
|
| 412 | - echo '</div>'; |
|
| 413 | - } |
|
| 414 | - |
|
| 415 | - /** |
|
| 416 | - * Search for a media object. |
|
| 417 | - */ |
|
| 418 | - private static function mediaQuery() { |
|
| 419 | - global $WT_TREE; |
|
| 420 | - |
|
| 421 | - $iid2 = Filter::get('iid', WT_REGEX_XREF); |
|
| 422 | - |
|
| 423 | - $controller = new SimpleController; |
|
| 424 | - $controller |
|
| 425 | - ->setPageTitle(I18N::translate('Link to an existing media object')) |
|
| 426 | - ->pageHeader(); |
|
| 427 | - |
|
| 428 | - $record = GedcomRecord::getInstance($iid2, $WT_TREE); |
|
| 429 | - if ($record) { |
|
| 430 | - $headjs = ''; |
|
| 431 | - if ($record instanceof Family) { |
|
| 432 | - if ($record->getHusband()) { |
|
| 433 | - $headjs = $record->getHusband()->getXref(); |
|
| 434 | - } elseif ($record->getWife()) { |
|
| 435 | - $headjs = $record->getWife()->getXref(); |
|
| 436 | - } |
|
| 437 | - } |
|
| 438 | - ?> |
|
| 401 | + $born = I18N::translate('Birth'); |
|
| 402 | + echo '</span><br><span class="list_item">', $born, ' ', $indi->getBirthYear(), ' ', $indi->getBirthPlace(), '</span></a></li>'; |
|
| 403 | + echo '<hr>'; |
|
| 404 | + } |
|
| 405 | + echo '</ul></td></tr><tr><td class="list_label">', I18N::translate('Total individuals: %s', count($myindilist)), '</tr></td>'; |
|
| 406 | + } else { |
|
| 407 | + echo '<td class="list_value_wrap">'; |
|
| 408 | + echo I18N::translate('No results found.'); |
|
| 409 | + echo '</td></tr>'; |
|
| 410 | + } |
|
| 411 | + echo '</table>'; |
|
| 412 | + echo '</div>'; |
|
| 413 | + } |
|
| 414 | + |
|
| 415 | + /** |
|
| 416 | + * Search for a media object. |
|
| 417 | + */ |
|
| 418 | + private static function mediaQuery() { |
|
| 419 | + global $WT_TREE; |
|
| 420 | + |
|
| 421 | + $iid2 = Filter::get('iid', WT_REGEX_XREF); |
|
| 422 | + |
|
| 423 | + $controller = new SimpleController; |
|
| 424 | + $controller |
|
| 425 | + ->setPageTitle(I18N::translate('Link to an existing media object')) |
|
| 426 | + ->pageHeader(); |
|
| 427 | + |
|
| 428 | + $record = GedcomRecord::getInstance($iid2, $WT_TREE); |
|
| 429 | + if ($record) { |
|
| 430 | + $headjs = ''; |
|
| 431 | + if ($record instanceof Family) { |
|
| 432 | + if ($record->getHusband()) { |
|
| 433 | + $headjs = $record->getHusband()->getXref(); |
|
| 434 | + } elseif ($record->getWife()) { |
|
| 435 | + $headjs = $record->getWife()->getXref(); |
|
| 436 | + } |
|
| 437 | + } |
|
| 438 | + ?> |
|
| 439 | 439 | <script> |
| 440 | 440 | function insertId () { |
| 441 | 441 | if (window.opener.document.getElementById('addlinkQueue')) { |
@@ -446,8 +446,8 @@ discard block |
||
| 446 | 446 | } |
| 447 | 447 | </script> |
| 448 | 448 | <?php |
| 449 | - } else { |
|
| 450 | - ?> |
|
| 449 | + } else { |
|
| 450 | + ?> |
|
| 451 | 451 | <script> |
| 452 | 452 | function insertId () { |
| 453 | 453 | window.opener.alert('<?= $iid2 ?> - <?= I18N::translate('Not a valid individual, family, or source ID') ?>'); |
@@ -455,142 +455,142 @@ discard block |
||
| 455 | 455 | } |
| 456 | 456 | </script> |
| 457 | 457 | <?php |
| 458 | - } |
|
| 459 | - ?> |
|
| 458 | + } |
|
| 459 | + ?> |
|
| 460 | 460 | <script>window.onLoad = insertId();</script> |
| 461 | 461 | <?php |
| 462 | - } |
|
| 463 | - |
|
| 464 | - /** |
|
| 465 | - * Convert custom markup into HTML |
|
| 466 | - * |
|
| 467 | - * @param Note $note |
|
| 468 | - * |
|
| 469 | - * @return string |
|
| 470 | - */ |
|
| 471 | - public static function formatCensusNote(Note $note) { |
|
| 472 | - if (preg_match('/(.*)((?:\n.*)*)\n\.start_formatted_area\.\n(.+)\n(.+(?:\n.+)*)\n.end_formatted_area\.((?:\n.*)*)/', $note->getNote(), $match)) { |
|
| 473 | - // This looks like a census-assistant shared note |
|
| 474 | - $title = Filter::escapeHtml($match[1]); |
|
| 475 | - $preamble = Filter::escapeHtml($match[2]); |
|
| 476 | - $header = Filter::escapeHtml($match[3]); |
|
| 477 | - $data = Filter::escapeHtml($match[4]); |
|
| 478 | - $postamble = Filter::escapeHtml($match[5]); |
|
| 479 | - |
|
| 480 | - // Get the column headers for the census to which this note refers |
|
| 481 | - // requires the fact place & date to match the specific census |
|
| 482 | - // censusPlace() (Soundex match) and censusDate() functions |
|
| 483 | - $fmt_headers = []; |
|
| 484 | - /** @var GedcomRecord[] $linkedRecords */ |
|
| 485 | - $linkedRecords = array_merge($note->linkedIndividuals('NOTE'), $note->linkedFamilies('NOTE')); |
|
| 486 | - $firstRecord = array_shift($linkedRecords); |
|
| 487 | - if ($firstRecord) { |
|
| 488 | - $countryCode = ''; |
|
| 489 | - $date = ''; |
|
| 490 | - foreach ($firstRecord->getFacts('CENS') as $fact) { |
|
| 491 | - if (trim($fact->getAttribute('NOTE'), '@') === $note->getXref()) { |
|
| 492 | - $date = $fact->getAttribute('DATE'); |
|
| 493 | - $place = explode(',', strip_tags($fact->getPlace()->getFullName())); |
|
| 494 | - $countryCode = Soundex::daitchMokotoff(array_pop($place)); |
|
| 495 | - break; |
|
| 496 | - } |
|
| 497 | - } |
|
| 498 | - |
|
| 499 | - foreach (Census::allCensusPlaces() as $censusPlace) { |
|
| 500 | - if (Soundex::compare($countryCode, Soundex::daitchMokotoff($censusPlace->censusPlace()))) { |
|
| 501 | - foreach ($censusPlace->allCensusDates() as $census) { |
|
| 502 | - if ($census->censusDate() == $date) { |
|
| 503 | - foreach ($census->columns() as $column) { |
|
| 504 | - $abbrev = $column->abbreviation(); |
|
| 505 | - if ($abbrev) { |
|
| 506 | - $description = $column->title() ? $column->title() : I18N::translate('Description unavailable'); |
|
| 507 | - $fmt_headers[$abbrev] = '<span title="' . $description . '">' . $abbrev . '</span>'; |
|
| 508 | - } |
|
| 509 | - } |
|
| 510 | - break 2; |
|
| 511 | - } |
|
| 512 | - } |
|
| 513 | - } |
|
| 514 | - } |
|
| 515 | - } |
|
| 516 | - // Substitute header labels and format as HTML |
|
| 517 | - $thead = '<tr><th>' . strtr(str_replace('|', '</th><th>', $header), $fmt_headers) . '</th></tr>'; |
|
| 518 | - $thead = str_replace('.b.', '', $thead); |
|
| 519 | - |
|
| 520 | - // Format data as HTML |
|
| 521 | - $tbody = ''; |
|
| 522 | - foreach (explode("\n", $data) as $row) { |
|
| 523 | - $tbody .= '<tr>'; |
|
| 524 | - foreach (explode('|', $row) as $column) { |
|
| 525 | - $tbody .= '<td>' . $column . '</td>'; |
|
| 526 | - } |
|
| 527 | - $tbody .= '</tr>'; |
|
| 528 | - } |
|
| 529 | - |
|
| 530 | - return |
|
| 531 | - $title . "\n" . // The newline allows the framework to expand the details and turn the first line into a link |
|
| 532 | - '<div class="markdown">' . |
|
| 533 | - '<p>' . $preamble . '</p>' . |
|
| 534 | - '<table>' . |
|
| 535 | - '<thead>' . $thead . '</thead>' . |
|
| 536 | - '<tbody>' . $tbody . '</tbody>' . |
|
| 537 | - '</table>' . |
|
| 538 | - '<p>' . $postamble . '</p>' . |
|
| 539 | - '</div>'; |
|
| 540 | - } else { |
|
| 541 | - // Not a census-assistant shared note - apply default formatting |
|
| 542 | - return Filter::formatText($note->getNote(), $note->getTree()); |
|
| 543 | - } |
|
| 544 | - } |
|
| 545 | - |
|
| 546 | - /** |
|
| 547 | - * Generate an HTML row of data for the census header |
|
| 548 | - * Add prefix cell (store XREF and drag/drop) |
|
| 549 | - * Add suffix cell (delete button) |
|
| 550 | - * |
|
| 551 | - * @param CensusInterface $census |
|
| 552 | - * |
|
| 553 | - * @return string |
|
| 554 | - */ |
|
| 555 | - public static function censusTableHeader(CensusInterface $census) { |
|
| 556 | - $html = ''; |
|
| 557 | - foreach ($census->columns() as $column) { |
|
| 558 | - $html .= '<th class="wt-census-assistant-field" title="' . $column->title() . '">' . $column->abbreviation() . '</th>'; |
|
| 559 | - } |
|
| 560 | - |
|
| 561 | - return '<tr class="wt-census-assistant-row"><th hidden></th>' . $html . '<th></th></tr>'; |
|
| 562 | - } |
|
| 563 | - |
|
| 564 | - /** |
|
| 565 | - * Generate an HTML row of data for the census |
|
| 566 | - * Add prefix cell (store XREF and drag/drop) |
|
| 567 | - * Add suffix cell (delete button) |
|
| 568 | - * |
|
| 569 | - * @param CensusInterface $census |
|
| 570 | - * |
|
| 571 | - * @return string |
|
| 572 | - */ |
|
| 573 | - public static function censusTableEmptyRow(CensusInterface $census) { |
|
| 574 | - return '<tr class="wt-census-assistant-row"><td hidden></td>' . str_repeat('<td class="wt-census-assistant-field"><input type="text" class="form-control wt-census-assistant-form-control"></td>', count($census->columns())) . '<td><a class="icon-remove" href="#" title="' . I18N::translate('Remove') . '"></a></td></tr>'; |
|
| 575 | - } |
|
| 576 | - |
|
| 577 | - /** |
|
| 578 | - * Generate an HTML row of data for the census |
|
| 579 | - * Add prefix cell (store XREF and drag/drop) |
|
| 580 | - * Add suffix cell (delete button) |
|
| 581 | - * |
|
| 582 | - * @param CensusInterface $census |
|
| 583 | - * @param Individual $individual |
|
| 584 | - * @param Individual $head |
|
| 585 | - * |
|
| 586 | - * @return string |
|
| 587 | - */ |
|
| 588 | - public static function censusTableRow(CensusInterface $census, Individual $individual, Individual $head) { |
|
| 589 | - $html = ''; |
|
| 590 | - foreach ($census->columns() as $column) { |
|
| 591 | - $html .= '<td class="wt-census-assistant-field"><input class="form-control wt-census-assistant-form-control" type="text" value="' . $column->generate($individual, $head) . '" name="ca_individuals[' . $individual->getXref() . '][]"></td>'; |
|
| 592 | - } |
|
| 593 | - |
|
| 594 | - return '<tr class="wt-census-assistant-row"><td class="wt-census-assistant-field" hidden>' . $individual->getXref() . '</td>' . $html . '<td class="wt-census-assistant-field"><a class="icon-remove" href="#" title="' . I18N::translate('Remove') . '"></a></td></tr>'; |
|
| 595 | - } |
|
| 462 | + } |
|
| 463 | + |
|
| 464 | + /** |
|
| 465 | + * Convert custom markup into HTML |
|
| 466 | + * |
|
| 467 | + * @param Note $note |
|
| 468 | + * |
|
| 469 | + * @return string |
|
| 470 | + */ |
|
| 471 | + public static function formatCensusNote(Note $note) { |
|
| 472 | + if (preg_match('/(.*)((?:\n.*)*)\n\.start_formatted_area\.\n(.+)\n(.+(?:\n.+)*)\n.end_formatted_area\.((?:\n.*)*)/', $note->getNote(), $match)) { |
|
| 473 | + // This looks like a census-assistant shared note |
|
| 474 | + $title = Filter::escapeHtml($match[1]); |
|
| 475 | + $preamble = Filter::escapeHtml($match[2]); |
|
| 476 | + $header = Filter::escapeHtml($match[3]); |
|
| 477 | + $data = Filter::escapeHtml($match[4]); |
|
| 478 | + $postamble = Filter::escapeHtml($match[5]); |
|
| 479 | + |
|
| 480 | + // Get the column headers for the census to which this note refers |
|
| 481 | + // requires the fact place & date to match the specific census |
|
| 482 | + // censusPlace() (Soundex match) and censusDate() functions |
|
| 483 | + $fmt_headers = []; |
|
| 484 | + /** @var GedcomRecord[] $linkedRecords */ |
|
| 485 | + $linkedRecords = array_merge($note->linkedIndividuals('NOTE'), $note->linkedFamilies('NOTE')); |
|
| 486 | + $firstRecord = array_shift($linkedRecords); |
|
| 487 | + if ($firstRecord) { |
|
| 488 | + $countryCode = ''; |
|
| 489 | + $date = ''; |
|
| 490 | + foreach ($firstRecord->getFacts('CENS') as $fact) { |
|
| 491 | + if (trim($fact->getAttribute('NOTE'), '@') === $note->getXref()) { |
|
| 492 | + $date = $fact->getAttribute('DATE'); |
|
| 493 | + $place = explode(',', strip_tags($fact->getPlace()->getFullName())); |
|
| 494 | + $countryCode = Soundex::daitchMokotoff(array_pop($place)); |
|
| 495 | + break; |
|
| 496 | + } |
|
| 497 | + } |
|
| 498 | + |
|
| 499 | + foreach (Census::allCensusPlaces() as $censusPlace) { |
|
| 500 | + if (Soundex::compare($countryCode, Soundex::daitchMokotoff($censusPlace->censusPlace()))) { |
|
| 501 | + foreach ($censusPlace->allCensusDates() as $census) { |
|
| 502 | + if ($census->censusDate() == $date) { |
|
| 503 | + foreach ($census->columns() as $column) { |
|
| 504 | + $abbrev = $column->abbreviation(); |
|
| 505 | + if ($abbrev) { |
|
| 506 | + $description = $column->title() ? $column->title() : I18N::translate('Description unavailable'); |
|
| 507 | + $fmt_headers[$abbrev] = '<span title="' . $description . '">' . $abbrev . '</span>'; |
|
| 508 | + } |
|
| 509 | + } |
|
| 510 | + break 2; |
|
| 511 | + } |
|
| 512 | + } |
|
| 513 | + } |
|
| 514 | + } |
|
| 515 | + } |
|
| 516 | + // Substitute header labels and format as HTML |
|
| 517 | + $thead = '<tr><th>' . strtr(str_replace('|', '</th><th>', $header), $fmt_headers) . '</th></tr>'; |
|
| 518 | + $thead = str_replace('.b.', '', $thead); |
|
| 519 | + |
|
| 520 | + // Format data as HTML |
|
| 521 | + $tbody = ''; |
|
| 522 | + foreach (explode("\n", $data) as $row) { |
|
| 523 | + $tbody .= '<tr>'; |
|
| 524 | + foreach (explode('|', $row) as $column) { |
|
| 525 | + $tbody .= '<td>' . $column . '</td>'; |
|
| 526 | + } |
|
| 527 | + $tbody .= '</tr>'; |
|
| 528 | + } |
|
| 529 | + |
|
| 530 | + return |
|
| 531 | + $title . "\n" . // The newline allows the framework to expand the details and turn the first line into a link |
|
| 532 | + '<div class="markdown">' . |
|
| 533 | + '<p>' . $preamble . '</p>' . |
|
| 534 | + '<table>' . |
|
| 535 | + '<thead>' . $thead . '</thead>' . |
|
| 536 | + '<tbody>' . $tbody . '</tbody>' . |
|
| 537 | + '</table>' . |
|
| 538 | + '<p>' . $postamble . '</p>' . |
|
| 539 | + '</div>'; |
|
| 540 | + } else { |
|
| 541 | + // Not a census-assistant shared note - apply default formatting |
|
| 542 | + return Filter::formatText($note->getNote(), $note->getTree()); |
|
| 543 | + } |
|
| 544 | + } |
|
| 545 | + |
|
| 546 | + /** |
|
| 547 | + * Generate an HTML row of data for the census header |
|
| 548 | + * Add prefix cell (store XREF and drag/drop) |
|
| 549 | + * Add suffix cell (delete button) |
|
| 550 | + * |
|
| 551 | + * @param CensusInterface $census |
|
| 552 | + * |
|
| 553 | + * @return string |
|
| 554 | + */ |
|
| 555 | + public static function censusTableHeader(CensusInterface $census) { |
|
| 556 | + $html = ''; |
|
| 557 | + foreach ($census->columns() as $column) { |
|
| 558 | + $html .= '<th class="wt-census-assistant-field" title="' . $column->title() . '">' . $column->abbreviation() . '</th>'; |
|
| 559 | + } |
|
| 560 | + |
|
| 561 | + return '<tr class="wt-census-assistant-row"><th hidden></th>' . $html . '<th></th></tr>'; |
|
| 562 | + } |
|
| 563 | + |
|
| 564 | + /** |
|
| 565 | + * Generate an HTML row of data for the census |
|
| 566 | + * Add prefix cell (store XREF and drag/drop) |
|
| 567 | + * Add suffix cell (delete button) |
|
| 568 | + * |
|
| 569 | + * @param CensusInterface $census |
|
| 570 | + * |
|
| 571 | + * @return string |
|
| 572 | + */ |
|
| 573 | + public static function censusTableEmptyRow(CensusInterface $census) { |
|
| 574 | + return '<tr class="wt-census-assistant-row"><td hidden></td>' . str_repeat('<td class="wt-census-assistant-field"><input type="text" class="form-control wt-census-assistant-form-control"></td>', count($census->columns())) . '<td><a class="icon-remove" href="#" title="' . I18N::translate('Remove') . '"></a></td></tr>'; |
|
| 575 | + } |
|
| 576 | + |
|
| 577 | + /** |
|
| 578 | + * Generate an HTML row of data for the census |
|
| 579 | + * Add prefix cell (store XREF and drag/drop) |
|
| 580 | + * Add suffix cell (delete button) |
|
| 581 | + * |
|
| 582 | + * @param CensusInterface $census |
|
| 583 | + * @param Individual $individual |
|
| 584 | + * @param Individual $head |
|
| 585 | + * |
|
| 586 | + * @return string |
|
| 587 | + */ |
|
| 588 | + public static function censusTableRow(CensusInterface $census, Individual $individual, Individual $head) { |
|
| 589 | + $html = ''; |
|
| 590 | + foreach ($census->columns() as $column) { |
|
| 591 | + $html .= '<td class="wt-census-assistant-field"><input class="form-control wt-census-assistant-form-control" type="text" value="' . $column->generate($individual, $head) . '" name="ca_individuals[' . $individual->getXref() . '][]"></td>'; |
|
| 592 | + } |
|
| 593 | + |
|
| 594 | + return '<tr class="wt-census-assistant-row"><td class="wt-census-assistant-field" hidden>' . $individual->getXref() . '</td>' . $html . '<td class="wt-census-assistant-field"><a class="icon-remove" href="#" title="' . I18N::translate('Remove') . '"></a></td></tr>'; |
|
| 595 | + } |
|
| 596 | 596 | } |
@@ -273,40 +273,40 @@ discard block |
||
| 273 | 273 | |
| 274 | 274 | $level1type = $edit_fact->getTag(); |
| 275 | 275 | switch ($record::RECORD_TYPE) { |
| 276 | - case 'REPO': |
|
| 277 | - // REPO:NAME facts may take a NOTE (but the REPO record may not). |
|
| 278 | - if ($level1type === 'NAME') { |
|
| 279 | - FunctionsEdit::printAddLayer('NOTE'); |
|
| 280 | - FunctionsEdit::printAddLayer('SHARED_NOTE'); |
|
| 276 | + case 'REPO': |
|
| 277 | + // REPO:NAME facts may take a NOTE (but the REPO record may not). |
|
| 278 | + if ($level1type === 'NAME') { |
|
| 279 | + FunctionsEdit::printAddLayer('NOTE'); |
|
| 280 | + FunctionsEdit::printAddLayer('SHARED_NOTE'); |
|
| 281 | + } |
|
| 282 | + break; |
|
| 283 | + case 'FAM': |
|
| 284 | + case 'INDI': |
|
| 285 | + // FAM and INDI records have real facts. They can take NOTE/SOUR/OBJE/etc. |
|
| 286 | + if ($level1type !== 'SEX' && $level1type !== 'NOTE' && $level1type !== 'ALIA') { |
|
| 287 | + if ($level1type !== 'SOUR') { |
|
| 288 | + FunctionsEdit::printAddLayer('SOUR'); |
|
| 281 | 289 | } |
| 282 | - break; |
|
| 283 | - case 'FAM': |
|
| 284 | - case 'INDI': |
|
| 285 | - // FAM and INDI records have real facts. They can take NOTE/SOUR/OBJE/etc. |
|
| 286 | - if ($level1type !== 'SEX' && $level1type !== 'NOTE' && $level1type !== 'ALIA') { |
|
| 287 | - if ($level1type !== 'SOUR') { |
|
| 288 | - FunctionsEdit::printAddLayer('SOUR'); |
|
| 289 | - } |
|
| 290 | - if ($level1type !== 'OBJE') { |
|
| 291 | - FunctionsEdit::printAddLayer('OBJE'); |
|
| 292 | - } |
|
| 293 | - FunctionsEdit::printAddLayer('NOTE'); |
|
| 294 | - FunctionsEdit::printAddLayer('SHARED_NOTE', 2, $level1type); |
|
| 295 | - if ($level1type !== 'ASSO' && $level1type !== 'NOTE' && $level1type !== 'SOUR') { |
|
| 296 | - FunctionsEdit::printAddLayer('ASSO'); |
|
| 297 | - } |
|
| 298 | - // allow to add godfather and godmother for CHR fact or best man and bridesmaid for MARR fact in one window |
|
| 299 | - if (in_array($level1type, Config::twoAssociates())) { |
|
| 300 | - FunctionsEdit::printAddLayer('ASSO2'); |
|
| 301 | - } |
|
| 302 | - if ($level1type !== 'SOUR') { |
|
| 303 | - FunctionsEdit::printAddLayer('RESN'); |
|
| 304 | - } |
|
| 290 | + if ($level1type !== 'OBJE') { |
|
| 291 | + FunctionsEdit::printAddLayer('OBJE'); |
|
| 305 | 292 | } |
| 306 | - break; |
|
| 307 | - default: |
|
| 308 | - // Other types of record do not have these lower-level records |
|
| 309 | - break; |
|
| 293 | + FunctionsEdit::printAddLayer('NOTE'); |
|
| 294 | + FunctionsEdit::printAddLayer('SHARED_NOTE', 2, $level1type); |
|
| 295 | + if ($level1type !== 'ASSO' && $level1type !== 'NOTE' && $level1type !== 'SOUR') { |
|
| 296 | + FunctionsEdit::printAddLayer('ASSO'); |
|
| 297 | + } |
|
| 298 | + // allow to add godfather and godmother for CHR fact or best man and bridesmaid for MARR fact in one window |
|
| 299 | + if (in_array($level1type, Config::twoAssociates())) { |
|
| 300 | + FunctionsEdit::printAddLayer('ASSO2'); |
|
| 301 | + } |
|
| 302 | + if ($level1type !== 'SOUR') { |
|
| 303 | + FunctionsEdit::printAddLayer('RESN'); |
|
| 304 | + } |
|
| 305 | + } |
|
| 306 | + break; |
|
| 307 | + default: |
|
| 308 | + // Other types of record do not have these lower-level records |
|
| 309 | + break; |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | ?> |
@@ -2089,15 +2089,15 @@ discard block |
||
| 2089 | 2089 | <b> |
| 2090 | 2090 | <?php |
| 2091 | 2091 | switch ($father->getSex()) { |
| 2092 | - case 'M': |
|
| 2093 | - echo I18N::translate('husband'); |
|
| 2094 | - break; |
|
| 2095 | - case 'F': |
|
| 2096 | - echo I18N::translate('wife'); |
|
| 2097 | - break; |
|
| 2098 | - default: |
|
| 2099 | - echo I18N::translate('spouse'); |
|
| 2100 | - break; |
|
| 2092 | + case 'M': |
|
| 2093 | + echo I18N::translate('husband'); |
|
| 2094 | + break; |
|
| 2095 | + case 'F': |
|
| 2096 | + echo I18N::translate('wife'); |
|
| 2097 | + break; |
|
| 2098 | + default: |
|
| 2099 | + echo I18N::translate('spouse'); |
|
| 2100 | + break; |
|
| 2101 | 2101 | } |
| 2102 | 2102 | ?> |
| 2103 | 2103 | </b> |
@@ -2128,15 +2128,15 @@ discard block |
||
| 2128 | 2128 | <b> |
| 2129 | 2129 | <?php |
| 2130 | 2130 | switch ($mother->getSex()) { |
| 2131 | - case 'M': |
|
| 2132 | - echo I18N::translate('husband'); |
|
| 2133 | - break; |
|
| 2134 | - case 'F': |
|
| 2135 | - echo I18N::translate('wife'); |
|
| 2136 | - break; |
|
| 2137 | - default: |
|
| 2138 | - echo I18N::translate('spouse'); |
|
| 2139 | - break; |
|
| 2131 | + case 'M': |
|
| 2132 | + echo I18N::translate('husband'); |
|
| 2133 | + break; |
|
| 2134 | + case 'F': |
|
| 2135 | + echo I18N::translate('wife'); |
|
| 2136 | + break; |
|
| 2137 | + default: |
|
| 2138 | + echo I18N::translate('spouse'); |
|
| 2139 | + break; |
|
| 2140 | 2140 | } |
| 2141 | 2141 | ?> |
| 2142 | 2142 | </b> |
@@ -2169,15 +2169,15 @@ discard block |
||
| 2169 | 2169 | <b> |
| 2170 | 2170 | <?php |
| 2171 | 2171 | switch ($child->getSex()) { |
| 2172 | - case 'M': |
|
| 2173 | - echo I18N::translate('son'); |
|
| 2174 | - break; |
|
| 2175 | - case 'F': |
|
| 2176 | - echo I18N::translate('daughter'); |
|
| 2177 | - break; |
|
| 2178 | - default: |
|
| 2179 | - echo I18N::translate('child'); |
|
| 2180 | - break; |
|
| 2172 | + case 'M': |
|
| 2173 | + echo I18N::translate('son'); |
|
| 2174 | + break; |
|
| 2175 | + case 'F': |
|
| 2176 | + echo I18N::translate('daughter'); |
|
| 2177 | + break; |
|
| 2178 | + default: |
|
| 2179 | + echo I18N::translate('child'); |
|
| 2180 | + break; |
|
| 2181 | 2181 | } |
| 2182 | 2182 | ?> |
| 2183 | 2183 | </b> |
@@ -2561,35 +2561,35 @@ discard block |
||
| 2561 | 2561 | } |
| 2562 | 2562 | |
| 2563 | 2563 | switch ($nextaction) { |
| 2564 | - case 'add_child_to_family_action': |
|
| 2565 | - $name_fields = array_merge($name_fields, $surname_tradition->newChildNames($father_name, $mother_name, $gender)); |
|
| 2566 | - break; |
|
| 2567 | - case 'add_child_to_individual_action': |
|
| 2568 | - if ($person->getSex() === 'F') { |
|
| 2569 | - $name_fields = array_merge($name_fields, $surname_tradition->newChildNames('', $indi_name, $gender)); |
|
| 2570 | - } else { |
|
| 2571 | - $name_fields = array_merge($name_fields, $surname_tradition->newChildNames($indi_name, '', $gender)); |
|
| 2572 | - } |
|
| 2573 | - break; |
|
| 2574 | - case 'add_parent_to_individual_action': |
|
| 2575 | - $name_fields = array_merge($name_fields, $surname_tradition->newParentNames($indi_name, $gender)); |
|
| 2576 | - break; |
|
| 2577 | - case 'add_spouse_to_family_action': |
|
| 2578 | - if ($father) { |
|
| 2579 | - $name_fields = array_merge($name_fields, $surname_tradition->newSpouseNames($father_name, $gender)); |
|
| 2580 | - } else { |
|
| 2581 | - $name_fields = array_merge($name_fields, $surname_tradition->newSpouseNames($mother_name, $gender)); |
|
| 2582 | - } |
|
| 2583 | - break; |
|
| 2584 | - case 'add_spouse_to_individual_action': |
|
| 2585 | - $name_fields = array_merge($name_fields, $surname_tradition->newSpouseNames($indi_name, $gender)); |
|
| 2586 | - break; |
|
| 2587 | - case 'add_unlinked_indi_action': |
|
| 2588 | - case 'update': |
|
| 2589 | - if ($surname_tradition->hasSurnames()) { |
|
| 2590 | - $name_fields['NAME'] = '//'; |
|
| 2591 | - } |
|
| 2592 | - break; |
|
| 2564 | + case 'add_child_to_family_action': |
|
| 2565 | + $name_fields = array_merge($name_fields, $surname_tradition->newChildNames($father_name, $mother_name, $gender)); |
|
| 2566 | + break; |
|
| 2567 | + case 'add_child_to_individual_action': |
|
| 2568 | + if ($person->getSex() === 'F') { |
|
| 2569 | + $name_fields = array_merge($name_fields, $surname_tradition->newChildNames('', $indi_name, $gender)); |
|
| 2570 | + } else { |
|
| 2571 | + $name_fields = array_merge($name_fields, $surname_tradition->newChildNames($indi_name, '', $gender)); |
|
| 2572 | + } |
|
| 2573 | + break; |
|
| 2574 | + case 'add_parent_to_individual_action': |
|
| 2575 | + $name_fields = array_merge($name_fields, $surname_tradition->newParentNames($indi_name, $gender)); |
|
| 2576 | + break; |
|
| 2577 | + case 'add_spouse_to_family_action': |
|
| 2578 | + if ($father) { |
|
| 2579 | + $name_fields = array_merge($name_fields, $surname_tradition->newSpouseNames($father_name, $gender)); |
|
| 2580 | + } else { |
|
| 2581 | + $name_fields = array_merge($name_fields, $surname_tradition->newSpouseNames($mother_name, $gender)); |
|
| 2582 | + } |
|
| 2583 | + break; |
|
| 2584 | + case 'add_spouse_to_individual_action': |
|
| 2585 | + $name_fields = array_merge($name_fields, $surname_tradition->newSpouseNames($indi_name, $gender)); |
|
| 2586 | + break; |
|
| 2587 | + case 'add_unlinked_indi_action': |
|
| 2588 | + case 'update': |
|
| 2589 | + if ($surname_tradition->hasSurnames()) { |
|
| 2590 | + $name_fields['NAME'] = '//'; |
|
| 2591 | + } |
|
| 2592 | + break; |
|
| 2593 | 2593 | } |
| 2594 | 2594 | } |
| 2595 | 2595 | |
@@ -2609,15 +2609,15 @@ discard block |
||
| 2609 | 2609 | echo '<table class="facts_table">'; |
| 2610 | 2610 | |
| 2611 | 2611 | switch ($nextaction) { |
| 2612 | - case 'add_child_to_family_action': |
|
| 2613 | - case 'add_child_to_individual_action': |
|
| 2614 | - // When adding a new child, specify the pedigree |
|
| 2615 | - FunctionsEdit::addSimpleTag('0 PEDI'); |
|
| 2616 | - break; |
|
| 2617 | - case 'update': |
|
| 2618 | - // When adding/editing a name, specify the type |
|
| 2619 | - FunctionsEdit::addSimpleTag('0 TYPE ' . $name_type, '', '', null, $person); |
|
| 2620 | - break; |
|
| 2612 | + case 'add_child_to_family_action': |
|
| 2613 | + case 'add_child_to_individual_action': |
|
| 2614 | + // When adding a new child, specify the pedigree |
|
| 2615 | + FunctionsEdit::addSimpleTag('0 PEDI'); |
|
| 2616 | + break; |
|
| 2617 | + case 'update': |
|
| 2618 | + // When adding/editing a name, specify the type |
|
| 2619 | + FunctionsEdit::addSimpleTag('0 TYPE ' . $name_type, '', '', null, $person); |
|
| 2620 | + break; |
|
| 2621 | 2621 | } |
| 2622 | 2622 | |
| 2623 | 2623 | // First - new/existing standard name fields |