@@ -255,18 +255,18 @@ discard block |
||
255 | 255 | */ |
256 | 256 | public static function searchIndividualsPhonetic($soundex, $lastname, $firstname, $place, array $trees) { |
257 | 257 | switch ($soundex) { |
258 | - case 'Russell': |
|
259 | - $givn_sdx = Soundex::russell($firstname); |
|
260 | - $surn_sdx = Soundex::russell($lastname); |
|
261 | - $plac_sdx = Soundex::russell($place); |
|
262 | - break; |
|
263 | - case 'DaitchM': |
|
264 | - $givn_sdx = Soundex::daitchMokotoff($firstname); |
|
265 | - $surn_sdx = Soundex::daitchMokotoff($lastname); |
|
266 | - $plac_sdx = Soundex::daitchMokotoff($place); |
|
267 | - break; |
|
268 | - default: |
|
269 | - throw new \DomainException('soundex: ' . $soundex); |
|
258 | + case 'Russell': |
|
259 | + $givn_sdx = Soundex::russell($firstname); |
|
260 | + $surn_sdx = Soundex::russell($lastname); |
|
261 | + $plac_sdx = Soundex::russell($place); |
|
262 | + break; |
|
263 | + case 'DaitchM': |
|
264 | + $givn_sdx = Soundex::daitchMokotoff($firstname); |
|
265 | + $surn_sdx = Soundex::daitchMokotoff($lastname); |
|
266 | + $plac_sdx = Soundex::daitchMokotoff($place); |
|
267 | + break; |
|
268 | + default: |
|
269 | + throw new \DomainException('soundex: ' . $soundex); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | // Nothing to search for? Return nothing. |
@@ -298,12 +298,12 @@ discard block |
||
298 | 298 | foreach ($givn_sdx as $n => $sdx) { |
299 | 299 | $sql .= $n ? " OR " : ""; |
300 | 300 | switch ($soundex) { |
301 | - case 'Russell': |
|
302 | - $sql .= "n_soundex_givn_std LIKE CONCAT('%', :given_name_" . $n . ", '%')"; |
|
303 | - break; |
|
304 | - case 'DaitchM': |
|
305 | - $sql .= "n_soundex_givn_dm LIKE CONCAT('%', :given_name_" . $n . ", '%')"; |
|
306 | - break; |
|
301 | + case 'Russell': |
|
302 | + $sql .= "n_soundex_givn_std LIKE CONCAT('%', :given_name_" . $n . ", '%')"; |
|
303 | + break; |
|
304 | + case 'DaitchM': |
|
305 | + $sql .= "n_soundex_givn_dm LIKE CONCAT('%', :given_name_" . $n . ", '%')"; |
|
306 | + break; |
|
307 | 307 | } |
308 | 308 | $args['given_name_' . $n] = $sdx; |
309 | 309 | } |
@@ -316,12 +316,12 @@ discard block |
||
316 | 316 | foreach ($surn_sdx as $n => $sdx) { |
317 | 317 | $sql .= $n ? " OR " : ""; |
318 | 318 | switch ($soundex) { |
319 | - case 'Russell': |
|
320 | - $sql .= "n_soundex_surn_std LIKE CONCAT('%', :surname_" . $n . ", '%')"; |
|
321 | - break; |
|
322 | - case 'DaitchM': |
|
323 | - $sql .= "n_soundex_surn_dm LIKE CONCAT('%', :surname_" . $n . ", '%')"; |
|
324 | - break; |
|
319 | + case 'Russell': |
|
320 | + $sql .= "n_soundex_surn_std LIKE CONCAT('%', :surname_" . $n . ", '%')"; |
|
321 | + break; |
|
322 | + case 'DaitchM': |
|
323 | + $sql .= "n_soundex_surn_dm LIKE CONCAT('%', :surname_" . $n . ", '%')"; |
|
324 | + break; |
|
325 | 325 | } |
326 | 326 | $args['surname_' . $n] = $sdx; |
327 | 327 | } |
@@ -334,12 +334,12 @@ discard block |
||
334 | 334 | foreach ($plac_sdx as $n => $sdx) { |
335 | 335 | $sql .= $n ? " OR " : ""; |
336 | 336 | switch ($soundex) { |
337 | - case 'Russell': |
|
338 | - $sql .= "p_std_soundex LIKE CONCAT('%', :place_" . $n . ", '%')"; |
|
339 | - break; |
|
340 | - case 'DaitchM': |
|
341 | - $sql .= "p_dm_soundex LIKE CONCAT('%', :place_" . $n . ", '%')"; |
|
342 | - break; |
|
337 | + case 'Russell': |
|
338 | + $sql .= "p_std_soundex LIKE CONCAT('%', :place_" . $n . ", '%')"; |
|
339 | + break; |
|
340 | + case 'DaitchM': |
|
341 | + $sql .= "p_dm_soundex LIKE CONCAT('%', :place_" . $n . ", '%')"; |
|
342 | + break; |
|
343 | 343 | } |
344 | 344 | $args['place_' . $n] = $sdx; |
345 | 345 | } |
@@ -774,82 +774,82 @@ discard block |
||
774 | 774 | } else { |
775 | 775 | // SPECIAL CASES: |
776 | 776 | switch ($anniv->m) { |
777 | - case 2: |
|
778 | - // 29 CSH does not include 30 CSH (but would include an invalid 31 CSH if there were no 30 CSH) |
|
779 | - if ($anniv->d === 1) { |
|
780 | - $where .= " AND d_day <= 1 AND d_mon = 2"; |
|
781 | - } elseif ($anniv->d === 30) { |
|
782 | - $where .= " AND d_day >= 30 AND d_mon = 2"; |
|
783 | - } elseif ($anniv->d === 29 && $anniv->daysInMonth() === 29) { |
|
784 | - $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 2"; |
|
785 | - } else { |
|
786 | - $where .= " AND d_day = :day AND d_mon = 2"; |
|
787 | - $args['day'] = $anniv->d; |
|
788 | - } |
|
789 | - break; |
|
790 | - case 3: |
|
791 | - // 1 KSL includes 30 CSH (if this year didn’t have 30 CSH) |
|
792 | - // 29 KSL does not include 30 KSL (but would include an invalid 31 KSL if there were no 30 KSL) |
|
793 | - if ($anniv->d === 1) { |
|
794 | - $tmp = new JewishDate([$anniv->y, 'CSH', 1]); |
|
795 | - if ($tmp->daysInMonth() === 29) { |
|
796 | - $where .= " AND (d_day <= 1 AND d_mon = 3 OR d_day = 30 AND d_mon = 2)"; |
|
777 | + case 2: |
|
778 | + // 29 CSH does not include 30 CSH (but would include an invalid 31 CSH if there were no 30 CSH) |
|
779 | + if ($anniv->d === 1) { |
|
780 | + $where .= " AND d_day <= 1 AND d_mon = 2"; |
|
781 | + } elseif ($anniv->d === 30) { |
|
782 | + $where .= " AND d_day >= 30 AND d_mon = 2"; |
|
783 | + } elseif ($anniv->d === 29 && $anniv->daysInMonth() === 29) { |
|
784 | + $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 2"; |
|
797 | 785 | } else { |
798 | - $where .= " AND d_day <= 1 AND d_mon = 3"; |
|
786 | + $where .= " AND d_day = :day AND d_mon = 2"; |
|
787 | + $args['day'] = $anniv->d; |
|
799 | 788 | } |
800 | - } elseif ($anniv->d === 30) { |
|
801 | - $where .= " AND d_day >= 30 AND d_mon = 3"; |
|
802 | - } elseif ($anniv->d == 29 && $anniv->daysInMonth() === 29) { |
|
803 | - $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 3"; |
|
804 | - } else { |
|
805 | - $where .= " AND d_day = :day AND d_mon = 3"; |
|
806 | - $args['day'] = $anniv->d; |
|
807 | - } |
|
808 | - break; |
|
809 | - case 4: |
|
810 | - // 1 TVT includes 30 KSL (if this year didn’t have 30 KSL) |
|
811 | - if ($anniv->d === 1) { |
|
812 | - $tmp = new JewishDate([$anniv->y, 'KSL', 1]); |
|
813 | - if ($tmp->daysInMonth() === 29) { |
|
814 | - $where .= " AND (d_day <=1 AND d_mon = 4 OR d_day = 30 AND d_mon = 3)"; |
|
789 | + break; |
|
790 | + case 3: |
|
791 | + // 1 KSL includes 30 CSH (if this year didn’t have 30 CSH) |
|
792 | + // 29 KSL does not include 30 KSL (but would include an invalid 31 KSL if there were no 30 KSL) |
|
793 | + if ($anniv->d === 1) { |
|
794 | + $tmp = new JewishDate([$anniv->y, 'CSH', 1]); |
|
795 | + if ($tmp->daysInMonth() === 29) { |
|
796 | + $where .= " AND (d_day <= 1 AND d_mon = 3 OR d_day = 30 AND d_mon = 2)"; |
|
797 | + } else { |
|
798 | + $where .= " AND d_day <= 1 AND d_mon = 3"; |
|
799 | + } |
|
800 | + } elseif ($anniv->d === 30) { |
|
801 | + $where .= " AND d_day >= 30 AND d_mon = 3"; |
|
802 | + } elseif ($anniv->d == 29 && $anniv->daysInMonth() === 29) { |
|
803 | + $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 3"; |
|
815 | 804 | } else { |
816 | - $where .= " AND d_day <= 1 AND d_mon = 4"; |
|
805 | + $where .= " AND d_day = :day AND d_mon = 3"; |
|
806 | + $args['day'] = $anniv->d; |
|
817 | 807 | } |
818 | - } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
819 | - $where .= " AND d_day >= :day AND d_mon=4"; |
|
820 | - $args['day'] = $anniv->d; |
|
821 | - } else { |
|
822 | - $where .= " AND d_day = :day AND d_mon=4"; |
|
823 | - $args['day'] = $anniv->d; |
|
824 | - } |
|
825 | - break; |
|
826 | - case 7: // ADS includes ADR (non-leap) |
|
827 | - if ($anniv->d === 1) { |
|
828 | - $where .= " AND d_day <= 1"; |
|
829 | - } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
830 | - $where .= " AND d_day >= :day"; |
|
831 | - $args['day'] = $anniv->d; |
|
832 | - } else { |
|
833 | - $where .= " AND d_day = :day"; |
|
834 | - $args['day'] = $anniv->d; |
|
835 | - } |
|
836 | - $where .= " AND (d_mon = 6 AND MOD(7 * d_year + 1, 19) >= 7 OR d_mon = 7)"; |
|
837 | - break; |
|
838 | - case 8: // 1 NSN includes 30 ADR, if this year is non-leap |
|
839 | - if ($anniv->d === 1) { |
|
840 | - if ($anniv->isLeapYear()) { |
|
841 | - $where .= " AND d_day <= 1 AND d_mon = 8"; |
|
808 | + break; |
|
809 | + case 4: |
|
810 | + // 1 TVT includes 30 KSL (if this year didn’t have 30 KSL) |
|
811 | + if ($anniv->d === 1) { |
|
812 | + $tmp = new JewishDate([$anniv->y, 'KSL', 1]); |
|
813 | + if ($tmp->daysInMonth() === 29) { |
|
814 | + $where .= " AND (d_day <=1 AND d_mon = 4 OR d_day = 30 AND d_mon = 3)"; |
|
815 | + } else { |
|
816 | + $where .= " AND d_day <= 1 AND d_mon = 4"; |
|
817 | + } |
|
818 | + } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
819 | + $where .= " AND d_day >= :day AND d_mon=4"; |
|
820 | + $args['day'] = $anniv->d; |
|
842 | 821 | } else { |
843 | - $where .= " AND (d_day <= 1 AND d_mon = 8 OR d_day = 30 AND d_mon = 6)"; |
|
822 | + $where .= " AND d_day = :day AND d_mon=4"; |
|
823 | + $args['day'] = $anniv->d; |
|
844 | 824 | } |
845 | - } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
846 | - $where .= " AND d_day >= :day AND d_mon = 8"; |
|
847 | - $args['day'] = $anniv->d; |
|
848 | - } else { |
|
849 | - $where .= " AND d_day = :day AND d_mon = 8"; |
|
850 | - $args['day'] = $anniv->d; |
|
851 | - } |
|
852 | - break; |
|
825 | + break; |
|
826 | + case 7: // ADS includes ADR (non-leap) |
|
827 | + if ($anniv->d === 1) { |
|
828 | + $where .= " AND d_day <= 1"; |
|
829 | + } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
830 | + $where .= " AND d_day >= :day"; |
|
831 | + $args['day'] = $anniv->d; |
|
832 | + } else { |
|
833 | + $where .= " AND d_day = :day"; |
|
834 | + $args['day'] = $anniv->d; |
|
835 | + } |
|
836 | + $where .= " AND (d_mon = 6 AND MOD(7 * d_year + 1, 19) >= 7 OR d_mon = 7)"; |
|
837 | + break; |
|
838 | + case 8: // 1 NSN includes 30 ADR, if this year is non-leap |
|
839 | + if ($anniv->d === 1) { |
|
840 | + if ($anniv->isLeapYear()) { |
|
841 | + $where .= " AND d_day <= 1 AND d_mon = 8"; |
|
842 | + } else { |
|
843 | + $where .= " AND (d_day <= 1 AND d_mon = 8 OR d_day = 30 AND d_mon = 6)"; |
|
844 | + } |
|
845 | + } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
846 | + $where .= " AND d_day >= :day AND d_mon = 8"; |
|
847 | + $args['day'] = $anniv->d; |
|
848 | + } else { |
|
849 | + $where .= " AND d_day = :day AND d_mon = 8"; |
|
850 | + $args['day'] = $anniv->d; |
|
851 | + } |
|
852 | + break; |
|
853 | 853 | } |
854 | 854 | } |
855 | 855 | // Only events in the past (includes dates without a year) |
@@ -144,13 +144,13 @@ discard block |
||
144 | 144 | public static function collation() { |
145 | 145 | $collation = self::$locale->collation(); |
146 | 146 | switch ($collation) { |
147 | - case 'croatian_ci': |
|
148 | - case 'german2_ci': |
|
149 | - case 'vietnamese_ci': |
|
150 | - // Only available in MySQL 5.6 |
|
151 | - return 'utf8_unicode_ci'; |
|
152 | - default: |
|
153 | - return 'utf8_' . $collation; |
|
147 | + case 'croatian_ci': |
|
148 | + case 'german2_ci': |
|
149 | + case 'vietnamese_ci': |
|
150 | + // Only available in MySQL 5.6 |
|
151 | + return 'utf8_unicode_ci'; |
|
152 | + default: |
|
153 | + return 'utf8_' . $collation; |
|
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
@@ -238,15 +238,15 @@ discard block |
||
238 | 238 | */ |
239 | 239 | public static function gedcomAge($string) { |
240 | 240 | switch ($string) { |
241 | - case 'STILLBORN': |
|
242 | - // I18N: Description of an individual’s age at an event. For example, Died 14 Jan 1900 (stillborn) |
|
243 | - return self::translate('(stillborn)'); |
|
244 | - case 'INFANT': |
|
245 | - // I18N: Description of an individual’s age at an event. For example, Died 14 Jan 1900 (in infancy) |
|
246 | - return self::translate('(in infancy)'); |
|
247 | - case 'CHILD': |
|
248 | - // I18N: Description of an individual’s age at an event. For example, Died 14 Jan 1900 (in childhood) |
|
249 | - return self::translate('(in childhood)'); |
|
241 | + case 'STILLBORN': |
|
242 | + // I18N: Description of an individual’s age at an event. For example, Died 14 Jan 1900 (stillborn) |
|
243 | + return self::translate('(stillborn)'); |
|
244 | + case 'INFANT': |
|
245 | + // I18N: Description of an individual’s age at an event. For example, Died 14 Jan 1900 (in infancy) |
|
246 | + return self::translate('(in infancy)'); |
|
247 | + case 'CHILD': |
|
248 | + // I18N: Description of an individual’s age at an event. For example, Died 14 Jan 1900 (in childhood) |
|
249 | + return self::translate('(in childhood)'); |
|
250 | 250 | } |
251 | 251 | $age = []; |
252 | 252 | if (preg_match('/(\d+)y/', $string, $match)) { |
@@ -562,13 +562,13 @@ discard block |
||
562 | 562 | */ |
563 | 563 | public static function scriptDirection($script) { |
564 | 564 | switch ($script) { |
565 | - case 'Arab': |
|
566 | - case 'Hebr': |
|
567 | - case 'Mong': |
|
568 | - case 'Thaa': |
|
569 | - return 'rtl'; |
|
570 | - default: |
|
571 | - return 'ltr'; |
|
565 | + case 'Arab': |
|
566 | + case 'Hebr': |
|
567 | + case 'Mong': |
|
568 | + case 'Thaa': |
|
569 | + return 'rtl'; |
|
570 | + default: |
|
571 | + return 'ltr'; |
|
572 | 572 | } |
573 | 573 | } |
574 | 574 | |
@@ -787,15 +787,15 @@ discard block |
||
787 | 787 | */ |
788 | 788 | public static function defaultCalendar() { |
789 | 789 | switch (self::$locale->languageTag()) { |
790 | - case 'ar': |
|
791 | - return new ArabicCalendar; |
|
792 | - case 'fa': |
|
793 | - return new PersianCalendar; |
|
794 | - case 'he': |
|
795 | - case 'yi': |
|
796 | - return new JewishCalendar; |
|
797 | - default: |
|
798 | - return new GregorianCalendar; |
|
790 | + case 'ar': |
|
791 | + return new ArabicCalendar; |
|
792 | + case 'fa': |
|
793 | + return new PersianCalendar; |
|
794 | + case 'he': |
|
795 | + case 'yi': |
|
796 | + return new JewishCalendar; |
|
797 | + default: |
|
798 | + return new GregorianCalendar; |
|
799 | 799 | } |
800 | 800 | } |
801 | 801 | } |
@@ -35,85 +35,85 @@ discard block |
||
35 | 35 | */ |
36 | 36 | private function getAlphabetForLocale($locale) { |
37 | 37 | switch ($locale) { |
38 | - case 'ar': |
|
39 | - return [ |
|
40 | - 'ا', 'ب', 'ت', 'ث', 'ج', 'ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ك', 'ل', 'م', 'ن', 'ه', 'و', 'ي', 'آ', 'ة', 'ى', 'ی', |
|
41 | - ]; |
|
42 | - case 'cs': |
|
43 | - return [ |
|
44 | - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'CH', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', |
|
45 | - ]; |
|
46 | - case 'da': |
|
47 | - case 'nb': |
|
48 | - case 'nn': |
|
49 | - return [ |
|
50 | - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Æ', 'Ø', 'Å', |
|
51 | - ]; |
|
52 | - case 'el': |
|
53 | - return [ |
|
54 | - 'Α', 'Β', 'Γ', 'Δ', 'Ε', 'Ζ', 'Η', 'Θ', 'Ι', 'Κ', 'Λ', 'Μ', 'Ν', 'Ξ', 'Ο', 'Π', 'Ρ', 'Σ', 'Τ', 'Υ', 'Φ', 'Χ', 'Ψ', 'Ω', |
|
55 | - ]; |
|
56 | - case 'es': |
|
57 | - return [ |
|
58 | - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'Ñ', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', |
|
59 | - ]; |
|
60 | - case 'et': |
|
61 | - return [ |
|
62 | - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Š', 'Z', 'Ž', 'T', 'U', 'V', 'W', 'Õ', 'Ä', 'Ö', 'Ü', 'X', 'Y', |
|
63 | - ]; |
|
64 | - case 'fi': |
|
65 | - case 'sv': |
|
66 | - return [ |
|
67 | - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Å', 'Ä', 'Ö', |
|
68 | - ]; |
|
69 | - case 'he': |
|
70 | - return [ |
|
71 | - 'א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ז', 'ח', 'ט', 'י', 'כ', 'ל', 'מ', 'נ', 'ס', 'ע', 'פ', 'צ', 'ק', 'ר', 'ש', 'ת', |
|
72 | - ]; |
|
73 | - case 'hu': |
|
74 | - return [ |
|
75 | - 'A', 'B', 'C', 'CS', 'D', 'DZ', 'DZS', 'E', 'F', 'G', 'GY', 'H', 'I', 'J', 'K', 'L', 'LY', 'M', 'N', 'NY', 'O', 'Ö', 'P', 'Q', 'R', 'S', 'SZ', 'T', 'TY', 'U', 'Ü', 'V', 'W', 'X', 'Y', 'Z', 'ZS', |
|
76 | - ]; |
|
77 | - case 'lt': |
|
78 | - return [ |
|
79 | - 'A', 'Ą', 'B', 'C', 'Č', 'D', 'E', 'Ę', 'Ė', 'F', 'G', 'H', 'I', 'Y', 'Į', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'Š', 'T', 'U', 'Ų', 'Ū', 'V', 'Z', 'Ž', |
|
80 | - ]; |
|
81 | - case 'nl': |
|
82 | - return [ |
|
83 | - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'IJ', |
|
84 | - ]; |
|
85 | - case 'pl': |
|
86 | - return [ |
|
87 | - 'A', 'B', 'C', 'Ć', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'Ł', 'M', 'N', 'O', 'Ó', 'P', 'Q', 'R', 'S', 'Ś', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ź', 'Ż', |
|
88 | - ]; |
|
89 | - case 'ro': |
|
90 | - return [ |
|
91 | - 'A', 'Ă', 'Â', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'Î', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Ş', 'T', 'Ţ', 'U', 'V', 'W', 'X', 'Y', 'Z', |
|
92 | - ]; |
|
93 | - case 'ru': |
|
94 | - return [ |
|
95 | - 'А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я', |
|
96 | - ]; |
|
97 | - case 'sk': |
|
98 | - return [ |
|
99 | - 'A', 'Á', 'Ä', 'B', 'C', 'Č', 'D', 'Ď', 'E', 'É', 'F', 'G', 'H', 'I', 'Í', 'J', 'K', 'L', 'Ľ', 'Ĺ', 'M', 'N', 'Ň', 'O', 'Ó', 'Ô', 'P', 'Q', 'R', 'Ŕ', 'S', 'Š', 'T', 'Ť', 'U', 'Ú', 'V', 'W', 'X', 'Y', 'Ý', 'Z', 'Ž', |
|
100 | - ]; |
|
101 | - case 'sl': |
|
102 | - return [ |
|
103 | - 'A', 'B', 'C', 'Č', 'Ć', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Š', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ž', |
|
104 | - ]; |
|
105 | - case 'sr': |
|
106 | - return [ |
|
107 | - 'A', 'B', 'C', 'Č', 'Ć', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Š', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ž', |
|
108 | - ]; |
|
109 | - case 'tr': |
|
110 | - return [ |
|
111 | - 'A', 'B', 'C', 'Ç', 'D', 'E', 'F', 'G', 'Ğ', 'H', 'I', 'İ', 'J', 'K', 'L', 'M', 'N', 'O', 'Ö', 'P', 'R', 'S', 'Ş', 'T', 'U', 'Ü', 'V', 'Y', 'Z', |
|
112 | - ]; |
|
113 | - default: |
|
114 | - return [ |
|
115 | - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', |
|
116 | - ]; |
|
38 | + case 'ar': |
|
39 | + return [ |
|
40 | + 'ا', 'ب', 'ت', 'ث', 'ج', 'ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ك', 'ل', 'م', 'ن', 'ه', 'و', 'ي', 'آ', 'ة', 'ى', 'ی', |
|
41 | + ]; |
|
42 | + case 'cs': |
|
43 | + return [ |
|
44 | + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'CH', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', |
|
45 | + ]; |
|
46 | + case 'da': |
|
47 | + case 'nb': |
|
48 | + case 'nn': |
|
49 | + return [ |
|
50 | + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Æ', 'Ø', 'Å', |
|
51 | + ]; |
|
52 | + case 'el': |
|
53 | + return [ |
|
54 | + 'Α', 'Β', 'Γ', 'Δ', 'Ε', 'Ζ', 'Η', 'Θ', 'Ι', 'Κ', 'Λ', 'Μ', 'Ν', 'Ξ', 'Ο', 'Π', 'Ρ', 'Σ', 'Τ', 'Υ', 'Φ', 'Χ', 'Ψ', 'Ω', |
|
55 | + ]; |
|
56 | + case 'es': |
|
57 | + return [ |
|
58 | + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'Ñ', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', |
|
59 | + ]; |
|
60 | + case 'et': |
|
61 | + return [ |
|
62 | + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Š', 'Z', 'Ž', 'T', 'U', 'V', 'W', 'Õ', 'Ä', 'Ö', 'Ü', 'X', 'Y', |
|
63 | + ]; |
|
64 | + case 'fi': |
|
65 | + case 'sv': |
|
66 | + return [ |
|
67 | + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Å', 'Ä', 'Ö', |
|
68 | + ]; |
|
69 | + case 'he': |
|
70 | + return [ |
|
71 | + 'א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ז', 'ח', 'ט', 'י', 'כ', 'ל', 'מ', 'נ', 'ס', 'ע', 'פ', 'צ', 'ק', 'ר', 'ש', 'ת', |
|
72 | + ]; |
|
73 | + case 'hu': |
|
74 | + return [ |
|
75 | + 'A', 'B', 'C', 'CS', 'D', 'DZ', 'DZS', 'E', 'F', 'G', 'GY', 'H', 'I', 'J', 'K', 'L', 'LY', 'M', 'N', 'NY', 'O', 'Ö', 'P', 'Q', 'R', 'S', 'SZ', 'T', 'TY', 'U', 'Ü', 'V', 'W', 'X', 'Y', 'Z', 'ZS', |
|
76 | + ]; |
|
77 | + case 'lt': |
|
78 | + return [ |
|
79 | + 'A', 'Ą', 'B', 'C', 'Č', 'D', 'E', 'Ę', 'Ė', 'F', 'G', 'H', 'I', 'Y', 'Į', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'Š', 'T', 'U', 'Ų', 'Ū', 'V', 'Z', 'Ž', |
|
80 | + ]; |
|
81 | + case 'nl': |
|
82 | + return [ |
|
83 | + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'IJ', |
|
84 | + ]; |
|
85 | + case 'pl': |
|
86 | + return [ |
|
87 | + 'A', 'B', 'C', 'Ć', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'Ł', 'M', 'N', 'O', 'Ó', 'P', 'Q', 'R', 'S', 'Ś', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ź', 'Ż', |
|
88 | + ]; |
|
89 | + case 'ro': |
|
90 | + return [ |
|
91 | + 'A', 'Ă', 'Â', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'Î', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Ş', 'T', 'Ţ', 'U', 'V', 'W', 'X', 'Y', 'Z', |
|
92 | + ]; |
|
93 | + case 'ru': |
|
94 | + return [ |
|
95 | + 'А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я', |
|
96 | + ]; |
|
97 | + case 'sk': |
|
98 | + return [ |
|
99 | + 'A', 'Á', 'Ä', 'B', 'C', 'Č', 'D', 'Ď', 'E', 'É', 'F', 'G', 'H', 'I', 'Í', 'J', 'K', 'L', 'Ľ', 'Ĺ', 'M', 'N', 'Ň', 'O', 'Ó', 'Ô', 'P', 'Q', 'R', 'Ŕ', 'S', 'Š', 'T', 'Ť', 'U', 'Ú', 'V', 'W', 'X', 'Y', 'Ý', 'Z', 'Ž', |
|
100 | + ]; |
|
101 | + case 'sl': |
|
102 | + return [ |
|
103 | + 'A', 'B', 'C', 'Č', 'Ć', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Š', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ž', |
|
104 | + ]; |
|
105 | + case 'sr': |
|
106 | + return [ |
|
107 | + 'A', 'B', 'C', 'Č', 'Ć', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'Š', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ž', |
|
108 | + ]; |
|
109 | + case 'tr': |
|
110 | + return [ |
|
111 | + 'A', 'B', 'C', 'Ç', 'D', 'E', 'F', 'G', 'Ğ', 'H', 'I', 'İ', 'J', 'K', 'L', 'M', 'N', 'O', 'Ö', 'P', 'R', 'S', 'Ş', 'T', 'U', 'Ü', 'V', 'Y', 'Z', |
|
112 | + ]; |
|
113 | + default: |
|
114 | + return [ |
|
115 | + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', |
|
116 | + ]; |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
@@ -127,44 +127,44 @@ discard block |
||
127 | 127 | public function initialLetter($name) { |
128 | 128 | $name = I18N::strtoupper($name); |
129 | 129 | switch (WT_LOCALE) { |
130 | - case 'cs': |
|
131 | - if (substr($name, 0, 2) == 'CH') { |
|
132 | - return 'CH'; |
|
133 | - } |
|
134 | - break; |
|
135 | - case 'da': |
|
136 | - case 'nb': |
|
137 | - case 'nn': |
|
138 | - if (substr($name, 0, 2) == 'AA') { |
|
139 | - return 'Å'; |
|
140 | - } |
|
141 | - break; |
|
142 | - case 'hu': |
|
143 | - if (substr($name, 0, 2) == 'CS') { |
|
144 | - return 'CS'; |
|
145 | - } elseif (substr($name, 0, 3) == 'DZS') { |
|
146 | - return 'DZS'; |
|
147 | - } elseif (substr($name, 0, 2) == 'DZ') { |
|
148 | - return 'DZ'; |
|
149 | - } elseif (substr($name, 0, 2) == 'GY') { |
|
150 | - return 'GY'; |
|
151 | - } elseif (substr($name, 0, 2) == 'LY') { |
|
152 | - return 'LY'; |
|
153 | - } elseif (substr($name, 0, 2) == 'NY') { |
|
154 | - return 'NY'; |
|
155 | - } elseif (substr($name, 0, 2) == 'SZ') { |
|
156 | - return 'SZ'; |
|
157 | - } elseif (substr($name, 0, 2) == 'TY') { |
|
158 | - return 'TY'; |
|
159 | - } elseif (substr($name, 0, 2) == 'ZS') { |
|
160 | - return 'ZS'; |
|
161 | - } |
|
162 | - break; |
|
163 | - case 'nl': |
|
164 | - if (substr($name, 0, 2) == 'IJ') { |
|
165 | - return 'IJ'; |
|
166 | - } |
|
167 | - break; |
|
130 | + case 'cs': |
|
131 | + if (substr($name, 0, 2) == 'CH') { |
|
132 | + return 'CH'; |
|
133 | + } |
|
134 | + break; |
|
135 | + case 'da': |
|
136 | + case 'nb': |
|
137 | + case 'nn': |
|
138 | + if (substr($name, 0, 2) == 'AA') { |
|
139 | + return 'Å'; |
|
140 | + } |
|
141 | + break; |
|
142 | + case 'hu': |
|
143 | + if (substr($name, 0, 2) == 'CS') { |
|
144 | + return 'CS'; |
|
145 | + } elseif (substr($name, 0, 3) == 'DZS') { |
|
146 | + return 'DZS'; |
|
147 | + } elseif (substr($name, 0, 2) == 'DZ') { |
|
148 | + return 'DZ'; |
|
149 | + } elseif (substr($name, 0, 2) == 'GY') { |
|
150 | + return 'GY'; |
|
151 | + } elseif (substr($name, 0, 2) == 'LY') { |
|
152 | + return 'LY'; |
|
153 | + } elseif (substr($name, 0, 2) == 'NY') { |
|
154 | + return 'NY'; |
|
155 | + } elseif (substr($name, 0, 2) == 'SZ') { |
|
156 | + return 'SZ'; |
|
157 | + } elseif (substr($name, 0, 2) == 'TY') { |
|
158 | + return 'TY'; |
|
159 | + } elseif (substr($name, 0, 2) == 'ZS') { |
|
160 | + return 'ZS'; |
|
161 | + } |
|
162 | + break; |
|
163 | + case 'nl': |
|
164 | + if (substr($name, 0, 2) == 'IJ') { |
|
165 | + return 'IJ'; |
|
166 | + } |
|
167 | + break; |
|
168 | 168 | } |
169 | 169 | // No special rules - just take the first character |
170 | 170 | return mb_substr($name, 0, 1); |
@@ -192,37 +192,37 @@ discard block |
||
192 | 192 | */ |
193 | 193 | private function getInitialSql($field, $letter) { |
194 | 194 | switch (WT_LOCALE) { |
195 | - case 'cs': |
|
196 | - switch ($letter) { |
|
197 | - case 'C': return $field . " LIKE 'C%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'CH%' COLLATE " . I18N::collation(); |
|
198 | - } |
|
195 | + case 'cs': |
|
196 | + switch ($letter) { |
|
197 | + case 'C': return $field . " LIKE 'C%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'CH%' COLLATE " . I18N::collation(); |
|
198 | + } |
|
199 | 199 | break; |
200 | - case 'da': |
|
201 | - case 'nb': |
|
202 | - case 'nn': |
|
203 | - switch ($letter) { |
|
204 | - // AA gets listed under Å |
|
205 | - case 'A': return $field . " LIKE 'A%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'AA%' COLLATE " . I18N::collation(); |
|
206 | - case 'Å': return "(" . $field . " LIKE 'Å%' COLLATE " . I18N::collation() . " OR " . $field . " LIKE 'AA%' COLLATE " . I18N::collation() . ")"; |
|
207 | - } |
|
200 | + case 'da': |
|
201 | + case 'nb': |
|
202 | + case 'nn': |
|
203 | + switch ($letter) { |
|
204 | + // AA gets listed under Å |
|
205 | + case 'A': return $field . " LIKE 'A%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'AA%' COLLATE " . I18N::collation(); |
|
206 | + case 'Å': return "(" . $field . " LIKE 'Å%' COLLATE " . I18N::collation() . " OR " . $field . " LIKE 'AA%' COLLATE " . I18N::collation() . ")"; |
|
207 | + } |
|
208 | 208 | break; |
209 | - case 'hu': |
|
210 | - switch ($letter) { |
|
211 | - case 'C': return $field . " LIKE 'C%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'CS%' COLLATE " . I18N::collation(); |
|
212 | - case 'D': return $field . " LIKE 'D%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'DZ%' COLLATE " . I18N::collation(); |
|
213 | - case 'DZ': return $field . " LIKE 'DZ%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'DZS%' COLLATE " . I18N::collation(); |
|
214 | - case 'G': return $field . " LIKE 'G%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'GY%' COLLATE " . I18N::collation(); |
|
215 | - case 'L': return $field . " LIKE 'L%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'LY%' COLLATE " . I18N::collation(); |
|
216 | - case 'N': return $field . " LIKE 'N%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'NY%' COLLATE " . I18N::collation(); |
|
217 | - case 'S': return $field . " LIKE 'S%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'SZ%' COLLATE " . I18N::collation(); |
|
218 | - case 'T': return $field . " LIKE 'T%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'TY%' COLLATE " . I18N::collation(); |
|
219 | - case 'Z': return $field . " LIKE 'Z%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'ZS%' COLLATE " . I18N::collation(); |
|
220 | - } |
|
209 | + case 'hu': |
|
210 | + switch ($letter) { |
|
211 | + case 'C': return $field . " LIKE 'C%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'CS%' COLLATE " . I18N::collation(); |
|
212 | + case 'D': return $field . " LIKE 'D%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'DZ%' COLLATE " . I18N::collation(); |
|
213 | + case 'DZ': return $field . " LIKE 'DZ%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'DZS%' COLLATE " . I18N::collation(); |
|
214 | + case 'G': return $field . " LIKE 'G%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'GY%' COLLATE " . I18N::collation(); |
|
215 | + case 'L': return $field . " LIKE 'L%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'LY%' COLLATE " . I18N::collation(); |
|
216 | + case 'N': return $field . " LIKE 'N%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'NY%' COLLATE " . I18N::collation(); |
|
217 | + case 'S': return $field . " LIKE 'S%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'SZ%' COLLATE " . I18N::collation(); |
|
218 | + case 'T': return $field . " LIKE 'T%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'TY%' COLLATE " . I18N::collation(); |
|
219 | + case 'Z': return $field . " LIKE 'Z%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'ZS%' COLLATE " . I18N::collation(); |
|
220 | + } |
|
221 | 221 | break; |
222 | - case 'nl': |
|
223 | - switch ($letter) { |
|
224 | - case 'I': return $field . " LIKE 'I%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'IJ%' COLLATE " . I18N::collation(); |
|
225 | - } |
|
222 | + case 'nl': |
|
223 | + switch ($letter) { |
|
224 | + case 'I': return $field . " LIKE 'I%' COLLATE " . I18N::collation() . " AND " . $field . " NOT LIKE 'IJ%' COLLATE " . I18N::collation(); |
|
225 | + } |
|
226 | 226 | break; |
227 | 227 | } |
228 | 228 | |
@@ -538,12 +538,12 @@ discard block |
||
538 | 538 | */ |
539 | 539 | public function givenNameInitial($initial) { |
540 | 540 | switch ($initial) { |
541 | - case '@': |
|
542 | - return I18N::translateContext('Unknown given name', '…'); |
|
543 | - break; |
|
544 | - default: |
|
545 | - return Html::escape($initial); |
|
546 | - break; |
|
541 | + case '@': |
|
542 | + return I18N::translateContext('Unknown given name', '…'); |
|
543 | + break; |
|
544 | + default: |
|
545 | + return Html::escape($initial); |
|
546 | + break; |
|
547 | 547 | } |
548 | 548 | } |
549 | 549 | |
@@ -556,15 +556,15 @@ discard block |
||
556 | 556 | */ |
557 | 557 | public function surnameInitial($initial) { |
558 | 558 | switch ($initial) { |
559 | - case '@': |
|
560 | - return I18N::translateContext('Unknown surname', '…'); |
|
561 | - break; |
|
562 | - case ',': |
|
563 | - return I18N::translate('None'); |
|
564 | - break; |
|
565 | - default: |
|
566 | - return Html::escape($initial); |
|
567 | - break; |
|
559 | + case '@': |
|
560 | + return I18N::translateContext('Unknown surname', '…'); |
|
561 | + break; |
|
562 | + case ',': |
|
563 | + return I18N::translate('None'); |
|
564 | + break; |
|
565 | + default: |
|
566 | + return Html::escape($initial); |
|
567 | + break; |
|
568 | 568 | } |
569 | 569 | } |
570 | 570 | } |
@@ -169,46 +169,46 @@ |
||
169 | 169 | |
170 | 170 | // If we want to show associated persons, build the list |
171 | 171 | switch ($this->action) { |
172 | - case 'header': |
|
173 | - // We can type in an XREF into the header search, and jump straight to it. |
|
174 | - // Otherwise, the header search is the same as the general search |
|
175 | - if (preg_match('/' . WT_REGEX_XREF . '/', $this->query)) { |
|
176 | - $record = GedcomRecord::getInstance($this->query, $this->tree()); |
|
177 | - if ($record && $record->canShowName()) { |
|
178 | - header('Location: ' . $record->getRawUrl()); |
|
172 | + case 'header': |
|
173 | + // We can type in an XREF into the header search, and jump straight to it. |
|
174 | + // Otherwise, the header search is the same as the general search |
|
175 | + if (preg_match('/' . WT_REGEX_XREF . '/', $this->query)) { |
|
176 | + $record = GedcomRecord::getInstance($this->query, $this->tree()); |
|
177 | + if ($record && $record->canShowName()) { |
|
178 | + header('Location: ' . $record->getRawUrl()); |
|
179 | + exit; |
|
180 | + } |
|
181 | + } |
|
182 | + $this->action = 'general'; |
|
183 | + $this->srindi = 'checked'; |
|
184 | + $this->srfams = 'checked'; |
|
185 | + $this->srsour = 'checked'; |
|
186 | + $this->srnote = 'checked'; |
|
187 | + $this->setPageTitle(I18N::translate('General search')); |
|
188 | + $this->generalSearch(); |
|
189 | + break; |
|
190 | + case 'general': |
|
191 | + $this->setPageTitle(I18N::translate('General search')); |
|
192 | + $this->generalSearch(); |
|
193 | + break; |
|
194 | + case 'soundex': |
|
195 | + // Create a dummy search query to use as a title to the results list |
|
196 | + $this->query = trim($this->firstname . ' ' . $this->lastname . ' ' . $this->place); |
|
197 | + $this->setPageTitle(I18N::translate('Phonetic search')); |
|
198 | + $this->soundexSearch(); |
|
199 | + break; |
|
200 | + case 'replace': |
|
201 | + $this->setPageTitle(I18N::translate('Search and replace')); |
|
202 | + $this->search_trees = [$this->tree()]; |
|
203 | + $this->srindi = 'checked'; |
|
204 | + $this->srfams = 'checked'; |
|
205 | + $this->srsour = 'checked'; |
|
206 | + $this->srnote = 'checked'; |
|
207 | + if (Filter::post('query')) { |
|
208 | + $this->searchAndReplace($this->tree()); |
|
209 | + header('Location: search.php?action=replace&query=' . rawurlencode($this->query) . '&replace=' . rawurlencode($this->replace) . '&replaceAll=' . $this->replaceAll . '&replaceNames=' . $this->replaceNames . '&replacePlaces=' . $this->replacePlaces . '&replacePlacesWord=' . $this->replacePlacesWord); |
|
179 | 210 | exit; |
180 | 211 | } |
181 | - } |
|
182 | - $this->action = 'general'; |
|
183 | - $this->srindi = 'checked'; |
|
184 | - $this->srfams = 'checked'; |
|
185 | - $this->srsour = 'checked'; |
|
186 | - $this->srnote = 'checked'; |
|
187 | - $this->setPageTitle(I18N::translate('General search')); |
|
188 | - $this->generalSearch(); |
|
189 | - break; |
|
190 | - case 'general': |
|
191 | - $this->setPageTitle(I18N::translate('General search')); |
|
192 | - $this->generalSearch(); |
|
193 | - break; |
|
194 | - case 'soundex': |
|
195 | - // Create a dummy search query to use as a title to the results list |
|
196 | - $this->query = trim($this->firstname . ' ' . $this->lastname . ' ' . $this->place); |
|
197 | - $this->setPageTitle(I18N::translate('Phonetic search')); |
|
198 | - $this->soundexSearch(); |
|
199 | - break; |
|
200 | - case 'replace': |
|
201 | - $this->setPageTitle(I18N::translate('Search and replace')); |
|
202 | - $this->search_trees = [$this->tree()]; |
|
203 | - $this->srindi = 'checked'; |
|
204 | - $this->srfams = 'checked'; |
|
205 | - $this->srsour = 'checked'; |
|
206 | - $this->srnote = 'checked'; |
|
207 | - if (Filter::post('query')) { |
|
208 | - $this->searchAndReplace($this->tree()); |
|
209 | - header('Location: search.php?action=replace&query=' . rawurlencode($this->query) . '&replace=' . rawurlencode($this->replace) . '&replaceAll=' . $this->replaceAll . '&replaceNames=' . $this->replaceNames . '&replacePlaces=' . $this->replacePlaces . '&replacePlacesWord=' . $this->replacePlacesWord); |
|
210 | - exit; |
|
211 | - } |
|
212 | 212 | } |
213 | 213 | } |
214 | 214 |
@@ -373,108 +373,108 @@ discard block |
||
373 | 373 | if ($parts[0] == 'NAME') { |
374 | 374 | // NAME:* |
375 | 375 | switch ($parts[1]) { |
376 | - case 'GIVN': |
|
377 | - switch ($parts[2]) { |
|
378 | - case 'EXACT': |
|
379 | - $sql .= " AND i_n.n_givn=?"; |
|
380 | - $bind[] = $value; |
|
381 | - break; |
|
382 | - case 'BEGINS': |
|
383 | - $sql .= " AND i_n.n_givn LIKE CONCAT(?, '%')"; |
|
384 | - $bind[] = $value; |
|
385 | - break; |
|
386 | - case 'CONTAINS': |
|
387 | - $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
388 | - $bind[] = $value; |
|
389 | - break; |
|
390 | - case 'SDX_STD': |
|
391 | - $sdx = Soundex::russell($value); |
|
392 | - if ($sdx !== null) { |
|
393 | - $sdx = explode(':', $sdx); |
|
394 | - foreach ($sdx as $k => $v) { |
|
395 | - $sdx[$k] = "i_n.n_soundex_givn_std LIKE CONCAT('%', ?, '%')"; |
|
396 | - $bind[] = $v; |
|
397 | - } |
|
398 | - $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
|
399 | - } else { |
|
400 | - // No phonetic content? Use a substring match |
|
401 | - $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
402 | - $bind[] = $value; |
|
376 | + case 'GIVN': |
|
377 | + switch ($parts[2]) { |
|
378 | + case 'EXACT': |
|
379 | + $sql .= " AND i_n.n_givn=?"; |
|
380 | + $bind[] = $value; |
|
381 | + break; |
|
382 | + case 'BEGINS': |
|
383 | + $sql .= " AND i_n.n_givn LIKE CONCAT(?, '%')"; |
|
384 | + $bind[] = $value; |
|
385 | + break; |
|
386 | + case 'CONTAINS': |
|
387 | + $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
388 | + $bind[] = $value; |
|
389 | + break; |
|
390 | + case 'SDX_STD': |
|
391 | + $sdx = Soundex::russell($value); |
|
392 | + if ($sdx !== null) { |
|
393 | + $sdx = explode(':', $sdx); |
|
394 | + foreach ($sdx as $k => $v) { |
|
395 | + $sdx[$k] = "i_n.n_soundex_givn_std LIKE CONCAT('%', ?, '%')"; |
|
396 | + $bind[] = $v; |
|
397 | + } |
|
398 | + $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
|
399 | + } else { |
|
400 | + // No phonetic content? Use a substring match |
|
401 | + $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
402 | + $bind[] = $value; |
|
403 | + } |
|
404 | + break; |
|
405 | + case 'SDX': // SDX uses DM by default. |
|
406 | + case 'SDX_DM': |
|
407 | + $sdx = Soundex::daitchMokotoff($value); |
|
408 | + if ($sdx !== null) { |
|
409 | + $sdx = explode(':', $sdx); |
|
410 | + foreach ($sdx as $k => $v) { |
|
411 | + $sdx[$k] = "i_n.n_soundex_givn_dm LIKE CONCAT('%', ?, '%')"; |
|
412 | + $bind[] = $v; |
|
413 | + } |
|
414 | + $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
|
415 | + } else { |
|
416 | + // No phonetic content? Use a substring match |
|
417 | + $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
418 | + $bind[] = $value; |
|
419 | + } |
|
420 | + break; |
|
403 | 421 | } |
404 | - break; |
|
405 | - case 'SDX': // SDX uses DM by default. |
|
406 | - case 'SDX_DM': |
|
407 | - $sdx = Soundex::daitchMokotoff($value); |
|
408 | - if ($sdx !== null) { |
|
409 | - $sdx = explode(':', $sdx); |
|
410 | - foreach ($sdx as $k => $v) { |
|
411 | - $sdx[$k] = "i_n.n_soundex_givn_dm LIKE CONCAT('%', ?, '%')"; |
|
412 | - $bind[] = $v; |
|
413 | - } |
|
414 | - $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
|
415 | - } else { |
|
416 | - // No phonetic content? Use a substring match |
|
417 | - $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
418 | - $bind[] = $value; |
|
422 | + break; |
|
423 | + case 'SURN': |
|
424 | + switch ($parts[2]) { |
|
425 | + case 'EXACT': |
|
426 | + $sql .= " AND i_n.n_surname=?"; |
|
427 | + $bind[] = $value; |
|
428 | + break; |
|
429 | + case 'BEGINS': |
|
430 | + $sql .= " AND i_n.n_surname LIKE CONCAT(?, '%')"; |
|
431 | + $bind[] = $value; |
|
432 | + break; |
|
433 | + case 'CONTAINS': |
|
434 | + $sql .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')"; |
|
435 | + $bind[] = $value; |
|
436 | + break; |
|
437 | + case 'SDX_STD': |
|
438 | + $sdx = Soundex::russell($value); |
|
439 | + if ($sdx !== null) { |
|
440 | + $sdx = explode(':', $sdx); |
|
441 | + foreach ($sdx as $k => $v) { |
|
442 | + $sdx[$k] = "i_n.n_soundex_surn_std LIKE CONCAT('%', ?, '%')"; |
|
443 | + $bind[] = $v; |
|
444 | + } |
|
445 | + $sql .= " AND (" . implode(' OR ', $sdx) . ")"; |
|
446 | + } else { |
|
447 | + // No phonetic content? Use a substring match |
|
448 | + $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')"; |
|
449 | + $bind[] = $value; |
|
450 | + } |
|
451 | + break; |
|
452 | + case 'SDX': // SDX uses DM by default. |
|
453 | + case 'SDX_DM': |
|
454 | + $sdx = Soundex::daitchMokotoff($value); |
|
455 | + if ($sdx !== null) { |
|
456 | + $sdx = explode(':', $sdx); |
|
457 | + foreach ($sdx as $k => $v) { |
|
458 | + $sdx[$k] = "i_n.n_soundex_surn_dm LIKE CONCAT('%', ?, '%')"; |
|
459 | + $bind[] = $v; |
|
460 | + } |
|
461 | + $sql .= " AND (" . implode(' OR ', $sdx) . ")"; |
|
462 | + break; |
|
463 | + } else { |
|
464 | + // No phonetic content? Use a substring match |
|
465 | + $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')"; |
|
466 | + $bind[] = $value; |
|
467 | + } |
|
419 | 468 | } |
420 | - break; |
|
421 | - } |
|
422 | 469 | break; |
423 | - case 'SURN': |
|
424 | - switch ($parts[2]) { |
|
425 | - case 'EXACT': |
|
426 | - $sql .= " AND i_n.n_surname=?"; |
|
470 | + case 'NICK': |
|
471 | + case '_MARNM': |
|
472 | + case '_HEB': |
|
473 | + case '_AKA': |
|
474 | + $sql .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')"; |
|
475 | + $bind[] = $parts[1]; |
|
427 | 476 | $bind[] = $value; |
428 | 477 | break; |
429 | - case 'BEGINS': |
|
430 | - $sql .= " AND i_n.n_surname LIKE CONCAT(?, '%')"; |
|
431 | - $bind[] = $value; |
|
432 | - break; |
|
433 | - case 'CONTAINS': |
|
434 | - $sql .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')"; |
|
435 | - $bind[] = $value; |
|
436 | - break; |
|
437 | - case 'SDX_STD': |
|
438 | - $sdx = Soundex::russell($value); |
|
439 | - if ($sdx !== null) { |
|
440 | - $sdx = explode(':', $sdx); |
|
441 | - foreach ($sdx as $k => $v) { |
|
442 | - $sdx[$k] = "i_n.n_soundex_surn_std LIKE CONCAT('%', ?, '%')"; |
|
443 | - $bind[] = $v; |
|
444 | - } |
|
445 | - $sql .= " AND (" . implode(' OR ', $sdx) . ")"; |
|
446 | - } else { |
|
447 | - // No phonetic content? Use a substring match |
|
448 | - $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')"; |
|
449 | - $bind[] = $value; |
|
450 | - } |
|
451 | - break; |
|
452 | - case 'SDX': // SDX uses DM by default. |
|
453 | - case 'SDX_DM': |
|
454 | - $sdx = Soundex::daitchMokotoff($value); |
|
455 | - if ($sdx !== null) { |
|
456 | - $sdx = explode(':', $sdx); |
|
457 | - foreach ($sdx as $k => $v) { |
|
458 | - $sdx[$k] = "i_n.n_soundex_surn_dm LIKE CONCAT('%', ?, '%')"; |
|
459 | - $bind[] = $v; |
|
460 | - } |
|
461 | - $sql .= " AND (" . implode(' OR ', $sdx) . ")"; |
|
462 | - break; |
|
463 | - } else { |
|
464 | - // No phonetic content? Use a substring match |
|
465 | - $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')"; |
|
466 | - $bind[] = $value; |
|
467 | - } |
|
468 | - } |
|
469 | - break; |
|
470 | - case 'NICK': |
|
471 | - case '_MARNM': |
|
472 | - case '_HEB': |
|
473 | - case '_AKA': |
|
474 | - $sql .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')"; |
|
475 | - $bind[] = $parts[1]; |
|
476 | - $bind[] = $value; |
|
477 | - break; |
|
478 | 478 | } |
479 | 479 | } elseif ($parts[1] == 'DATE') { |
480 | 480 | // *:DATE |
@@ -522,99 +522,99 @@ discard block |
||
522 | 522 | $table = $parts[1] == 'HUSB' ? 'f_n' : 'm_n'; |
523 | 523 | // NAME:* |
524 | 524 | switch ($parts[3]) { |
525 | - case 'GIVN': |
|
526 | - switch ($parts[4]) { |
|
527 | - case 'EXACT': |
|
528 | - $sql .= " AND {$table}.n_givn=?"; |
|
529 | - $bind[] = $value; |
|
530 | - break; |
|
531 | - case 'BEGINS': |
|
532 | - $sql .= " AND {$table}.n_givn LIKE CONCAT(?, '%')"; |
|
533 | - $bind[] = $value; |
|
534 | - break; |
|
535 | - case 'CONTAINS': |
|
536 | - $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')"; |
|
537 | - $bind[] = $value; |
|
538 | - break; |
|
539 | - case 'SDX_STD': |
|
540 | - $sdx = Soundex::russell($value); |
|
541 | - if ($sdx !== null) { |
|
542 | - $sdx = explode(':', $sdx); |
|
543 | - foreach ($sdx as $k => $v) { |
|
544 | - $sdx[$k] = "{$table}.n_soundex_givn_std LIKE CONCAT('%', ?, '%')"; |
|
545 | - $bind[] = $v; |
|
546 | - } |
|
547 | - $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
|
548 | - } else { |
|
549 | - // No phonetic content? Use a substring match |
|
550 | - $sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')"; |
|
551 | - $bind[] = $value; |
|
525 | + case 'GIVN': |
|
526 | + switch ($parts[4]) { |
|
527 | + case 'EXACT': |
|
528 | + $sql .= " AND {$table}.n_givn=?"; |
|
529 | + $bind[] = $value; |
|
530 | + break; |
|
531 | + case 'BEGINS': |
|
532 | + $sql .= " AND {$table}.n_givn LIKE CONCAT(?, '%')"; |
|
533 | + $bind[] = $value; |
|
534 | + break; |
|
535 | + case 'CONTAINS': |
|
536 | + $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')"; |
|
537 | + $bind[] = $value; |
|
538 | + break; |
|
539 | + case 'SDX_STD': |
|
540 | + $sdx = Soundex::russell($value); |
|
541 | + if ($sdx !== null) { |
|
542 | + $sdx = explode(':', $sdx); |
|
543 | + foreach ($sdx as $k => $v) { |
|
544 | + $sdx[$k] = "{$table}.n_soundex_givn_std LIKE CONCAT('%', ?, '%')"; |
|
545 | + $bind[] = $v; |
|
546 | + } |
|
547 | + $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
|
548 | + } else { |
|
549 | + // No phonetic content? Use a substring match |
|
550 | + $sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')"; |
|
551 | + $bind[] = $value; |
|
552 | + } |
|
553 | + break; |
|
554 | + case 'SDX': // SDX uses DM by default. |
|
555 | + case 'SDX_DM': |
|
556 | + $sdx = Soundex::daitchMokotoff($value); |
|
557 | + if ($sdx !== null) { |
|
558 | + $sdx = explode(':', $sdx); |
|
559 | + foreach ($sdx as $k => $v) { |
|
560 | + $sdx[$k] = "{$table}.n_soundex_givn_dm LIKE CONCAT('%', ?, '%')"; |
|
561 | + $bind[] = $v; |
|
562 | + } |
|
563 | + $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
|
564 | + break; |
|
565 | + } else { |
|
566 | + // No phonetic content? Use a substring match |
|
567 | + $sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')"; |
|
568 | + $bind[] = $value; |
|
569 | + } |
|
552 | 570 | } |
553 | - break; |
|
554 | - case 'SDX': // SDX uses DM by default. |
|
555 | - case 'SDX_DM': |
|
556 | - $sdx = Soundex::daitchMokotoff($value); |
|
557 | - if ($sdx !== null) { |
|
558 | - $sdx = explode(':', $sdx); |
|
559 | - foreach ($sdx as $k => $v) { |
|
560 | - $sdx[$k] = "{$table}.n_soundex_givn_dm LIKE CONCAT('%', ?, '%')"; |
|
561 | - $bind[] = $v; |
|
562 | - } |
|
563 | - $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
|
564 | - break; |
|
565 | - } else { |
|
566 | - // No phonetic content? Use a substring match |
|
567 | - $sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')"; |
|
568 | - $bind[] = $value; |
|
569 | - } |
|
570 | - } |
|
571 | 571 | break; |
572 | - case 'SURN': |
|
573 | - switch ($parts[4]) { |
|
574 | - case 'EXACT': |
|
575 | - $sql .= " AND {$table}.n_surname=?"; |
|
576 | - $bind[] = $value; |
|
577 | - break; |
|
578 | - case 'BEGINS': |
|
579 | - $sql .= " AND {$table}.n_surname LIKE CONCAT(?, '%')"; |
|
580 | - $bind[] = $value; |
|
581 | - break; |
|
582 | - case 'CONTAINS': |
|
583 | - $sql .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')"; |
|
584 | - $bind[] = $value; |
|
585 | - break; |
|
586 | - case 'SDX_STD': |
|
587 | - $sdx = Soundex::russell($value); |
|
588 | - if ($sdx !== null) { |
|
589 | - $sdx = explode(':', $sdx); |
|
590 | - foreach ($sdx as $k => $v) { |
|
591 | - $sdx[$k] = "{$table}.n_soundex_surn_std LIKE CONCAT('%', ?, '%')"; |
|
592 | - $bind[] = $v; |
|
593 | - } |
|
594 | - $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
|
595 | - } else { |
|
596 | - // No phonetic content? Use a substring match |
|
597 | - $sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')"; |
|
598 | - $bind[] = $value; |
|
599 | - } |
|
600 | - break; |
|
601 | - case 'SDX': // SDX uses DM by default. |
|
602 | - case 'SDX_DM': |
|
603 | - $sdx = Soundex::daitchMokotoff($value); |
|
604 | - if ($sdx !== null) { |
|
605 | - $sdx = explode(':', $sdx); |
|
606 | - foreach ($sdx as $k => $v) { |
|
607 | - $sdx[$k] = "{$table}.n_soundex_surn_dm LIKE CONCAT('%', ?, '%')"; |
|
608 | - $bind[] = $v; |
|
609 | - } |
|
610 | - $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
|
611 | - } else { |
|
612 | - // No phonetic content? Use a substring match |
|
613 | - $sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')"; |
|
614 | - $bind[] = $value; |
|
572 | + case 'SURN': |
|
573 | + switch ($parts[4]) { |
|
574 | + case 'EXACT': |
|
575 | + $sql .= " AND {$table}.n_surname=?"; |
|
576 | + $bind[] = $value; |
|
577 | + break; |
|
578 | + case 'BEGINS': |
|
579 | + $sql .= " AND {$table}.n_surname LIKE CONCAT(?, '%')"; |
|
580 | + $bind[] = $value; |
|
581 | + break; |
|
582 | + case 'CONTAINS': |
|
583 | + $sql .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')"; |
|
584 | + $bind[] = $value; |
|
585 | + break; |
|
586 | + case 'SDX_STD': |
|
587 | + $sdx = Soundex::russell($value); |
|
588 | + if ($sdx !== null) { |
|
589 | + $sdx = explode(':', $sdx); |
|
590 | + foreach ($sdx as $k => $v) { |
|
591 | + $sdx[$k] = "{$table}.n_soundex_surn_std LIKE CONCAT('%', ?, '%')"; |
|
592 | + $bind[] = $v; |
|
593 | + } |
|
594 | + $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
|
595 | + } else { |
|
596 | + // No phonetic content? Use a substring match |
|
597 | + $sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')"; |
|
598 | + $bind[] = $value; |
|
599 | + } |
|
600 | + break; |
|
601 | + case 'SDX': // SDX uses DM by default. |
|
602 | + case 'SDX_DM': |
|
603 | + $sdx = Soundex::daitchMokotoff($value); |
|
604 | + if ($sdx !== null) { |
|
605 | + $sdx = explode(':', $sdx); |
|
606 | + foreach ($sdx as $k => $v) { |
|
607 | + $sdx[$k] = "{$table}.n_soundex_surn_dm LIKE CONCAT('%', ?, '%')"; |
|
608 | + $bind[] = $v; |
|
609 | + } |
|
610 | + $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
|
611 | + } else { |
|
612 | + // No phonetic content? Use a substring match |
|
613 | + $sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')"; |
|
614 | + $bind[] = $value; |
|
615 | + } |
|
616 | + break; |
|
615 | 617 | } |
616 | - break; |
|
617 | - } |
|
618 | 618 | break; |
619 | 619 | } |
620 | 620 | } elseif ($parts[0] === 'FAMS') { |
@@ -497,23 +497,23 @@ |
||
497 | 497 | */ |
498 | 498 | private function getCalendarDate($date) { |
499 | 499 | switch ($this->calendar) { |
500 | - case 'julian': |
|
501 | - $caldate = new JulianDate($date); |
|
502 | - break; |
|
503 | - case 'french': |
|
504 | - $caldate = new FrenchDate($date); |
|
505 | - break; |
|
506 | - case 'jewish': |
|
507 | - $caldate = new JewishDate($date); |
|
508 | - break; |
|
509 | - case 'hijri': |
|
510 | - $caldate = new HijriDate($date); |
|
511 | - break; |
|
512 | - case 'jalali': |
|
513 | - $caldate = new JalaliDate($date); |
|
514 | - break; |
|
515 | - default: |
|
516 | - $caldate = new GregorianDate($date); |
|
500 | + case 'julian': |
|
501 | + $caldate = new JulianDate($date); |
|
502 | + break; |
|
503 | + case 'french': |
|
504 | + $caldate = new FrenchDate($date); |
|
505 | + break; |
|
506 | + case 'jewish': |
|
507 | + $caldate = new JewishDate($date); |
|
508 | + break; |
|
509 | + case 'hijri': |
|
510 | + $caldate = new HijriDate($date); |
|
511 | + break; |
|
512 | + case 'jalali': |
|
513 | + $caldate = new JalaliDate($date); |
|
514 | + break; |
|
515 | + default: |
|
516 | + $caldate = new GregorianDate($date); |
|
517 | 517 | } |
518 | 518 | |
519 | 519 | return $caldate; |
@@ -124,47 +124,47 @@ |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | switch ($this->chart_style) { |
127 | - case 0: |
|
128 | - // List |
|
129 | - return |
|
130 | - '<ul class="chart_common">' . |
|
131 | - $this->printChildAscendancy($this->root, 1, $this->generations - 1) . |
|
132 | - '</ul>'; |
|
133 | - |
|
134 | - case 1: |
|
135 | - // Booklet |
|
136 | - // first page : show indi facts |
|
137 | - FunctionsPrint::printPedigreePerson($this->root); |
|
138 | - // process the tree |
|
139 | - $ancestors = $this->sosaAncestors($this->generations - 1); |
|
140 | - $ancestors = array_filter($ancestors); // The SOSA array includes empty placeholders |
|
141 | - |
|
142 | - foreach ($ancestors as $sosa => $individual) { |
|
143 | - foreach ($individual->getChildFamilies() as $family) { |
|
144 | - FunctionsCharts::printSosaFamily($family->getXref(), $individual->getXref(), $sosa, '', '', '', $this->show_cousins); |
|
127 | + case 0: |
|
128 | + // List |
|
129 | + return |
|
130 | + '<ul class="chart_common">' . |
|
131 | + $this->printChildAscendancy($this->root, 1, $this->generations - 1) . |
|
132 | + '</ul>'; |
|
133 | + |
|
134 | + case 1: |
|
135 | + // Booklet |
|
136 | + // first page : show indi facts |
|
137 | + FunctionsPrint::printPedigreePerson($this->root); |
|
138 | + // process the tree |
|
139 | + $ancestors = $this->sosaAncestors($this->generations - 1); |
|
140 | + $ancestors = array_filter($ancestors); // The SOSA array includes empty placeholders |
|
141 | + |
|
142 | + foreach ($ancestors as $sosa => $individual) { |
|
143 | + foreach ($individual->getChildFamilies() as $family) { |
|
144 | + FunctionsCharts::printSosaFamily($family->getXref(), $individual->getXref(), $sosa, '', '', '', $this->show_cousins); |
|
145 | + } |
|
145 | 146 | } |
146 | - } |
|
147 | - break; |
|
148 | - |
|
149 | - case 2: |
|
150 | - // Individual list |
|
151 | - $ancestors = $this->sosaAncestors($this->generations); |
|
152 | - $ancestors = array_filter($ancestors); // The SOSA array includes empty placeholders |
|
153 | - |
|
154 | - return FunctionsPrintLists::individualTable($ancestors, 'sosa'); |
|
155 | - |
|
156 | - case 3: |
|
157 | - // Family list |
|
158 | - $ancestors = $this->sosaAncestors($this->generations - 1); |
|
159 | - $ancestors = array_filter($ancestors); // The SOSA array includes empty placeholders |
|
160 | - $families = []; |
|
161 | - foreach ($ancestors as $individual) { |
|
162 | - foreach ($individual->getChildFamilies() as $family) { |
|
163 | - $families[$family->getXref()] = $family; |
|
147 | + break; |
|
148 | + |
|
149 | + case 2: |
|
150 | + // Individual list |
|
151 | + $ancestors = $this->sosaAncestors($this->generations); |
|
152 | + $ancestors = array_filter($ancestors); // The SOSA array includes empty placeholders |
|
153 | + |
|
154 | + return FunctionsPrintLists::individualTable($ancestors, 'sosa'); |
|
155 | + |
|
156 | + case 3: |
|
157 | + // Family list |
|
158 | + $ancestors = $this->sosaAncestors($this->generations - 1); |
|
159 | + $ancestors = array_filter($ancestors); // The SOSA array includes empty placeholders |
|
160 | + $families = []; |
|
161 | + foreach ($ancestors as $individual) { |
|
162 | + foreach ($individual->getChildFamilies() as $family) { |
|
163 | + $families[$family->getXref()] = $family; |
|
164 | + } |
|
164 | 165 | } |
165 | - } |
|
166 | 166 | |
167 | - return FunctionsPrintLists::familyTable($families); |
|
167 | + return FunctionsPrintLists::familyTable($families); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | return ''; |
@@ -99,26 +99,26 @@ discard block |
||
99 | 99 | |
100 | 100 | $this->arrows = new \stdClass(); |
101 | 101 | switch ($this->orientation) { |
102 | - case self::PORTRAIT: |
|
103 | - //drop through |
|
104 | - case self::LANDSCAPE: |
|
105 | - $this->arrows->prevGen = 'fa fa-arrow-end wt-icon-arrow-end'; |
|
106 | - $this->arrows->menu = 'fa fa-arrow-start wt-icon-arrow-start'; |
|
107 | - $addoffset['x'] = $this->chartHasAncestors ? self::ARROW_SIZE : 0; |
|
108 | - $addoffset['y'] = 0; |
|
109 | - break; |
|
110 | - case self::OLDEST_AT_TOP: |
|
111 | - $this->arrows->prevGen = 'fa fa-arrow-up wt-icon-arrow-up'; |
|
112 | - $this->arrows->menu = 'fa fa-arrow-down wt-icon-arrow-down'; |
|
113 | - $addoffset['x'] = 0; |
|
114 | - $addoffset['y'] = $this->root->getSpouseFamilies() ? self::ARROW_SIZE : 0; |
|
115 | - break; |
|
116 | - case self::OLDEST_AT_BOTTOM: |
|
117 | - $this->arrows->prevGen = 'fa fa-arrow-down wt-icon-arrow-down'; |
|
118 | - $this->arrows->menu = 'fa fa-arrow-up wt-icon-arrow-up'; |
|
119 | - $addoffset['x'] = 0; |
|
120 | - $addoffset['y'] = $this->chartHasAncestors ? self::ARROW_SIZE : 0; |
|
121 | - break; |
|
102 | + case self::PORTRAIT: |
|
103 | + //drop through |
|
104 | + case self::LANDSCAPE: |
|
105 | + $this->arrows->prevGen = 'fa fa-arrow-end wt-icon-arrow-end'; |
|
106 | + $this->arrows->menu = 'fa fa-arrow-start wt-icon-arrow-start'; |
|
107 | + $addoffset['x'] = $this->chartHasAncestors ? self::ARROW_SIZE : 0; |
|
108 | + $addoffset['y'] = 0; |
|
109 | + break; |
|
110 | + case self::OLDEST_AT_TOP: |
|
111 | + $this->arrows->prevGen = 'fa fa-arrow-up wt-icon-arrow-up'; |
|
112 | + $this->arrows->menu = 'fa fa-arrow-down wt-icon-arrow-down'; |
|
113 | + $addoffset['x'] = 0; |
|
114 | + $addoffset['y'] = $this->root->getSpouseFamilies() ? self::ARROW_SIZE : 0; |
|
115 | + break; |
|
116 | + case self::OLDEST_AT_BOTTOM: |
|
117 | + $this->arrows->prevGen = 'fa fa-arrow-down wt-icon-arrow-down'; |
|
118 | + $this->arrows->menu = 'fa fa-arrow-up wt-icon-arrow-up'; |
|
119 | + $addoffset['x'] = 0; |
|
120 | + $addoffset['y'] = $this->chartHasAncestors ? self::ARROW_SIZE : 0; |
|
121 | + break; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | // -- this next section will create and position the DIV layers for the pedigree tree |
@@ -147,73 +147,73 @@ discard block |
||
147 | 147 | |
148 | 148 | // -- calculate the xoffset |
149 | 149 | switch ($this->orientation) { |
150 | - case self::PORTRAIT: |
|
151 | - $xoffset = ($this->generations - $curgen) * (($this->getBoxDimensions()->width + $bxspacing) / 1.8); |
|
152 | - if (!$i && $this->root->getSpouseFamilies()) { |
|
153 | - $xoffset -= self::ARROW_SIZE; |
|
154 | - } |
|
155 | - // -- compact the tree |
|
156 | - if ($curgen < $this->generations) { |
|
157 | - if ($i % 2 == 0) { |
|
158 | - $yoffset = $yoffset - (($boxspacing / 2) * ($curgen - 1)); |
|
159 | - } else { |
|
160 | - $yoffset = $yoffset + (($boxspacing / 2) * ($curgen - 1)); |
|
150 | + case self::PORTRAIT: |
|
151 | + $xoffset = ($this->generations - $curgen) * (($this->getBoxDimensions()->width + $bxspacing) / 1.8); |
|
152 | + if (!$i && $this->root->getSpouseFamilies()) { |
|
153 | + $xoffset -= self::ARROW_SIZE; |
|
161 | 154 | } |
162 | - $parent = (int) (($i - 1) / 2); |
|
163 | - $pgen = $curgen; |
|
164 | - while ($parent > 0) { |
|
165 | - if ($parent % 2 == 0) { |
|
166 | - $yoffset = $yoffset - (($boxspacing / 2) * $pgen); |
|
155 | + // -- compact the tree |
|
156 | + if ($curgen < $this->generations) { |
|
157 | + if ($i % 2 == 0) { |
|
158 | + $yoffset = $yoffset - (($boxspacing / 2) * ($curgen - 1)); |
|
167 | 159 | } else { |
168 | - $yoffset = $yoffset + (($boxspacing / 2) * $pgen); |
|
160 | + $yoffset = $yoffset + (($boxspacing / 2) * ($curgen - 1)); |
|
161 | + } |
|
162 | + $parent = (int) (($i - 1) / 2); |
|
163 | + $pgen = $curgen; |
|
164 | + while ($parent > 0) { |
|
165 | + if ($parent % 2 == 0) { |
|
166 | + $yoffset = $yoffset - (($boxspacing / 2) * $pgen); |
|
167 | + } else { |
|
168 | + $yoffset = $yoffset + (($boxspacing / 2) * $pgen); |
|
169 | + } |
|
170 | + $pgen++; |
|
171 | + if ($pgen > 3) { |
|
172 | + $temp = 0; |
|
173 | + for ($j = 1; $j < ($pgen - 2); $j++) { |
|
174 | + $temp += (pow(2, $j) - 1); |
|
175 | + } |
|
176 | + if ($parent % 2 == 0) { |
|
177 | + $yoffset = $yoffset - (($boxspacing / 2) * $temp); |
|
178 | + } else { |
|
179 | + $yoffset = $yoffset + (($boxspacing / 2) * $temp); |
|
180 | + } |
|
181 | + } |
|
182 | + $parent = (int) (($parent - 1) / 2); |
|
169 | 183 | } |
170 | - $pgen++; |
|
171 | - if ($pgen > 3) { |
|
184 | + if ($curgen > 3) { |
|
172 | 185 | $temp = 0; |
173 | - for ($j = 1; $j < ($pgen - 2); $j++) { |
|
186 | + for ($j = 1; $j < ($curgen - 2); $j++) { |
|
174 | 187 | $temp += (pow(2, $j) - 1); |
175 | 188 | } |
176 | - if ($parent % 2 == 0) { |
|
189 | + if ($i % 2 == 0) { |
|
177 | 190 | $yoffset = $yoffset - (($boxspacing / 2) * $temp); |
178 | 191 | } else { |
179 | 192 | $yoffset = $yoffset + (($boxspacing / 2) * $temp); |
180 | 193 | } |
181 | 194 | } |
182 | - $parent = (int) (($parent - 1) / 2); |
|
183 | 195 | } |
184 | - if ($curgen > 3) { |
|
185 | - $temp = 0; |
|
186 | - for ($j = 1; $j < ($curgen - 2); $j++) { |
|
187 | - $temp += (pow(2, $j) - 1); |
|
188 | - } |
|
189 | - if ($i % 2 == 0) { |
|
190 | - $yoffset = $yoffset - (($boxspacing / 2) * $temp); |
|
191 | - } else { |
|
192 | - $yoffset = $yoffset + (($boxspacing / 2) * $temp); |
|
193 | - } |
|
196 | + $yoffset -= (($boxspacing / 2) * pow(2, ($this->generations - 2)) - ($boxspacing / 2)); |
|
197 | + break; |
|
198 | + case self::LANDSCAPE: |
|
199 | + $xoffset = ($this->generations - $curgen) * ($this->getBoxDimensions()->width + $bxspacing); |
|
200 | + if ($curgen == 1) { |
|
201 | + $xoffset += 10; |
|
194 | 202 | } |
195 | - } |
|
196 | - $yoffset -= (($boxspacing / 2) * pow(2, ($this->generations - 2)) - ($boxspacing / 2)); |
|
197 | - break; |
|
198 | - case self::LANDSCAPE: |
|
199 | - $xoffset = ($this->generations - $curgen) * ($this->getBoxDimensions()->width + $bxspacing); |
|
200 | - if ($curgen == 1) { |
|
201 | - $xoffset += 10; |
|
202 | - } |
|
203 | - break; |
|
204 | - case self::OLDEST_AT_TOP: |
|
205 | - //swap x & y offsets as chart is rotated |
|
206 | - $xoffset = $yoffset; |
|
207 | - $yoffset = $curgen * ($this->getBoxDimensions()->height + ($byspacing * 4)); |
|
208 | - break; |
|
209 | - case self::OLDEST_AT_BOTTOM: |
|
210 | - //swap x & y offsets as chart is rotated |
|
211 | - $xoffset = $yoffset; |
|
212 | - $yoffset = ($this->generations - $curgen) * ($this->getBoxDimensions()->height + ($byspacing * 2)); |
|
213 | - if ($i && $this->root->getSpouseFamilies()) { |
|
214 | - $yoffset += self::ARROW_SIZE; |
|
215 | - } |
|
216 | - break; |
|
203 | + break; |
|
204 | + case self::OLDEST_AT_TOP: |
|
205 | + //swap x & y offsets as chart is rotated |
|
206 | + $xoffset = $yoffset; |
|
207 | + $yoffset = $curgen * ($this->getBoxDimensions()->height + ($byspacing * 4)); |
|
208 | + break; |
|
209 | + case self::OLDEST_AT_BOTTOM: |
|
210 | + //swap x & y offsets as chart is rotated |
|
211 | + $xoffset = $yoffset; |
|
212 | + $yoffset = ($this->generations - $curgen) * ($this->getBoxDimensions()->height + ($byspacing * 2)); |
|
213 | + if ($i && $this->root->getSpouseFamilies()) { |
|
214 | + $yoffset += self::ARROW_SIZE; |
|
215 | + } |
|
216 | + break; |
|
217 | 217 | } |
218 | 218 | $this->nodes[$i]['x'] = (int) $xoffset; |
219 | 219 | $this->nodes[$i]['y'] = (int) $yoffset; |
@@ -245,15 +245,15 @@ discard block |
||
245 | 245 | $text .= "\n" . I18N::reverseText($person->getLifeSpan()); |
246 | 246 | |
247 | 247 | switch ($person->getSex()) { |
248 | - case 'M': |
|
249 | - $bg = $bgcolorM; |
|
250 | - break; |
|
251 | - case 'F': |
|
252 | - $bg = $bgcolorF; |
|
253 | - break; |
|
254 | - default: |
|
255 | - $bg = $bgcolor; |
|
256 | - break; |
|
248 | + case 'M': |
|
249 | + $bg = $bgcolorM; |
|
250 | + break; |
|
251 | + case 'F': |
|
252 | + $bg = $bgcolorF; |
|
253 | + break; |
|
254 | + default: |
|
255 | + $bg = $bgcolor; |
|
256 | + break; |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | imagefilledarc($image, $cx, $cy, $rx, $rx, $deg1, $deg2, $bg, IMG_ARC_PIE); |
@@ -364,19 +364,19 @@ discard block |
||
364 | 364 | $imagemap .= '</map>'; |
365 | 365 | |
366 | 366 | switch ($what) { |
367 | - case 'html': |
|
368 | - return $html . $imagemap . '<div id="fan_chart_img"><img src="fanchart.php?rootid=' . $this->root->getXref() . '&fan_style=' . $this->fan_style . '&generations=' . $this->generations . '&fan_width=' . $this->fan_width . '&img=1" width="' . $fanw . '" height="' . $fanh . '" alt="' . strip_tags($this->getPageTitle()) . '" usemap="#fanmap"></div>'; |
|
367 | + case 'html': |
|
368 | + return $html . $imagemap . '<div id="fan_chart_img"><img src="fanchart.php?rootid=' . $this->root->getXref() . '&fan_style=' . $this->fan_style . '&generations=' . $this->generations . '&fan_width=' . $this->fan_width . '&img=1" width="' . $fanw . '" height="' . $fanh . '" alt="' . strip_tags($this->getPageTitle()) . '" usemap="#fanmap"></div>'; |
|
369 | 369 | |
370 | - case 'png': |
|
371 | - imagestringup($image, 1, $fanw - 10, $fanh / 3, WT_BASE_URL, $color); |
|
372 | - ob_start(); |
|
373 | - imagepng($image); |
|
374 | - imagedestroy($image); |
|
370 | + case 'png': |
|
371 | + imagestringup($image, 1, $fanw - 10, $fanh / 3, WT_BASE_URL, $color); |
|
372 | + ob_start(); |
|
373 | + imagepng($image); |
|
374 | + imagedestroy($image); |
|
375 | 375 | |
376 | - return ob_get_clean(); |
|
376 | + return ob_get_clean(); |
|
377 | 377 | |
378 | - default: |
|
379 | - throw new \InvalidArgumentException(__METHOD__ . ' ' . $what); |
|
378 | + default: |
|
379 | + throw new \InvalidArgumentException(__METHOD__ . ' ' . $what); |
|
380 | 380 | } |
381 | 381 | } |
382 | 382 | } |