@@ -9,14 +9,14 @@ |
||
| 9 | 9 | </a> |
| 10 | 10 | <?php endif ?> |
| 11 | 11 | |
| 12 | -<?php if($value): ?> |
|
| 12 | +<?php if ($value): ?> |
|
| 13 | 13 | <span> |
| 14 | 14 | <?= $value ?> |
| 15 | 15 | </span> |
| 16 | 16 | <?php endif ?> |
| 17 | 17 | |
| 18 | 18 | <div> |
| 19 | - <?php if($addtag): ?> |
|
| 19 | + <?php if ($addtag): ?> |
|
| 20 | 20 | <?= GedcomTag::getLabel('BIRT') ?>: |
| 21 | 21 | <?php endif ?> |
| 22 | 22 | <?= $date ?> |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | </div> |
| 20 | 20 | <form method="POST" |
| 21 | 21 | action="<?=e(route('admin-module', |
| 22 | - ['module' => $module, 'action' => 'AdminPlaces', 'parent_id' => $parent_id])) ?>"> |
|
| 22 | + ['module' => $module, 'action' => 'AdminPlaces', 'parent_id' => $parent_id])) ?>"> |
|
| 23 | 23 | |
| 24 | 24 | <?= csrf_field() ?> |
| 25 | 25 | <?= Bootstrap4::checkbox( |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | <tr> |
| 55 | 55 | <td> |
| 56 | 56 | <a href="<?= e(route('admin-module', |
| 57 | - ['module' => $module, |
|
| 58 | - 'action' => 'AdminPlaces', |
|
| 59 | - 'parent_id' => $place->pl_id, |
|
| 60 | - 'inactive' => $inactive] |
|
| 61 | - ) |
|
| 62 | - ) ?>"> |
|
| 57 | + ['module' => $module, |
|
| 58 | + 'action' => 'AdminPlaces', |
|
| 59 | + 'parent_id' => $place->pl_id, |
|
| 60 | + 'inactive' => $inactive] |
|
| 61 | + ) |
|
| 62 | + ) ?>"> |
|
| 63 | 63 | <?= e($place->pl_place) ?> |
| 64 | 64 | <span class="badge badge-pill badge-<?= $place->badge ?>"> |
| 65 | 65 | <?= I18N::number($place->child_count) ?> |
@@ -68,11 +68,11 @@ discard block |
||
| 68 | 68 | </td> |
| 69 | 69 | <td> |
| 70 | 70 | <?= ($place->pl_lati === null) ? FontAwesome::decorativeIcon('warning') : |
| 71 | - strtr($place->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) ?> |
|
| 71 | + strtr($place->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) ?> |
|
| 72 | 72 | </td> |
| 73 | 73 | <td> |
| 74 | 74 | <?= ($place->pl_long === null) ? FontAwesome::decorativeIcon('warning') : |
| 75 | - strtr($place->pl_long, ['E' => '', 'W' => '-', ',' => '.']) ?> |
|
| 75 | + strtr($place->pl_long, ['E' => '', 'W' => '-', ',' => '.']) ?> |
|
| 76 | 76 | </td> |
| 77 | 77 | <td> |
| 78 | 78 | <?= $place->pl_long === null ? FontAwesome::decorativeIcon('warning') : $place->pl_zoom ?> |
@@ -67,12 +67,10 @@ discard block |
||
| 67 | 67 | </a> |
| 68 | 68 | </td> |
| 69 | 69 | <td> |
| 70 | - <?= ($place->pl_lati === null) ? FontAwesome::decorativeIcon('warning') : |
|
| 71 | - strtr($place->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) ?> |
|
| 70 | + <?= ($place->pl_lati === null) ? FontAwesome::decorativeIcon('warning') : strtr($place->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) ?> |
|
| 72 | 71 | </td> |
| 73 | 72 | <td> |
| 74 | - <?= ($place->pl_long === null) ? FontAwesome::decorativeIcon('warning') : |
|
| 75 | - strtr($place->pl_long, ['E' => '', 'W' => '-', ',' => '.']) ?> |
|
| 73 | + <?= ($place->pl_long === null) ? FontAwesome::decorativeIcon('warning') : strtr($place->pl_long, ['E' => '', 'W' => '-', ',' => '.']) ?> |
|
| 76 | 74 | </td> |
| 77 | 75 | <td> |
| 78 | 76 | <?= $place->pl_long === null ? FontAwesome::decorativeIcon('warning') : $place->pl_zoom ?> |
@@ -194,7 +192,7 @@ discard block |
||
| 194 | 192 | </tfoot> |
| 195 | 193 | </table> |
| 196 | 194 | |
| 197 | -<form method="POST" action="<?= e(route('admin-module',[ |
|
| 195 | +<form method="POST" action="<?= e(route('admin-module', [ |
|
| 198 | 196 | 'module' => $module, |
| 199 | 197 | 'action' => 'AdminImportPlaces' |
| 200 | 198 | ])) ?>"> |
@@ -1067,9 +1067,11 @@ discard block |
||
| 1067 | 1067 | $delimiter = ''; |
| 1068 | 1068 | $field_names = ['pl_level', 'pl_long', 'pl_lati', 'pl_zoom', 'pl_icon', 'fqpn']; |
| 1069 | 1069 | |
| 1070 | - if ($serverfile !== '') { // first choice is file on server |
|
| 1070 | + if ($serverfile !== '') { |
|
| 1071 | +// first choice is file on server |
|
| 1071 | 1072 | $filename = WT_MODULES_DIR . $this->getName() . '/extra/' . $serverfile; |
| 1072 | - } elseif ($_FILES['localfile']['error'] === UPLOAD_ERR_OK) { // 2nd choice is local file |
|
| 1073 | + } elseif ($_FILES['localfile']['error'] === UPLOAD_ERR_OK) { |
|
| 1074 | +// 2nd choice is local file |
|
| 1073 | 1075 | $filename = $_FILES['localfile']['tmp_name']; |
| 1074 | 1076 | } |
| 1075 | 1077 | |
@@ -1090,7 +1092,8 @@ discard block |
||
| 1090 | 1092 | $delimiter = ','; |
| 1091 | 1093 | } |
| 1092 | 1094 | if ($delimiter !== '') { |
| 1093 | - if (!is_numeric($record[0])) { // lose the header |
|
| 1095 | + if (!is_numeric($record[0])) { |
|
| 1096 | +// lose the header |
|
| 1094 | 1097 | array_shift($input_array); |
| 1095 | 1098 | } |
| 1096 | 1099 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | public function getBaseDataAction(Request $request) { |
| 208 | 208 | $provider = $this->getMapProviderData($request); |
| 209 | - $style = $provider['selectedStyleName'] = '' ? '' : '.' . $provider['selectedStyleName']; |
|
| 209 | + $style = $provider['selectedStyleName'] = '' ? '' : '.' . $provider['selectedStyleName']; |
|
| 210 | 210 | |
| 211 | 211 | switch ($provider['selectedProvIndex']) { |
| 212 | 212 | case 'mapbox': |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | $color = self::LINE_COLORS[log($id, 2) % $color_count]; |
| 294 | 294 | $icon['color'] = $color; //make icon color the same as the line |
| 295 | 295 | $sosa_points[$id] = $event->getLatLonJSArray(); |
| 296 | - $sosa_parent = (int)floor($id / 2); |
|
| 296 | + $sosa_parent = (int) floor($id / 2); |
|
| 297 | 297 | if (array_key_exists($sosa_parent, $sosa_points)) { |
| 298 | 298 | // Would like to use a GeometryCollection to hold LineStrings |
| 299 | 299 | // rather than generate polylines but the MarkerCluster library |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | 'modules/openstreetmap/event-sidebar', |
| 326 | 326 | $event->shortSummary($mapType, $id) |
| 327 | 327 | ), |
| 328 | - 'zoom' => (int)$event->getZoom(), |
|
| 328 | + 'zoom' => (int) $event->getZoom(), |
|
| 329 | 329 | ], |
| 330 | 330 | ]; |
| 331 | 331 | } |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | 'stats' => $placeStats, |
| 396 | 396 | ] |
| 397 | 397 | ), |
| 398 | - 'zoom' => (int)($location->getZoom() ?? 2), |
|
| 398 | + 'zoom' => (int) ($location->getZoom() ?? 2), |
|
| 399 | 399 | ], |
| 400 | 400 | ]; |
| 401 | 401 | } |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | $xref = $request->get('reference'); |
| 448 | 448 | $tree = $request->attributes->get('tree'); |
| 449 | 449 | $individual = Individual::getInstance($xref, $tree); |
| 450 | - $generations = (int)$request->get( |
|
| 450 | + $generations = (int) $request->get( |
|
| 451 | 451 | 'generations', |
| 452 | 452 | $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS') |
| 453 | 453 | ); |
@@ -496,14 +496,14 @@ discard block |
||
| 496 | 496 | function ($item) { |
| 497 | 497 | return preg_replace('/[^a-z\d]/i', '', strtolower($item)); |
| 498 | 498 | }, |
| 499 | - (array)$provider->styles |
|
| 499 | + (array) $provider->styles |
|
| 500 | 500 | ); |
| 501 | 501 | |
| 502 | - $key = preg_replace('/[^a-z\d]/i', '', strtolower((string)$provider->name)); |
|
| 502 | + $key = preg_replace('/[^a-z\d]/i', '', strtolower((string) $provider->name)); |
|
| 503 | 503 | |
| 504 | 504 | self::$map_providers[$key] = [ |
| 505 | - 'name' => (string)$provider->name, |
|
| 506 | - 'styles' => array_combine($style_keys, (array)$provider->styles), |
|
| 505 | + 'name' => (string) $provider->name, |
|
| 506 | + 'styles' => array_combine($style_keys, (array) $provider->styles), |
|
| 507 | 507 | ]; |
| 508 | 508 | } |
| 509 | 509 | } catch (\Exception $ex) { |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | $maxgenerations = $tree->getPreference('MAX_PEDIGREE_GENERATIONS'); |
| 566 | 566 | $generations = $request->get('generations', $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS')); |
| 567 | 567 | |
| 568 | - return (object)[ |
|
| 568 | + return (object) [ |
|
| 569 | 569 | 'name' => 'modules/openstreetmap/pedigreemap', |
| 570 | 570 | 'data' => [ |
| 571 | 571 | 'assets' => $this->assets(), |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | * @return object |
| 629 | 629 | */ |
| 630 | 630 | public function getAdminConfigAction(Request $request) { |
| 631 | - return (object)[ |
|
| 631 | + return (object) [ |
|
| 632 | 632 | 'name' => 'modules/openstreetmap/admin-config', |
| 633 | 633 | 'data' => [ |
| 634 | 634 | 'title' => I18N::translate('Open Street Maps (Configuration)'), |
@@ -684,8 +684,8 @@ discard block |
||
| 684 | 684 | * @throws \Exception |
| 685 | 685 | */ |
| 686 | 686 | public function getAdminPlacesAction(Request $request) { |
| 687 | - $parent_id = (int)$request->get('parent_id', 0); |
|
| 688 | - $inactive = (bool)$request->get('inactive'); |
|
| 687 | + $parent_id = (int) $request->get('parent_id', 0); |
|
| 688 | + $inactive = (bool) $request->get('inactive'); |
|
| 689 | 689 | $hierarchy = $this->gethierarchy($parent_id); |
| 690 | 690 | $title = I18N::translate('Open Street Maps (Geographic data)'); |
| 691 | 691 | $breadcrumbs = [ |
@@ -708,7 +708,7 @@ discard block |
||
| 708 | 708 | } |
| 709 | 709 | $breadcrumbs[] = array_pop($breadcrumbs); |
| 710 | 710 | |
| 711 | - return (object)[ |
|
| 711 | + return (object) [ |
|
| 712 | 712 | 'name' => 'modules/openstreetmap/admin-places', |
| 713 | 713 | 'data' => [ |
| 714 | 714 | 'title' => $title, |
@@ -729,9 +729,9 @@ discard block |
||
| 729 | 729 | * @throws \Exception |
| 730 | 730 | */ |
| 731 | 731 | public function getAdminPlaceEditAction(Request $request) { |
| 732 | - $parent_id = (int)$request->get('parent_id', 0); |
|
| 733 | - $place_id = (int)$request->get('place_id'); |
|
| 734 | - $inactive = (int)$request->get('inactive'); |
|
| 732 | + $parent_id = (int) $request->get('parent_id', 0); |
|
| 733 | + $place_id = (int) $request->get('place_id'); |
|
| 734 | + $inactive = (int) $request->get('inactive'); |
|
| 735 | 735 | $hierarchy = $this->gethierarchy($place_id); |
| 736 | 736 | $fqpn = empty($hierarchy) ? '' : $hierarchy[0]->fqpn; |
| 737 | 737 | $location = new Location($fqpn); |
@@ -767,7 +767,7 @@ discard block |
||
| 767 | 767 | } |
| 768 | 768 | $breadcrumbs[] = $place_id === 0 ? I18N::translate('Add') : I18N::translate('Edit'); |
| 769 | 769 | |
| 770 | - return (object)[ |
|
| 770 | + return (object) [ |
|
| 771 | 771 | 'name' => 'modules/openstreetmap/admin-place-edit', |
| 772 | 772 | 'data' => [ |
| 773 | 773 | 'module' => $this->getName(), |
@@ -793,9 +793,9 @@ discard block |
||
| 793 | 793 | */ |
| 794 | 794 | public function postAdminSaveAction(Request $request) { |
| 795 | 795 | if (Filter::checkCsrf()) { |
| 796 | - $parent_id = (int)$request->get('parent_id'); |
|
| 797 | - $place_id = (int)$request->get('place_id'); |
|
| 798 | - $inactive = (int)$request->get('inactive'); |
|
| 796 | + $parent_id = (int) $request->get('parent_id'); |
|
| 797 | + $place_id = (int) $request->get('place_id'); |
|
| 798 | + $inactive = (int) $request->get('inactive'); |
|
| 799 | 799 | $lat = round($request->get('new_place_lati'), 5); // 5 decimal places (locate to within about 1 metre) |
| 800 | 800 | $lat = ($lat < 0 ? 'S' : 'N') . abs($lat); |
| 801 | 801 | $lng = round($request->get('new_place_long'), 5); |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | VALUES (:id, :parent, :level, :place, :lng, :lat, :zoom, :icon)" |
| 815 | 815 | )->execute( |
| 816 | 816 | [ |
| 817 | - 'id' => (int)Database::prepare("SELECT MAX(pl_id)+1 FROM `##placelocation`")->fetchOne(), |
|
| 817 | + 'id' => (int) Database::prepare("SELECT MAX(pl_id)+1 FROM `##placelocation`")->fetchOne(), |
|
| 818 | 818 | 'parent' => $parent_id, |
| 819 | 819 | 'level' => $level, |
| 820 | 820 | 'place' => $request->get('new_place_name'), |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | 'place' => $request->get('new_place_name'), |
| 834 | 834 | 'lat' => $request->get('lati_control') . $lat, |
| 835 | 835 | 'lng' => $request->get('long_control') . $lng, |
| 836 | - 'zoom' => (int)$request->get('new_zoom_factor'), |
|
| 836 | + 'zoom' => (int) $request->get('new_zoom_factor'), |
|
| 837 | 837 | 'icon' => $icon, |
| 838 | 838 | ] |
| 839 | 839 | ); |
@@ -866,9 +866,9 @@ discard block |
||
| 866 | 866 | */ |
| 867 | 867 | public function postAdminDeleteRecordAction(Request $request): RedirectResponse { |
| 868 | 868 | if (Filter::checkCsrf()) { |
| 869 | - $place_id = (int)$request->get('place_id'); |
|
| 870 | - $parent_id = (int)$request->get('parent_id'); |
|
| 871 | - $inactive = (int)$request->get('inactive'); |
|
| 869 | + $place_id = (int) $request->get('place_id'); |
|
| 870 | + $parent_id = (int) $request->get('parent_id'); |
|
| 871 | + $inactive = (int) $request->get('inactive'); |
|
| 872 | 872 | |
| 873 | 873 | try { |
| 874 | 874 | Database::prepare( |
@@ -887,7 +887,7 @@ discard block |
||
| 887 | 887 | ); |
| 888 | 888 | } |
| 889 | 889 | // If after deleting there are no more places at this level then go up a level |
| 890 | - $children = (int)Database::prepare( |
|
| 890 | + $children = (int) Database::prepare( |
|
| 891 | 891 | "SELECT COUNT(pl_id) FROM `##placelocation` WHERE pl_parent_id = :parent_id" |
| 892 | 892 | ) |
| 893 | 893 | ->execute(['parent_id' => $parent_id]) |
@@ -920,9 +920,9 @@ discard block |
||
| 920 | 920 | * @throws \Exception |
| 921 | 921 | */ |
| 922 | 922 | public function getAdminExportAction(Request $request) { |
| 923 | - $parent_id = (int)$request->get('parent_id'); |
|
| 923 | + $parent_id = (int) $request->get('parent_id'); |
|
| 924 | 924 | $format = $request->get('format', 'csv'); |
| 925 | - $maxlevel = (int)Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne(); |
|
| 925 | + $maxlevel = (int) Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne(); |
|
| 926 | 926 | $startfqpn = []; |
| 927 | 927 | $hierarchy = $this->gethierarchy($parent_id); |
| 928 | 928 | $geojson = []; |
@@ -974,8 +974,8 @@ discard block |
||
| 974 | 974 | ) |
| 975 | 975 | ) |
| 976 | 976 | ); |
| 977 | - $long = (float)strtr($place['pl_long'], ['E' => '', 'W' => '-', ',' => '.']); |
|
| 978 | - $lati = (float)strtr($place['pl_lati'], ['N' => '', 'S' => '-', ',' => '.']); |
|
| 977 | + $long = (float) strtr($place['pl_long'], ['E' => '', 'W' => '-', ',' => '.']); |
|
| 978 | + $lati = (float) strtr($place['pl_lati'], ['N' => '', 'S' => '-', ',' => '.']); |
|
| 979 | 979 | |
| 980 | 980 | $geojson['features'][] = [ |
| 981 | 981 | 'type' => 'Feature', |
@@ -1007,8 +1007,8 @@ discard block |
||
| 1007 | 1007 | } |
| 1008 | 1008 | |
| 1009 | 1009 | public function getAdminImportFormAction(Request $request) { |
| 1010 | - $parent_id = (int)$request->get('parent_id'); |
|
| 1011 | - $inactive = (int)$request->get('inactive'); |
|
| 1010 | + $parent_id = (int) $request->get('parent_id'); |
|
| 1011 | + $inactive = (int) $request->get('inactive'); |
|
| 1012 | 1012 | $breadcrumbs = [ |
| 1013 | 1013 | route('admin-control-panel') => I18N::translate('Control panel'), |
| 1014 | 1014 | route('admin-modules') => I18N::translate('Module administration'), |
@@ -1034,7 +1034,7 @@ discard block |
||
| 1034 | 1034 | } |
| 1035 | 1035 | ); |
| 1036 | 1036 | |
| 1037 | - return (object)[ |
|
| 1037 | + return (object) [ |
|
| 1038 | 1038 | 'name' => 'modules/openstreetmap/admin-import-form', |
| 1039 | 1039 | 'data' => [ |
| 1040 | 1040 | 'title' => I18N::translate('Import geographic data'), |
@@ -1098,8 +1098,8 @@ discard block |
||
| 1098 | 1098 | $row = explode($delimiter, $input_array[0]); |
| 1099 | 1099 | $fields = count($row); |
| 1100 | 1100 | if ($fields >= 6 && |
| 1101 | - (bool)preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) && |
|
| 1102 | - (bool)preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) { |
|
| 1101 | + (bool) preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) && |
|
| 1102 | + (bool) preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) { |
|
| 1103 | 1103 | $filetype = 'csv'; |
| 1104 | 1104 | } |
| 1105 | 1105 | } |
@@ -1155,7 +1155,7 @@ discard block |
||
| 1155 | 1155 | } |
| 1156 | 1156 | |
| 1157 | 1157 | if ($filetype !== '?') { |
| 1158 | - if ((bool)$request->get('cleardatabase')) { |
|
| 1158 | + if ((bool) $request->get('cleardatabase')) { |
|
| 1159 | 1159 | Database::exec("TRUNCATE TABLE `##placelocation`"); |
| 1160 | 1160 | } |
| 1161 | 1161 | //process places |
@@ -1166,10 +1166,10 @@ discard block |
||
| 1166 | 1166 | usort( |
| 1167 | 1167 | $places, |
| 1168 | 1168 | function (array $a, array $b) { |
| 1169 | - if ((int)$a['pl_level'] === (int)$b['pl_level']) { |
|
| 1169 | + if ((int) $a['pl_level'] === (int) $b['pl_level']) { |
|
| 1170 | 1170 | return I18N::strcasecmp($a['fqpn'], $b['fqpn']); |
| 1171 | 1171 | } else { |
| 1172 | - return (int)$a['pl_level'] - (int)$b['pl_level']; |
|
| 1172 | + return (int) $a['pl_level'] - (int) $b['pl_level']; |
|
| 1173 | 1173 | } |
| 1174 | 1174 | } |
| 1175 | 1175 | ); |
@@ -1189,7 +1189,7 @@ discard block |
||
| 1189 | 1189 | )) { |
| 1190 | 1190 | |
| 1191 | 1191 | // overwrite |
| 1192 | - $location->update((object)$place); |
|
| 1192 | + $location->update((object) $place); |
|
| 1193 | 1193 | $updated++; |
| 1194 | 1194 | } elseif (!$valid && $options !== 'update') { |
| 1195 | 1195 | //add |
@@ -1259,7 +1259,7 @@ discard block |
||
| 1259 | 1259 | */ |
| 1260 | 1260 | public function postAdminImportPlacesAction(Request $request) { |
| 1261 | 1261 | $gedcomName = $request->get('ged'); |
| 1262 | - $inactive = (int)$request->get('inactive'); |
|
| 1262 | + $inactive = (int) $request->get('inactive'); |
|
| 1263 | 1263 | $tree = Tree::findByName($gedcomName); |
| 1264 | 1264 | |
| 1265 | 1265 | // Get all the places from the places table ... |
@@ -1478,7 +1478,7 @@ discard block |
||
| 1478 | 1478 | $list = []; |
| 1479 | 1479 | /** @var array $rows */ |
| 1480 | 1480 | foreach ($rows as $row) { |
| 1481 | - if ((bool)$row['inactive'] && !$show_inactive) { |
|
| 1481 | + if ((bool) $row['inactive'] && !$show_inactive) { |
|
| 1482 | 1482 | continue; |
| 1483 | 1483 | } |
| 1484 | 1484 | |
@@ -1489,20 +1489,20 @@ discard block |
||
| 1489 | 1489 | ] |
| 1490 | 1490 | )->fetchOneRow(); |
| 1491 | 1491 | |
| 1492 | - if ((bool)$row['inactive']) { |
|
| 1492 | + if ((bool) $row['inactive']) { |
|
| 1493 | 1493 | $badge = 'danger'; |
| 1494 | - } elseif ((int)$children->no_coord > 0) { |
|
| 1494 | + } elseif ((int) $children->no_coord > 0) { |
|
| 1495 | 1495 | $badge = 'warning'; |
| 1496 | - } elseif ((int)$children->child_count > 0) { |
|
| 1496 | + } elseif ((int) $children->child_count > 0) { |
|
| 1497 | 1497 | $badge = 'info'; |
| 1498 | 1498 | } else { |
| 1499 | 1499 | $badge = 'secondary'; |
| 1500 | 1500 | } |
| 1501 | 1501 | |
| 1502 | - $list[] = (object)array_merge( |
|
| 1502 | + $list[] = (object) array_merge( |
|
| 1503 | 1503 | $row, |
| 1504 | 1504 | [ |
| 1505 | - 'child_count' => (int)$children->child_count, |
|
| 1505 | + 'child_count' => (int) $children->child_count, |
|
| 1506 | 1506 | 'badge' => $badge, |
| 1507 | 1507 | ] |
| 1508 | 1508 | ); |
@@ -1524,7 +1524,7 @@ discard block |
||
| 1524 | 1524 | $row = $statement->execute(['id' => $id])->fetchOneRow(); |
| 1525 | 1525 | $fqpn[] = $row->pl_place; |
| 1526 | 1526 | $row->fqpn = implode(Place::GEDCOM_SEPARATOR, $fqpn); |
| 1527 | - $id = (int)$row->pl_parent_id; |
|
| 1527 | + $id = (int) $row->pl_parent_id; |
|
| 1528 | 1528 | $arr[] = $row; |
| 1529 | 1529 | } |
| 1530 | 1530 | |
@@ -1539,7 +1539,7 @@ discard block |
||
| 1539 | 1539 | */ |
| 1540 | 1540 | private function buildLevel($parent_id, $placename, &$places) { |
| 1541 | 1541 | $level = array_search('', $placename); |
| 1542 | - $rows = (array)Database::prepare( |
|
| 1542 | + $rows = (array) Database::prepare( |
|
| 1543 | 1543 | "SELECT pl_level, pl_id, pl_place, pl_long, pl_lati, pl_zoom, pl_icon FROM `##placelocation` WHERE pl_parent_id=? ORDER BY pl_place" |
| 1544 | 1544 | ) |
| 1545 | 1545 | ->execute([$parent_id]) |
@@ -10,13 +10,13 @@ |
||
| 10 | 10 | |
| 11 | 11 | <?php if ($media->isPendingDeletion()): ?> |
| 12 | 12 | <?php if (Auth::isModerator($media->getTree())): ?> |
| 13 | - <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This media object has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
|
| 13 | + <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This media object has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
|
| 14 | 14 | <?php elseif (Auth::isEditor($media->getTree())): ?> |
| 15 | 15 | <?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This media object has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
| 16 | 16 | <?php endif ?> |
| 17 | 17 | <?php elseif ($media->isPendingAddition()): ?> |
| 18 | 18 | <?php if (Auth::isModerator($media->getTree())): ?> |
| 19 | - <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This media object has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
|
| 19 | + <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This media object has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
|
| 20 | 20 | <?php elseif (Auth::isEditor($media->getTree())): ?> |
| 21 | 21 | <?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This media object has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
| 22 | 22 | <?php endif ?> |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | * You should have received a copy of the GNU General Public License |
| 14 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | 15 | */ |
| 16 | -declare(strict_types = 1); |
|
| 16 | +declare(strict_types=1); |
|
| 17 | 17 | |
| 18 | 18 | namespace Fisharebest\Webtrees; |
| 19 | 19 | |
@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | * @param array $record |
| 31 | 31 | * @throws \Exception |
| 32 | 32 | */ |
| 33 | - public function __construct($gedcomName, $record=[]) { |
|
| 33 | + public function __construct($gedcomName, $record = []) { |
|
| 34 | 34 | $tmp = $this->getRecordFromName($gedcomName); |
| 35 | 35 | if ($tmp !== null) { |
| 36 | 36 | $this->record = $tmp; |
| 37 | 37 | } elseif (!empty($record)) { |
| 38 | - $this->record = (object)$record; |
|
| 38 | + $this->record = (object) $record; |
|
| 39 | 39 | } else { |
| 40 | - $this->record = (object)[ |
|
| 40 | + $this->record = (object) [ |
|
| 41 | 41 | 'fqpn' => '', |
| 42 | 42 | 'pl_id' => 0, |
| 43 | 43 | 'pl_parent_id' => 0, |
@@ -67,8 +67,7 @@ discard block |
||
| 67 | 67 | switch ($format) { |
| 68 | 68 | case 'signed': |
| 69 | 69 | return $this->record->pl_lati ? |
| 70 | - (float)strtr($this->record->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) : |
|
| 71 | - $this->record->pl_lati; |
|
| 70 | + (float) strtr($this->record->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) : $this->record->pl_lati; |
|
| 72 | 71 | default: |
| 73 | 72 | return $this->record->pl_lati; |
| 74 | 73 | } |
@@ -83,8 +82,7 @@ discard block |
||
| 83 | 82 | switch ($format) { |
| 84 | 83 | case 'signed': |
| 85 | 84 | return $this->record->pl_long ? |
| 86 | - (float)strtr($this->record->pl_long, ['E' => '', 'W' => '-', ',' => '.']) : |
|
| 87 | - $this->record->pl_long; |
|
| 85 | + (float) strtr($this->record->pl_long, ['E' => '', 'W' => '-', ',' => '.']) : $this->record->pl_long; |
|
| 88 | 86 | default: |
| 89 | 87 | return $this->record->pl_long; |
| 90 | 88 | } |
@@ -43,14 +43,14 @@ |
||
| 43 | 43 | <?php endforeach ?> |
| 44 | 44 | </td> |
| 45 | 45 | |
| 46 | - <td class="text-center" data-sort="<?= array_sum(array_map(function(array $x) { return count($x); }, $surns)) ?>"> |
|
| 46 | + <td class="text-center" data-sort="<?= array_sum(array_map(function (array $x) { return count($x); }, $surns)) ?>"> |
|
| 47 | 47 | <?php foreach ($surns as $indis): ?> |
| 48 | 48 | <?= I18N::number(count($indis)) ?> |
| 49 | 49 | <br> |
| 50 | 50 | <?php endforeach ?> |
| 51 | 51 | |
| 52 | 52 | <?php if (count($surns) > 1): ?> |
| 53 | - <?= I18N::number(array_sum(array_map(function(array $x) { return count($x); }, $surns))) ?> |
|
| 53 | + <?= I18N::number(array_sum(array_map(function (array $x) { return count($x); }, $surns))) ?> |
|
| 54 | 54 | <?php endif ?> |
| 55 | 55 | </td> |
| 56 | 56 | </tr> |
@@ -12,7 +12,8 @@ discard block |
||
| 12 | 12 | <th> |
| 13 | 13 | <?php if ($route == 'family-list'):?> |
| 14 | 14 | <?= I18N::translate('Spouses') ?> |
| 15 | - <?php else: ?> |
|
| 15 | + <?php else { |
|
| 16 | + : ?> |
|
| 16 | 17 | <?= I18N::translate('Individuals') ?> |
| 17 | 18 | <?php endif ?> |
| 18 | 19 | </th> |
@@ -43,7 +44,9 @@ discard block |
||
| 43 | 44 | <?php endforeach ?> |
| 44 | 45 | </td> |
| 45 | 46 | |
| 46 | - <td class="text-center" data-sort="<?= array_sum(array_map(function(array $x) { return count($x); }, $surns)) ?>"> |
|
| 47 | + <td class="text-center" data-sort="<?= array_sum(array_map(function(array $x) { return count($x); |
|
| 48 | +} |
|
| 49 | +}, $surns)) ?>"> |
|
| 47 | 50 | <?php foreach ($surns as $indis): ?> |
| 48 | 51 | <?= I18N::number(count($indis)) ?> |
| 49 | 52 | <br> |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | |
| 604 | 604 | foreach ($search_terms as $n => $q) { |
| 605 | 605 | $queryregex[] = preg_quote(I18N::strtoupper($q), '/'); |
| 606 | - $sql .= " AND f_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 606 | + $sql .= " AND f_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 607 | 607 | $args['collate_' . $n] = I18N::collation(); |
| 608 | 608 | $args['query_' . $n] = Database::escapeLike($q); |
| 609 | 609 | } |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | * @return Family[] |
| 651 | 651 | */ |
| 652 | 652 | private function searchFamilyNames(array $search_terms, array $search_trees): array { |
| 653 | - $sql = |
|
| 653 | + $sql = |
|
| 654 | 654 | "SELECT DISTINCT f_id AS xref, f_file AS gedcom_id, f_gedcom AS gedcom" . |
| 655 | 655 | " FROM `##families`" . |
| 656 | 656 | " LEFT JOIN `##name` husb ON f_husb = husb.n_id AND f_file = husb.n_file" . |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | $args = []; |
| 660 | 660 | |
| 661 | 661 | foreach ($search_terms as $n => $q) { |
| 662 | - $sql .= " AND (husb.n_full COLLATE :husb_collate_" . $n . " LIKE CONCAT('%', :husb_query_" . $n . ", '%') OR wife.n_full COLLATE :wife_collate_" . $n . " LIKE CONCAT('%', :wife_query_" . $n . ", '%'))"; |
|
| 662 | + $sql .= " AND (husb.n_full COLLATE :husb_collate_" . $n . " LIKE CONCAT('%', :husb_query_" . $n . ", '%') OR wife.n_full COLLATE :wife_collate_" . $n . " LIKE CONCAT('%', :wife_query_" . $n . ", '%'))"; |
|
| 663 | 663 | $args['husb_collate_' . $n] = I18N::collation(); |
| 664 | 664 | $args['husb_query_' . $n] = Database::escapeLike($q); |
| 665 | 665 | $args['wife_collate_' . $n] = I18N::collation(); |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | |
| 711 | 711 | foreach ($search_terms as $n => $q) { |
| 712 | 712 | $queryregex[] = preg_quote(I18N::strtoupper($q), '/'); |
| 713 | - $sql .= " AND i_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 713 | + $sql .= " AND i_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 714 | 714 | $args['collate_' . $n] = I18N::collation(); |
| 715 | 715 | $args['query_' . $n] = Database::escapeLike($q); |
| 716 | 716 | } |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | } |
| 856 | 856 | |
| 857 | 857 | // Add the where clause |
| 858 | - $sql .= " WHERE ind.i_file=?"; |
|
| 858 | + $sql .= " WHERE ind.i_file=?"; |
|
| 859 | 859 | $bind[] = $this->tree()->getTreeId(); |
| 860 | 860 | |
| 861 | 861 | foreach ($fields as $field_name => $field_value) { |
@@ -866,15 +866,15 @@ discard block |
||
| 866 | 866 | case 'GIVN': |
| 867 | 867 | switch ($modifiers[$field_name]) { |
| 868 | 868 | case 'EXACT': |
| 869 | - $sql .= " AND i_n.n_givn=?"; |
|
| 869 | + $sql .= " AND i_n.n_givn=?"; |
|
| 870 | 870 | $bind[] = $field_value; |
| 871 | 871 | break; |
| 872 | 872 | case 'BEGINS': |
| 873 | - $sql .= " AND i_n.n_givn LIKE CONCAT(?, '%')"; |
|
| 873 | + $sql .= " AND i_n.n_givn LIKE CONCAT(?, '%')"; |
|
| 874 | 874 | $bind[] = $field_value; |
| 875 | 875 | break; |
| 876 | 876 | case 'CONTAINS': |
| 877 | - $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 877 | + $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 878 | 878 | $bind[] = $field_value; |
| 879 | 879 | break; |
| 880 | 880 | case 'SDX_STD': |
@@ -888,7 +888,7 @@ discard block |
||
| 888 | 888 | $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
| 889 | 889 | } else { |
| 890 | 890 | // No phonetic content? Use a substring match |
| 891 | - $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 891 | + $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 892 | 892 | $bind[] = $field_value; |
| 893 | 893 | } |
| 894 | 894 | break; |
@@ -904,7 +904,7 @@ discard block |
||
| 904 | 904 | $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
| 905 | 905 | } else { |
| 906 | 906 | // No phonetic content? Use a substring match |
| 907 | - $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 907 | + $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 908 | 908 | $bind[] = $field_value; |
| 909 | 909 | } |
| 910 | 910 | break; |
@@ -913,15 +913,15 @@ discard block |
||
| 913 | 913 | case 'SURN': |
| 914 | 914 | switch ($modifiers[$field_name]) { |
| 915 | 915 | case 'EXACT': |
| 916 | - $sql .= " AND i_n.n_surname=?"; |
|
| 916 | + $sql .= " AND i_n.n_surname=?"; |
|
| 917 | 917 | $bind[] = $field_value; |
| 918 | 918 | break; |
| 919 | 919 | case 'BEGINS': |
| 920 | - $sql .= " AND i_n.n_surname LIKE CONCAT(?, '%')"; |
|
| 920 | + $sql .= " AND i_n.n_surname LIKE CONCAT(?, '%')"; |
|
| 921 | 921 | $bind[] = $field_value; |
| 922 | 922 | break; |
| 923 | 923 | case 'CONTAINS': |
| 924 | - $sql .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')"; |
|
| 924 | + $sql .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')"; |
|
| 925 | 925 | $bind[] = $field_value; |
| 926 | 926 | break; |
| 927 | 927 | case 'SDX_STD': |
@@ -935,7 +935,7 @@ discard block |
||
| 935 | 935 | $sql .= " AND (" . implode(' OR ', $sdx) . ")"; |
| 936 | 936 | } else { |
| 937 | 937 | // No phonetic content? Use a substring match |
| 938 | - $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')"; |
|
| 938 | + $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')"; |
|
| 939 | 939 | $bind[] = $field_value; |
| 940 | 940 | } |
| 941 | 941 | break; |
@@ -952,7 +952,7 @@ discard block |
||
| 952 | 952 | break; |
| 953 | 953 | } else { |
| 954 | 954 | // No phonetic content? Use a substring match |
| 955 | - $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')"; |
|
| 955 | + $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')"; |
|
| 956 | 956 | $bind[] = $field_value; |
| 957 | 957 | } |
| 958 | 958 | } |
@@ -961,7 +961,7 @@ discard block |
||
| 961 | 961 | case '_MARNM': |
| 962 | 962 | case '_HEB': |
| 963 | 963 | case '_AKA': |
| 964 | - $sql .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')"; |
|
| 964 | + $sql .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')"; |
|
| 965 | 965 | $bind[] = $parts[1]; |
| 966 | 966 | $bind[] = $field_value; |
| 967 | 967 | break; |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | $date = new Date($field_value); |
| 972 | 972 | if ($date->isOK()) { |
| 973 | 973 | $delta = 365 * ($modifiers[$field_name] ?? 0); |
| 974 | - $sql .= " AND i_d.d_fact=? AND i_d.d_julianday1>=? AND i_d.d_julianday2<=?"; |
|
| 974 | + $sql .= " AND i_d.d_fact=? AND i_d.d_julianday1>=? AND i_d.d_julianday2<=?"; |
|
| 975 | 975 | $bind[] = $parts[0]; |
| 976 | 976 | $bind[] = $date->minimumJulianDay() - $delta; |
| 977 | 977 | $bind[] = $date->maximumJulianDay() + $delta; |
@@ -981,7 +981,7 @@ discard block |
||
| 981 | 981 | $date = new Date($field_value); |
| 982 | 982 | if ($date->isOK()) { |
| 983 | 983 | $delta = 365 * $modifiers[$field_name]; |
| 984 | - $sql .= " AND f_d.d_fact=? AND f_d.d_julianday1>=? AND f_d.d_julianday2<=?"; |
|
| 984 | + $sql .= " AND f_d.d_fact=? AND f_d.d_julianday1>=? AND f_d.d_julianday2<=?"; |
|
| 985 | 985 | $bind[] = $parts[1]; |
| 986 | 986 | $bind[] = $date->minimumJulianDay() - $delta; |
| 987 | 987 | $bind[] = $date->maximumJulianDay() + $delta; |
@@ -989,12 +989,12 @@ discard block |
||
| 989 | 989 | } elseif ($parts[1] === 'PLAC') { |
| 990 | 990 | // *:PLAC |
| 991 | 991 | // SQL can only link a place to a person/family, not to an event. |
| 992 | - $sql .= " AND i_p.place LIKE CONCAT('%', ?, '%')"; |
|
| 992 | + $sql .= " AND i_p.place LIKE CONCAT('%', ?, '%')"; |
|
| 993 | 993 | $bind[] = $field_value; |
| 994 | 994 | } elseif ($parts[0] === 'FAMS' && $parts[2] === 'PLAC') { |
| 995 | 995 | // FAMS:*:PLAC |
| 996 | 996 | // SQL can only link a place to a person/family, not to an event. |
| 997 | - $sql .= " AND f_p.place LIKE CONCAT('%', ?, '%')"; |
|
| 997 | + $sql .= " AND f_p.place LIKE CONCAT('%', ?, '%')"; |
|
| 998 | 998 | $bind[] = $field_value; |
| 999 | 999 | } elseif ($parts[0] === 'FAMC' && $parts[2] === 'NAME') { |
| 1000 | 1000 | $table = $parts[1] === 'HUSB' ? 'f_n' : 'm_n'; |
@@ -1003,15 +1003,15 @@ discard block |
||
| 1003 | 1003 | case 'GIVN': |
| 1004 | 1004 | switch ($modifiers[$field_name]) { |
| 1005 | 1005 | case 'EXACT': |
| 1006 | - $sql .= " AND {$table}.n_givn=?"; |
|
| 1006 | + $sql .= " AND {$table}.n_givn=?"; |
|
| 1007 | 1007 | $bind[] = $field_value; |
| 1008 | 1008 | break; |
| 1009 | 1009 | case 'BEGINS': |
| 1010 | - $sql .= " AND {$table}.n_givn LIKE CONCAT(?, '%')"; |
|
| 1010 | + $sql .= " AND {$table}.n_givn LIKE CONCAT(?, '%')"; |
|
| 1011 | 1011 | $bind[] = $field_value; |
| 1012 | 1012 | break; |
| 1013 | 1013 | case 'CONTAINS': |
| 1014 | - $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 1014 | + $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 1015 | 1015 | $bind[] = $field_value; |
| 1016 | 1016 | break; |
| 1017 | 1017 | case 'SDX_STD': |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
| 1026 | 1026 | } else { |
| 1027 | 1027 | // No phonetic content? Use a substring match |
| 1028 | - $sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')"; |
|
| 1028 | + $sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')"; |
|
| 1029 | 1029 | $bind[] = $field_value; |
| 1030 | 1030 | } |
| 1031 | 1031 | break; |
@@ -1042,7 +1042,7 @@ discard block |
||
| 1042 | 1042 | break; |
| 1043 | 1043 | } else { |
| 1044 | 1044 | // No phonetic content? Use a substring match |
| 1045 | - $sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')"; |
|
| 1045 | + $sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')"; |
|
| 1046 | 1046 | $bind[] = $field_value; |
| 1047 | 1047 | } |
| 1048 | 1048 | } |
@@ -1050,15 +1050,15 @@ discard block |
||
| 1050 | 1050 | case 'SURN': |
| 1051 | 1051 | switch ($modifiers[$field_name]) { |
| 1052 | 1052 | case 'EXACT': |
| 1053 | - $sql .= " AND {$table}.n_surname=?"; |
|
| 1053 | + $sql .= " AND {$table}.n_surname=?"; |
|
| 1054 | 1054 | $bind[] = $field_value; |
| 1055 | 1055 | break; |
| 1056 | 1056 | case 'BEGINS': |
| 1057 | - $sql .= " AND {$table}.n_surname LIKE CONCAT(?, '%')"; |
|
| 1057 | + $sql .= " AND {$table}.n_surname LIKE CONCAT(?, '%')"; |
|
| 1058 | 1058 | $bind[] = $field_value; |
| 1059 | 1059 | break; |
| 1060 | 1060 | case 'CONTAINS': |
| 1061 | - $sql .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')"; |
|
| 1061 | + $sql .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')"; |
|
| 1062 | 1062 | $bind[] = $field_value; |
| 1063 | 1063 | break; |
| 1064 | 1064 | case 'SDX_STD': |
@@ -1072,7 +1072,7 @@ discard block |
||
| 1072 | 1072 | $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
| 1073 | 1073 | } else { |
| 1074 | 1074 | // No phonetic content? Use a substring match |
| 1075 | - $sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')"; |
|
| 1075 | + $sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')"; |
|
| 1076 | 1076 | $bind[] = $field_value; |
| 1077 | 1077 | } |
| 1078 | 1078 | break; |
@@ -1088,7 +1088,7 @@ discard block |
||
| 1088 | 1088 | $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
| 1089 | 1089 | } else { |
| 1090 | 1090 | // No phonetic content? Use a substring match |
| 1091 | - $sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')"; |
|
| 1091 | + $sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')"; |
|
| 1092 | 1092 | $bind[] = $field_value; |
| 1093 | 1093 | } |
| 1094 | 1094 | break; |
@@ -1097,17 +1097,17 @@ discard block |
||
| 1097 | 1097 | } |
| 1098 | 1098 | } elseif ($parts[0] === 'FAMS') { |
| 1099 | 1099 | // e.g. searches for occupation, religion, note, etc. |
| 1100 | - $sql .= " AND fam.f_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)"; |
|
| 1100 | + $sql .= " AND fam.f_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)"; |
|
| 1101 | 1101 | $bind[] = $parts[1]; |
| 1102 | 1102 | $bind[] = $field_value; |
| 1103 | 1103 | } elseif ($parts[1] === 'TYPE') { |
| 1104 | 1104 | // e.g. FACT:TYPE or EVEN:TYPE |
| 1105 | - $sql .= " AND ind.i_gedcom REGEXP CONCAT('\n1 ', ?, '.*(\n[2-9] .*)*\n2 TYPE .*', ?)"; |
|
| 1105 | + $sql .= " AND ind.i_gedcom REGEXP CONCAT('\n1 ', ?, '.*(\n[2-9] .*)*\n2 TYPE .*', ?)"; |
|
| 1106 | 1106 | $bind[] = $parts[0]; |
| 1107 | 1107 | $bind[] = $field_value; |
| 1108 | 1108 | } else { |
| 1109 | 1109 | // e.g. searches for occupation, religion, note, etc. |
| 1110 | - $sql .= " AND ind.i_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)"; |
|
| 1110 | + $sql .= " AND ind.i_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)"; |
|
| 1111 | 1111 | $bind[] = $parts[0]; |
| 1112 | 1112 | $bind[] = $field_value; |
| 1113 | 1113 | } |
@@ -1185,7 +1185,7 @@ discard block |
||
| 1185 | 1185 | $sql .= ")"; |
| 1186 | 1186 | |
| 1187 | 1187 | if ($givn_sdx !== '') { |
| 1188 | - $sql .= " AND ("; |
|
| 1188 | + $sql .= " AND ("; |
|
| 1189 | 1189 | $givn_sdx = explode(':', $givn_sdx); |
| 1190 | 1190 | foreach ($givn_sdx as $n => $sdx) { |
| 1191 | 1191 | $sql .= $n > 0 ? " OR " : ""; |
@@ -1203,7 +1203,7 @@ discard block |
||
| 1203 | 1203 | } |
| 1204 | 1204 | |
| 1205 | 1205 | if ($surn_sdx !== '') { |
| 1206 | - $sql .= " AND ("; |
|
| 1206 | + $sql .= " AND ("; |
|
| 1207 | 1207 | $surn_sdx = explode(':', $surn_sdx); |
| 1208 | 1208 | foreach ($surn_sdx as $n => $sdx) { |
| 1209 | 1209 | $sql .= $n ? " OR " : ""; |
@@ -1221,7 +1221,7 @@ discard block |
||
| 1221 | 1221 | } |
| 1222 | 1222 | |
| 1223 | 1223 | if ($plac_sdx !== '') { |
| 1224 | - $sql .= " AND ("; |
|
| 1224 | + $sql .= " AND ("; |
|
| 1225 | 1225 | $plac_sdx = explode(':', $plac_sdx); |
| 1226 | 1226 | foreach ($plac_sdx as $n => $sdx) { |
| 1227 | 1227 | $sql .= $n ? " OR " : ""; |
@@ -1267,7 +1267,7 @@ discard block |
||
| 1267 | 1267 | |
| 1268 | 1268 | foreach ($search_terms as $n => $q) { |
| 1269 | 1269 | $queryregex[] = preg_quote(I18N::strtoupper($q), '/'); |
| 1270 | - $sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 1270 | + $sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 1271 | 1271 | $args['collate_' . $n] = I18N::collation(); |
| 1272 | 1272 | $args['query_' . $n] = Database::escapeLike($q); |
| 1273 | 1273 | } |
@@ -1322,7 +1322,7 @@ discard block |
||
| 1322 | 1322 | |
| 1323 | 1323 | foreach ($search_terms as $n => $q) { |
| 1324 | 1324 | $queryregex[] = preg_quote(I18N::strtoupper($q), '/'); |
| 1325 | - $sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 1325 | + $sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 1326 | 1326 | $args['collate_' . $n] = I18N::collation(); |
| 1327 | 1327 | $args['query_' . $n] = Database::escapeLike($q); |
| 1328 | 1328 | } |
@@ -1377,7 +1377,7 @@ discard block |
||
| 1377 | 1377 | |
| 1378 | 1378 | foreach ($search_terms as $n => $q) { |
| 1379 | 1379 | $queryregex[] = preg_quote(I18N::strtoupper($q), '/'); |
| 1380 | - $sql .= " AND s_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 1380 | + $sql .= " AND s_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 1381 | 1381 | $args['collate_' . $n] = I18N::collation(); |
| 1382 | 1382 | $args['query_' . $n] = Database::escapeLike($q); |
| 1383 | 1383 | } |
@@ -50,14 +50,14 @@ discard block |
||
| 50 | 50 | $osm_module = Module::getModuleByName(self::MAP_MODULE); |
| 51 | 51 | $method = 'assets'; |
| 52 | 52 | $showmap = $osm_module && |
| 53 | - (bool)$osm_module->getPreference('place_hierarchy') && |
|
| 53 | + (bool) $osm_module->getPreference('place_hierarchy') && |
|
| 54 | 54 | method_exists($osm_module, $method) && |
| 55 | 55 | strpos($action, 'hierarchy') === 0; |
| 56 | 56 | $data = null; |
| 57 | 57 | $note = false; |
| 58 | 58 | |
| 59 | 59 | if ($showmap) { |
| 60 | - $note = true; |
|
| 60 | + $note = true; |
|
| 61 | 61 | $content .= view('modules/openstreetmap/map', |
| 62 | 62 | [ |
| 63 | 63 | 'assets' => $osm_module->$method(), |
@@ -70,14 +70,14 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | switch ($action) { |
| 72 | 72 | case 'list': |
| 73 | - $nextaction = ['hierarchy' => I18N::translate('Show place hierarchy')]; |
|
| 74 | - $content .= view('place-list', $this->getList($tree)); |
|
| 73 | + $nextaction = ['hierarchy' => I18N::translate('Show place hierarchy')]; |
|
| 74 | + $content .= view('place-list', $this->getList($tree)); |
|
| 75 | 75 | break; |
| 76 | 76 | case 'hierarchy': |
| 77 | 77 | case 'hierarchy-e': |
| 78 | 78 | $nextaction = ['list' => I18N::translate('Show all places in a list')]; |
| 79 | 79 | $data = $this->getHierarchy($tree, $place, $parent); |
| 80 | - $content .= (null === $data || $showmap) ? '' : view('place-hierarchy', $data); |
|
| 80 | + $content .= (null === $data || $showmap) ? '' : view('place-hierarchy', $data); |
|
| 81 | 81 | if (null === $data || $action === 'hierarchy-e') { |
| 82 | 82 | $content .= view('place-events', $this->getEvents($tree, $place)); |
| 83 | 83 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | return |
| 119 | 119 | [ |
| 120 | - 'columns' => array_chunk($list_places, (int)ceil($numfound / $divisor)), |
|
| 120 | + 'columns' => array_chunk($list_places, (int) ceil($numfound / $divisor)), |
|
| 121 | 121 | ]; |
| 122 | 122 | } |
| 123 | 123 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | [ |
| 140 | 140 | 'tree' => $tree, |
| 141 | 141 | 'col_class' => "w-" . ($divisor === 2 ? "25" : "50"), |
| 142 | - 'columns' => array_chunk($child_places, (int)ceil($numfound / $divisor)), |
|
| 142 | + 'columns' => array_chunk($child_places, (int) ceil($numfound / $divisor)), |
|
| 143 | 143 | 'place' => $place, |
| 144 | 144 | 'parent' => $parent, |
| 145 | 145 | ]; |
@@ -170,7 +170,7 @@ |
||
| 170 | 170 | echo '<table cellspacing="0" cellpadding="0" border="0" >'; |
| 171 | 171 | foreach ($children as $i => $child) { |
| 172 | 172 | echo '<tr><td>'; |
| 173 | - $kids = $this->printDescendency($child, $generation + 1); |
|
| 173 | + $kids = $this->printDescendency($child, $generation + 1); |
|
| 174 | 174 | $numkids += $kids; |
| 175 | 175 | echo '</td>'; |
| 176 | 176 | // Print the lines |