@@ -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 |
@@ -161,7 +161,7 @@ |
||
| 161 | 161 | * @return Response |
| 162 | 162 | */ |
| 163 | 163 | public function getPersonsAction(Request $request): Response { |
| 164 | - $q = $request->get('q'); |
|
| 164 | + $q = $request->get('q'); |
|
| 165 | 165 | $instance = $request->get('instance'); |
| 166 | 166 | $treeview = new TreeView($instance); |
| 167 | 167 | |
@@ -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 | |
@@ -529,8 +529,8 @@ discard block |
||
| 529 | 529 | case 'BaseData': |
| 530 | 530 | $varName = (self::$map_selections['style'] === '') ? '' : self::$map_providers[self::$map_selections['provider']]['styles'][self::$map_selections['style']]; |
| 531 | 531 | $payload = ['selectedProvIndex' => self::$map_selections['provider'], |
| 532 | - 'selectedProvName' => self::$map_providers[self::$map_selections['provider']]['name'], |
|
| 533 | - 'selectedStyleName' => $varName, |
|
| 532 | + 'selectedProvName' => self::$map_providers[self::$map_selections['provider']]['name'], |
|
| 533 | + 'selectedStyleName' => $varName, |
|
| 534 | 534 | ]; |
| 535 | 535 | break; |
| 536 | 536 | case 'ProviderStyles': |
@@ -543,9 +543,9 @@ discard block |
||
| 543 | 543 | $providers[$key] = $provider['name']; |
| 544 | 544 | } |
| 545 | 545 | $payload = ['providers' => $providers, |
| 546 | - 'selectedProv' => self::$map_selections['provider'], |
|
| 547 | - 'styles' => self::$map_providers[self::$map_selections['provider']]['styles'], |
|
| 548 | - 'selectedStyle' => self::$map_selections['style'], |
|
| 546 | + 'selectedProv' => self::$map_selections['provider'], |
|
| 547 | + 'styles' => self::$map_providers[self::$map_selections['provider']]['styles'], |
|
| 548 | + 'selectedStyle' => self::$map_selections['style'], |
|
| 549 | 549 | ]; |
| 550 | 550 | break; |
| 551 | 551 | default: |
@@ -1105,8 +1105,8 @@ discard block |
||
| 1105 | 1105 | $row = explode($delimiter, $input_array[0]); |
| 1106 | 1106 | $fields = count($row); |
| 1107 | 1107 | if ($fields >= 6 && |
| 1108 | - (bool)preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) && |
|
| 1109 | - (bool)preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) { |
|
| 1108 | + (bool)preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) && |
|
| 1109 | + (bool)preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) { |
|
| 1110 | 1110 | $filetype = 'csv'; |
| 1111 | 1111 | } |
| 1112 | 1112 | } |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | $color = self::LINE_COLORS[log($id, 2) % $color_count]; |
| 297 | 297 | $icon['color'] = $color; //make icon color the same as the line |
| 298 | 298 | $sosa_points[$id] = $event->getLatLonJSArray(); |
| 299 | - $sosa_parent = (int)floor($id / 2); |
|
| 299 | + $sosa_parent = (int) floor($id / 2); |
|
| 300 | 300 | if (array_key_exists($sosa_parent, $sosa_points)) { |
| 301 | 301 | // Would like to use a GeometryCollection to hold LineStrings |
| 302 | 302 | // rather than generate polylines but the MarkerCluster library |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | 'modules/openstreetmap/event-sidebar', |
| 329 | 329 | $event->shortSummary($mapType, $id) |
| 330 | 330 | ), |
| 331 | - 'zoom' => (int)$event->getZoom(), |
|
| 331 | + 'zoom' => (int) $event->getZoom(), |
|
| 332 | 332 | ], |
| 333 | 333 | ]; |
| 334 | 334 | } |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | 'stats' => $placeStats, |
| 399 | 399 | ] |
| 400 | 400 | ), |
| 401 | - 'zoom' => (int)($location->getZoom() ?? 2), |
|
| 401 | + 'zoom' => (int) ($location->getZoom() ?? 2), |
|
| 402 | 402 | ], |
| 403 | 403 | ]; |
| 404 | 404 | } |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | $xref = $request->get('reference'); |
| 451 | 451 | $tree = $request->attributes->get('tree'); |
| 452 | 452 | $individual = Individual::getInstance($xref, $tree); |
| 453 | - $generations = (int)$request->get( |
|
| 453 | + $generations = (int) $request->get( |
|
| 454 | 454 | 'generations', |
| 455 | 455 | $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS') |
| 456 | 456 | ); |
@@ -499,14 +499,14 @@ discard block |
||
| 499 | 499 | function ($item) { |
| 500 | 500 | return preg_replace('/[^a-z\d]/i', '', strtolower($item)); |
| 501 | 501 | }, |
| 502 | - (array)$provider->styles |
|
| 502 | + (array) $provider->styles |
|
| 503 | 503 | ); |
| 504 | 504 | |
| 505 | - $key = preg_replace('/[^a-z\d]/i', '', strtolower((string)$provider->name)); |
|
| 505 | + $key = preg_replace('/[^a-z\d]/i', '', strtolower((string) $provider->name)); |
|
| 506 | 506 | |
| 507 | 507 | self::$map_providers[$key] = [ |
| 508 | - 'name' => (string)$provider->name, |
|
| 509 | - 'styles' => array_combine($style_keys, (array)$provider->styles), |
|
| 508 | + 'name' => (string) $provider->name, |
|
| 509 | + 'styles' => array_combine($style_keys, (array) $provider->styles), |
|
| 510 | 510 | ]; |
| 511 | 511 | } |
| 512 | 512 | } catch (\Exception $ex) { |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | 'provider' => 'openstreetmap', |
| 516 | 516 | 'style' => 'mapnik', |
| 517 | 517 | ]; |
| 518 | - self::$map_providers = [ |
|
| 518 | + self::$map_providers = [ |
|
| 519 | 519 | 'openstreetmap' => [ |
| 520 | 520 | 'name' => 'OpenStreetMap', |
| 521 | 521 | 'styles' => ['mapnik' => 'Mapnik'], |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | $maxgenerations = $tree->getPreference('MAX_PEDIGREE_GENERATIONS'); |
| 569 | 569 | $generations = $request->get('generations', $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS')); |
| 570 | 570 | |
| 571 | - return (object)[ |
|
| 571 | + return (object) [ |
|
| 572 | 572 | 'name' => 'modules/openstreetmap/pedigreemap', |
| 573 | 573 | 'data' => [ |
| 574 | 574 | 'assets' => $this->assets(), |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | * @return object |
| 632 | 632 | */ |
| 633 | 633 | public function getAdminConfigAction(Request $request) { |
| 634 | - return (object)[ |
|
| 634 | + return (object) [ |
|
| 635 | 635 | 'name' => 'modules/openstreetmap/admin-config', |
| 636 | 636 | 'data' => [ |
| 637 | 637 | 'title' => I18N::translate('Open Street Maps (Configuration)'), |
@@ -687,8 +687,8 @@ discard block |
||
| 687 | 687 | * @throws \Exception |
| 688 | 688 | */ |
| 689 | 689 | public function getAdminPlacesAction(Request $request) { |
| 690 | - $parent_id = (int)$request->get('parent_id', 0); |
|
| 691 | - $inactive = (bool)$request->get('inactive'); |
|
| 690 | + $parent_id = (int) $request->get('parent_id', 0); |
|
| 691 | + $inactive = (bool) $request->get('inactive'); |
|
| 692 | 692 | $hierarchy = $this->gethierarchy($parent_id); |
| 693 | 693 | $title = I18N::translate('Open Street Maps (Geographic data)'); |
| 694 | 694 | $breadcrumbs = [ |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | } |
| 712 | 712 | $breadcrumbs[] = array_pop($breadcrumbs); |
| 713 | 713 | |
| 714 | - return (object)[ |
|
| 714 | + return (object) [ |
|
| 715 | 715 | 'name' => 'modules/openstreetmap/admin-places', |
| 716 | 716 | 'data' => [ |
| 717 | 717 | 'title' => $title, |
@@ -732,9 +732,9 @@ discard block |
||
| 732 | 732 | * @throws \Exception |
| 733 | 733 | */ |
| 734 | 734 | public function getAdminPlaceEditAction(Request $request) { |
| 735 | - $parent_id = (int)$request->get('parent_id', 0); |
|
| 736 | - $place_id = (int)$request->get('place_id'); |
|
| 737 | - $inactive = (int)$request->get('inactive'); |
|
| 735 | + $parent_id = (int) $request->get('parent_id', 0); |
|
| 736 | + $place_id = (int) $request->get('place_id'); |
|
| 737 | + $inactive = (int) $request->get('inactive'); |
|
| 738 | 738 | $hierarchy = $this->gethierarchy($place_id); |
| 739 | 739 | $fqpn = empty($hierarchy) ? '' : $hierarchy[0]->fqpn; |
| 740 | 740 | $location = new Location($fqpn); |
@@ -770,7 +770,7 @@ discard block |
||
| 770 | 770 | } |
| 771 | 771 | $breadcrumbs[] = $place_id === 0 ? I18N::translate('Add') : I18N::translate('Edit'); |
| 772 | 772 | |
| 773 | - return (object)[ |
|
| 773 | + return (object) [ |
|
| 774 | 774 | 'name' => 'modules/openstreetmap/admin-place-edit', |
| 775 | 775 | 'data' => [ |
| 776 | 776 | 'module' => $this->getName(), |
@@ -796,9 +796,9 @@ discard block |
||
| 796 | 796 | */ |
| 797 | 797 | public function postAdminSaveAction(Request $request): RedirectResponse { |
| 798 | 798 | if (Filter::checkCsrf()) { |
| 799 | - $parent_id = (int)$request->get('parent_id'); |
|
| 800 | - $place_id = (int)$request->get('place_id'); |
|
| 801 | - $inactive = (int)$request->get('inactive'); |
|
| 799 | + $parent_id = (int) $request->get('parent_id'); |
|
| 800 | + $place_id = (int) $request->get('place_id'); |
|
| 801 | + $inactive = (int) $request->get('inactive'); |
|
| 802 | 802 | $lat = round($request->get('new_place_lati'), 5); // 5 decimal places (locate to within about 1 metre) |
| 803 | 803 | $lat = ($lat < 0 ? 'S' : 'N') . abs($lat); |
| 804 | 804 | $lng = round($request->get('new_place_long'), 5); |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | VALUES (:id, :parent, :level, :place, :lng, :lat, :zoom, :icon)" |
| 818 | 818 | )->execute( |
| 819 | 819 | [ |
| 820 | - 'id' => (int)Database::prepare("SELECT MAX(pl_id)+1 FROM `##placelocation`")->fetchOne(), |
|
| 820 | + 'id' => (int) Database::prepare("SELECT MAX(pl_id)+1 FROM `##placelocation`")->fetchOne(), |
|
| 821 | 821 | 'parent' => $parent_id, |
| 822 | 822 | 'level' => $level, |
| 823 | 823 | 'place' => $request->get('new_place_name'), |
@@ -836,7 +836,7 @@ discard block |
||
| 836 | 836 | 'place' => $request->get('new_place_name'), |
| 837 | 837 | 'lat' => $request->get('lati_control') . $lat, |
| 838 | 838 | 'lng' => $request->get('long_control') . $lng, |
| 839 | - 'zoom' => (int)$request->get('new_zoom_factor'), |
|
| 839 | + 'zoom' => (int) $request->get('new_zoom_factor'), |
|
| 840 | 840 | 'icon' => $icon, |
| 841 | 841 | ] |
| 842 | 842 | ); |
@@ -869,9 +869,9 @@ discard block |
||
| 869 | 869 | */ |
| 870 | 870 | public function postAdminDeleteRecordAction(Request $request): RedirectResponse { |
| 871 | 871 | if (Filter::checkCsrf()) { |
| 872 | - $place_id = (int)$request->get('place_id'); |
|
| 873 | - $parent_id = (int)$request->get('parent_id'); |
|
| 874 | - $inactive = (int)$request->get('inactive'); |
|
| 872 | + $place_id = (int) $request->get('place_id'); |
|
| 873 | + $parent_id = (int) $request->get('parent_id'); |
|
| 874 | + $inactive = (int) $request->get('inactive'); |
|
| 875 | 875 | |
| 876 | 876 | try { |
| 877 | 877 | Database::prepare( |
@@ -890,7 +890,7 @@ discard block |
||
| 890 | 890 | ); |
| 891 | 891 | } |
| 892 | 892 | // If after deleting there are no more places at this level then go up a level |
| 893 | - $children = (int)Database::prepare( |
|
| 893 | + $children = (int) Database::prepare( |
|
| 894 | 894 | "SELECT COUNT(pl_id) FROM `##placelocation` WHERE pl_parent_id = :parent_id" |
| 895 | 895 | ) |
| 896 | 896 | ->execute(['parent_id' => $parent_id]) |
@@ -923,9 +923,9 @@ discard block |
||
| 923 | 923 | * @throws \Exception |
| 924 | 924 | */ |
| 925 | 925 | public function getAdminExportAction(Request $request): RedirectResponse { |
| 926 | - $parent_id = (int)$request->get('parent_id'); |
|
| 926 | + $parent_id = (int) $request->get('parent_id'); |
|
| 927 | 927 | $format = $request->get('format', 'csv'); |
| 928 | - $maxlevel = (int)Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne(); |
|
| 928 | + $maxlevel = (int) Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne(); |
|
| 929 | 929 | $startfqpn = []; |
| 930 | 930 | $hierarchy = $this->gethierarchy($parent_id); |
| 931 | 931 | $geojson = []; |
@@ -977,8 +977,8 @@ discard block |
||
| 977 | 977 | ) |
| 978 | 978 | ) |
| 979 | 979 | ); |
| 980 | - $long = (float)strtr($place['pl_long'], ['E' => '', 'W' => '-', ',' => '.']); |
|
| 981 | - $lati = (float)strtr($place['pl_lati'], ['N' => '', 'S' => '-', ',' => '.']); |
|
| 980 | + $long = (float) strtr($place['pl_long'], ['E' => '', 'W' => '-', ',' => '.']); |
|
| 981 | + $lati = (float) strtr($place['pl_lati'], ['N' => '', 'S' => '-', ',' => '.']); |
|
| 982 | 982 | |
| 983 | 983 | $geojson['features'][] = [ |
| 984 | 984 | 'type' => 'Feature', |
@@ -1014,8 +1014,8 @@ discard block |
||
| 1014 | 1014 | * @return object |
| 1015 | 1015 | */ |
| 1016 | 1016 | public function getAdminImportFormAction(Request $request) { |
| 1017 | - $parent_id = (int)$request->get('parent_id'); |
|
| 1018 | - $inactive = (int)$request->get('inactive'); |
|
| 1017 | + $parent_id = (int) $request->get('parent_id'); |
|
| 1018 | + $inactive = (int) $request->get('inactive'); |
|
| 1019 | 1019 | $breadcrumbs = [ |
| 1020 | 1020 | route('admin-control-panel') => I18N::translate('Control panel'), |
| 1021 | 1021 | route('admin-modules') => I18N::translate('Module administration'), |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | ) => $this->getTitle() . ' (' . I18N::translate('Geographic data') . ')', |
| 1031 | 1031 | I18N::translate('Import file'), |
| 1032 | 1032 | ]; |
| 1033 | - $files = $this->findFiles(WT_MODULES_DIR . $this->getName() . '/extra', ['csv', 'geojson', 'json']); |
|
| 1033 | + $files = $this->findFiles(WT_MODULES_DIR . $this->getName() . '/extra', ['csv', 'geojson', 'json']); |
|
| 1034 | 1034 | uasort( |
| 1035 | 1035 | $files, |
| 1036 | 1036 | function ($a, $b) { |
@@ -1041,7 +1041,7 @@ discard block |
||
| 1041 | 1041 | } |
| 1042 | 1042 | ); |
| 1043 | 1043 | |
| 1044 | - return (object)[ |
|
| 1044 | + return (object) [ |
|
| 1045 | 1045 | 'name' => 'modules/openstreetmap/admin-import-form', |
| 1046 | 1046 | 'data' => [ |
| 1047 | 1047 | 'title' => I18N::translate('Import geographic data'), |
@@ -1105,8 +1105,8 @@ discard block |
||
| 1105 | 1105 | $row = explode($delimiter, $input_array[0]); |
| 1106 | 1106 | $fields = count($row); |
| 1107 | 1107 | if ($fields >= 6 && |
| 1108 | - (bool)preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) && |
|
| 1109 | - (bool)preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) { |
|
| 1108 | + (bool) preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) && |
|
| 1109 | + (bool) preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) { |
|
| 1110 | 1110 | $filetype = 'csv'; |
| 1111 | 1111 | } |
| 1112 | 1112 | } |
@@ -1146,7 +1146,7 @@ discard block |
||
| 1146 | 1146 | } |
| 1147 | 1147 | ); |
| 1148 | 1148 | // convert separate place fields into a comma separated placename |
| 1149 | - $row[] = implode( |
|
| 1149 | + $row[] = implode( |
|
| 1150 | 1150 | Place::GEDCOM_SEPARATOR, |
| 1151 | 1151 | array_filter( |
| 1152 | 1152 | array_reverse( |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | } |
| 1163 | 1163 | |
| 1164 | 1164 | if ($filetype !== '?') { |
| 1165 | - if ((bool)$request->get('cleardatabase')) { |
|
| 1165 | + if ((bool) $request->get('cleardatabase')) { |
|
| 1166 | 1166 | Database::exec("TRUNCATE TABLE `##placelocation`"); |
| 1167 | 1167 | } |
| 1168 | 1168 | //process places |
@@ -1173,10 +1173,10 @@ discard block |
||
| 1173 | 1173 | usort( |
| 1174 | 1174 | $places, |
| 1175 | 1175 | function (array $a, array $b) { |
| 1176 | - if ((int)$a['pl_level'] === (int)$b['pl_level']) { |
|
| 1176 | + if ((int) $a['pl_level'] === (int) $b['pl_level']) { |
|
| 1177 | 1177 | return I18N::strcasecmp($a['fqpn'], $b['fqpn']); |
| 1178 | 1178 | } else { |
| 1179 | - return (int)$a['pl_level'] - (int)$b['pl_level']; |
|
| 1179 | + return (int) $a['pl_level'] - (int) $b['pl_level']; |
|
| 1180 | 1180 | } |
| 1181 | 1181 | } |
| 1182 | 1182 | ); |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | )) { |
| 1197 | 1197 | |
| 1198 | 1198 | // overwrite |
| 1199 | - $location->update((object)$place); |
|
| 1199 | + $location->update((object) $place); |
|
| 1200 | 1200 | $updated++; |
| 1201 | 1201 | } elseif (!$valid && $options !== 'update') { |
| 1202 | 1202 | //add |
@@ -1266,7 +1266,7 @@ discard block |
||
| 1266 | 1266 | */ |
| 1267 | 1267 | public function postAdminImportPlacesAction(Request $request): RedirectResponse { |
| 1268 | 1268 | $gedcomName = $request->get('ged'); |
| 1269 | - $inactive = (int)$request->get('inactive'); |
|
| 1269 | + $inactive = (int) $request->get('inactive'); |
|
| 1270 | 1270 | $tree = Tree::findByName($gedcomName); |
| 1271 | 1271 | |
| 1272 | 1272 | // Get all the places from the places table ... |
@@ -1322,7 +1322,7 @@ discard block |
||
| 1322 | 1322 | "INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place)" . |
| 1323 | 1323 | " VALUES (:id, :parent, :level, :place)" |
| 1324 | 1324 | ); |
| 1325 | - $checkRecordQry = Database::prepare( |
|
| 1325 | + $checkRecordQry = Database::prepare( |
|
| 1326 | 1326 | "SELECT pl1.pl_id" . |
| 1327 | 1327 | " FROM `##placelocation` AS pl1" . |
| 1328 | 1328 | " LEFT JOIN `##placelocation` AS pl2 ON (pl1.pl_parent_id = pl2.pl_id)" . |
@@ -1485,7 +1485,7 @@ discard block |
||
| 1485 | 1485 | $list = []; |
| 1486 | 1486 | /** @var array $rows */ |
| 1487 | 1487 | foreach ($rows as $row) { |
| 1488 | - if ((bool)$row['inactive'] && !$show_inactive) { |
|
| 1488 | + if ((bool) $row['inactive'] && !$show_inactive) { |
|
| 1489 | 1489 | continue; |
| 1490 | 1490 | } |
| 1491 | 1491 | |
@@ -1496,20 +1496,20 @@ discard block |
||
| 1496 | 1496 | ] |
| 1497 | 1497 | )->fetchOneRow(); |
| 1498 | 1498 | |
| 1499 | - if ((bool)$row['inactive']) { |
|
| 1499 | + if ((bool) $row['inactive']) { |
|
| 1500 | 1500 | $badge = 'danger'; |
| 1501 | - } elseif ((int)$children->no_coord > 0) { |
|
| 1501 | + } elseif ((int) $children->no_coord > 0) { |
|
| 1502 | 1502 | $badge = 'warning'; |
| 1503 | - } elseif ((int)$children->child_count > 0) { |
|
| 1503 | + } elseif ((int) $children->child_count > 0) { |
|
| 1504 | 1504 | $badge = 'info'; |
| 1505 | 1505 | } else { |
| 1506 | 1506 | $badge = 'secondary'; |
| 1507 | 1507 | } |
| 1508 | 1508 | |
| 1509 | - $list[] = (object)array_merge( |
|
| 1509 | + $list[] = (object) array_merge( |
|
| 1510 | 1510 | $row, |
| 1511 | 1511 | [ |
| 1512 | - 'child_count' => (int)$children->child_count, |
|
| 1512 | + 'child_count' => (int) $children->child_count, |
|
| 1513 | 1513 | 'badge' => $badge, |
| 1514 | 1514 | ] |
| 1515 | 1515 | ); |
@@ -1531,7 +1531,7 @@ discard block |
||
| 1531 | 1531 | $row = $statement->execute(['id' => $id])->fetchOneRow(); |
| 1532 | 1532 | $fqpn[] = $row->pl_place; |
| 1533 | 1533 | $row->fqpn = implode(Place::GEDCOM_SEPARATOR, $fqpn); |
| 1534 | - $id = (int)$row->pl_parent_id; |
|
| 1534 | + $id = (int) $row->pl_parent_id; |
|
| 1535 | 1535 | $arr[] = $row; |
| 1536 | 1536 | } |
| 1537 | 1537 | |
@@ -1546,7 +1546,7 @@ discard block |
||
| 1546 | 1546 | */ |
| 1547 | 1547 | private function buildLevel($parent_id, $placename, &$places) { |
| 1548 | 1548 | $level = array_search('', $placename); |
| 1549 | - $rows = (array)Database::prepare( |
|
| 1549 | + $rows = (array) Database::prepare( |
|
| 1550 | 1550 | "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" |
| 1551 | 1551 | ) |
| 1552 | 1552 | ->execute([$parent_id]) |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | </div> |
| 30 | 30 | <div id="card-tree-content-<?= $managed_tree->getTreeId() ?>" class="collapse<?= $managed_tree == $tree || $managed_tree->getPreference('imported') === '0' ? ' show' : '' ?>" role="tabpanel" aria-labelledby="panel-tree-header-<?= $managed_tree->getTreeId() ?>"> |
| 31 | 31 | <div class="card-body"> |
| 32 | - <?php $importing = Database::prepare( "SELECT 1 FROM `##gedcom_chunk` WHERE gedcom_id = ? AND imported = '0' LIMIT 1" )->execute([$managed_tree->getTreeId()])->fetchOne() ?> |
|
| 32 | + <?php $importing = Database::prepare("SELECT 1 FROM `##gedcom_chunk` WHERE gedcom_id = ? AND imported = '0' LIMIT 1")->execute([$managed_tree->getTreeId()])->fetchOne() ?> |
|
| 33 | 33 | <?php if ($importing): ?> |
| 34 | 34 | <div id="import<?= $managed_tree->getTreeId() ?>" class="col-xs-12"> |
| 35 | 35 | <div class="progress"> |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | <select name="tree_name" class="form-control" id="import-server-file"> |
| 47 | 47 | <option value=""></option> |
| 48 | 48 | <?php foreach ($gedcom_files as $gedcom_file): ?> |
| 49 | - <option value="<?= e($gedcom_file) ?>" <?= $gedcom_file === $default_gedcom_file? 'selected' : '' ?>> |
|
| 49 | + <option value="<?= e($gedcom_file) ?>" <?= $gedcom_file === $default_gedcom_file ? 'selected' : '' ?>> |
|
| 50 | 50 | <?= e($gedcom_file) ?> |
| 51 | 51 | </option> |
| 52 | 52 | <?php endforeach ?> |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | return new RedirectResponse(route('admin-trees')); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - return $this->viewResponse('errors/no-tree-access', [ 'title' => '' ]); |
|
| 61 | + return $this->viewResponse('errors/no-tree-access', ['title' => '']); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |