@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | * @param int $min The number of times a surname must occur before it is added to the array |
648 | 648 | * @param Tree $tree |
649 | 649 | * |
650 | - * @return int[] |
|
650 | + * @return string[] |
|
651 | 651 | */ |
652 | 652 | public static function getCommonSurnames($min, Tree $tree) { |
653 | 653 | return self::getTopSurnames($tree->getTreeId(), $min, 0); |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | * @param int $min only fetch surnames occuring this many times |
661 | 661 | * @param int $max only fetch this number of surnames (0=all) |
662 | 662 | * |
663 | - * @return int[] |
|
663 | + * @return string[] |
|
664 | 664 | */ |
665 | 665 | public static function getTopSurnames($ged_id, $min, $max) { |
666 | 666 | // Use n_surn, rather than n_surname, as it is used to generate URLs for |
@@ -249,18 +249,18 @@ discard block |
||
249 | 249 | */ |
250 | 250 | public static function searchIndividualsPhonetic($soundex, $lastname, $firstname, $place, array $trees) { |
251 | 251 | switch ($soundex) { |
252 | - case 'Russell': |
|
253 | - $givn_sdx = Soundex::russell($firstname); |
|
254 | - $surn_sdx = Soundex::russell($lastname); |
|
255 | - $plac_sdx = Soundex::russell($place); |
|
256 | - break; |
|
257 | - case 'DaitchM': |
|
258 | - $givn_sdx = Soundex::daitchMokotoff($firstname); |
|
259 | - $surn_sdx = Soundex::daitchMokotoff($lastname); |
|
260 | - $plac_sdx = Soundex::daitchMokotoff($place); |
|
261 | - break; |
|
262 | - default: |
|
263 | - throw new \DomainException('soundex: ' . $soundex); |
|
252 | + case 'Russell': |
|
253 | + $givn_sdx = Soundex::russell($firstname); |
|
254 | + $surn_sdx = Soundex::russell($lastname); |
|
255 | + $plac_sdx = Soundex::russell($place); |
|
256 | + break; |
|
257 | + case 'DaitchM': |
|
258 | + $givn_sdx = Soundex::daitchMokotoff($firstname); |
|
259 | + $surn_sdx = Soundex::daitchMokotoff($lastname); |
|
260 | + $plac_sdx = Soundex::daitchMokotoff($place); |
|
261 | + break; |
|
262 | + default: |
|
263 | + throw new \DomainException('soundex: ' . $soundex); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | // Nothing to search for? Return nothing. |
@@ -292,12 +292,12 @@ discard block |
||
292 | 292 | foreach ($givn_sdx as $n => $sdx) { |
293 | 293 | $sql .= $n ? " OR " : ""; |
294 | 294 | switch ($soundex) { |
295 | - case 'Russell': |
|
296 | - $sql .= "n_soundex_givn_std LIKE CONCAT('%', :given_name_" . $n . ", '%')"; |
|
297 | - break; |
|
298 | - case 'DaitchM': |
|
299 | - $sql .= "n_soundex_givn_dm LIKE CONCAT('%', :given_name_" . $n . ", '%')"; |
|
300 | - break; |
|
295 | + case 'Russell': |
|
296 | + $sql .= "n_soundex_givn_std LIKE CONCAT('%', :given_name_" . $n . ", '%')"; |
|
297 | + break; |
|
298 | + case 'DaitchM': |
|
299 | + $sql .= "n_soundex_givn_dm LIKE CONCAT('%', :given_name_" . $n . ", '%')"; |
|
300 | + break; |
|
301 | 301 | } |
302 | 302 | $args['given_name_' . $n] = $sdx; |
303 | 303 | } |
@@ -310,12 +310,12 @@ discard block |
||
310 | 310 | foreach ($surn_sdx as $n => $sdx) { |
311 | 311 | $sql .= $n ? " OR " : ""; |
312 | 312 | switch ($soundex) { |
313 | - case 'Russell': |
|
314 | - $sql .= "n_soundex_surn_std LIKE CONCAT('%', :surname_" . $n . ", '%')"; |
|
315 | - break; |
|
316 | - case 'DaitchM': |
|
317 | - $sql .= "n_soundex_surn_dm LIKE CONCAT('%', :surname_" . $n . ", '%')"; |
|
318 | - break; |
|
313 | + case 'Russell': |
|
314 | + $sql .= "n_soundex_surn_std LIKE CONCAT('%', :surname_" . $n . ", '%')"; |
|
315 | + break; |
|
316 | + case 'DaitchM': |
|
317 | + $sql .= "n_soundex_surn_dm LIKE CONCAT('%', :surname_" . $n . ", '%')"; |
|
318 | + break; |
|
319 | 319 | } |
320 | 320 | $args['surname_' . $n] = $sdx; |
321 | 321 | } |
@@ -328,12 +328,12 @@ discard block |
||
328 | 328 | foreach ($plac_sdx as $n => $sdx) { |
329 | 329 | $sql .= $n ? " OR " : ""; |
330 | 330 | switch ($soundex) { |
331 | - case 'Russell': |
|
332 | - $sql .= "p_std_soundex LIKE CONCAT('%', :place_" . $n . ", '%')"; |
|
333 | - break; |
|
334 | - case 'DaitchM': |
|
335 | - $sql .= "p_dm_soundex LIKE CONCAT('%', :place_" . $n . ", '%')"; |
|
336 | - break; |
|
331 | + case 'Russell': |
|
332 | + $sql .= "p_std_soundex LIKE CONCAT('%', :place_" . $n . ", '%')"; |
|
333 | + break; |
|
334 | + case 'DaitchM': |
|
335 | + $sql .= "p_dm_soundex LIKE CONCAT('%', :place_" . $n . ", '%')"; |
|
336 | + break; |
|
337 | 337 | } |
338 | 338 | $args['place_' . $n] = $sdx; |
339 | 339 | } |
@@ -758,82 +758,82 @@ discard block |
||
758 | 758 | } else { |
759 | 759 | // SPECIAL CASES: |
760 | 760 | switch ($anniv->m) { |
761 | - case 2: |
|
762 | - // 29 CSH does not include 30 CSH (but would include an invalid 31 CSH if there were no 30 CSH) |
|
763 | - if ($anniv->d === 1) { |
|
764 | - $where .= " AND d_day <= 1 AND d_mon = 2"; |
|
765 | - } elseif ($anniv->d === 30) { |
|
766 | - $where .= " AND d_day >= 30 AND d_mon = 2"; |
|
767 | - } elseif ($anniv->d === 29 && $anniv->daysInMonth() === 29) { |
|
768 | - $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 2"; |
|
769 | - } else { |
|
770 | - $where .= " AND d_day = :day AND d_mon = 2"; |
|
771 | - $args['day'] = $anniv->d; |
|
772 | - } |
|
773 | - break; |
|
774 | - case 3: |
|
775 | - // 1 KSL includes 30 CSH (if this year didn’t have 30 CSH) |
|
776 | - // 29 KSL does not include 30 KSL (but would include an invalid 31 KSL if there were no 30 KSL) |
|
777 | - if ($anniv->d === 1) { |
|
778 | - $tmp = new JewishDate(array($anniv->y, 'CSH', 1)); |
|
779 | - if ($tmp->daysInMonth() === 29) { |
|
780 | - $where .= " AND (d_day <= 1 AND d_mon = 3 OR d_day = 30 AND d_mon = 2)"; |
|
761 | + case 2: |
|
762 | + // 29 CSH does not include 30 CSH (but would include an invalid 31 CSH if there were no 30 CSH) |
|
763 | + if ($anniv->d === 1) { |
|
764 | + $where .= " AND d_day <= 1 AND d_mon = 2"; |
|
765 | + } elseif ($anniv->d === 30) { |
|
766 | + $where .= " AND d_day >= 30 AND d_mon = 2"; |
|
767 | + } elseif ($anniv->d === 29 && $anniv->daysInMonth() === 29) { |
|
768 | + $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 2"; |
|
781 | 769 | } else { |
782 | - $where .= " AND d_day <= 1 AND d_mon = 3"; |
|
770 | + $where .= " AND d_day = :day AND d_mon = 2"; |
|
771 | + $args['day'] = $anniv->d; |
|
783 | 772 | } |
784 | - } elseif ($anniv->d === 30) { |
|
785 | - $where .= " AND d_day >= 30 AND d_mon = 3"; |
|
786 | - } elseif ($anniv->d == 29 && $anniv->daysInMonth() === 29) { |
|
787 | - $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 3"; |
|
788 | - } else { |
|
789 | - $where .= " AND d_day = :day AND d_mon = 3"; |
|
790 | - $args['day'] = $anniv->d; |
|
791 | - } |
|
792 | - break; |
|
793 | - case 4: |
|
794 | - // 1 TVT includes 30 KSL (if this year didn’t have 30 KSL) |
|
795 | - if ($anniv->d === 1) { |
|
796 | - $tmp = new JewishDate(array($anniv->y, 'KSL', 1)); |
|
797 | - if ($tmp->daysInMonth() === 29) { |
|
798 | - $where .= " AND (d_day <=1 AND d_mon = 4 OR d_day = 30 AND d_mon = 3)"; |
|
773 | + break; |
|
774 | + case 3: |
|
775 | + // 1 KSL includes 30 CSH (if this year didn’t have 30 CSH) |
|
776 | + // 29 KSL does not include 30 KSL (but would include an invalid 31 KSL if there were no 30 KSL) |
|
777 | + if ($anniv->d === 1) { |
|
778 | + $tmp = new JewishDate(array($anniv->y, 'CSH', 1)); |
|
779 | + if ($tmp->daysInMonth() === 29) { |
|
780 | + $where .= " AND (d_day <= 1 AND d_mon = 3 OR d_day = 30 AND d_mon = 2)"; |
|
781 | + } else { |
|
782 | + $where .= " AND d_day <= 1 AND d_mon = 3"; |
|
783 | + } |
|
784 | + } elseif ($anniv->d === 30) { |
|
785 | + $where .= " AND d_day >= 30 AND d_mon = 3"; |
|
786 | + } elseif ($anniv->d == 29 && $anniv->daysInMonth() === 29) { |
|
787 | + $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 3"; |
|
799 | 788 | } else { |
800 | - $where .= " AND d_day <= 1 AND d_mon = 4"; |
|
789 | + $where .= " AND d_day = :day AND d_mon = 3"; |
|
790 | + $args['day'] = $anniv->d; |
|
801 | 791 | } |
802 | - } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
803 | - $where .= " AND d_day >= :day AND d_mon=4"; |
|
804 | - $args['day'] = $anniv->d; |
|
805 | - } else { |
|
806 | - $where .= " AND d_day = :day AND d_mon=4"; |
|
807 | - $args['day'] = $anniv->d; |
|
808 | - } |
|
809 | - break; |
|
810 | - case 7: // ADS includes ADR (non-leap) |
|
811 | - if ($anniv->d === 1) { |
|
812 | - $where .= " AND d_day <= 1"; |
|
813 | - } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
814 | - $where .= " AND d_day >= :day"; |
|
815 | - $args['day'] = $anniv->d; |
|
816 | - } else { |
|
817 | - $where .= " AND d_day = :day"; |
|
818 | - $args['day'] = $anniv->d; |
|
819 | - } |
|
820 | - $where .= " AND (d_mon = 6 AND MOD(7 * d_year + 1, 19) >= 7 OR d_mon = 7)"; |
|
821 | - break; |
|
822 | - case 8: // 1 NSN includes 30 ADR, if this year is non-leap |
|
823 | - if ($anniv->d === 1) { |
|
824 | - if ($anniv->isLeapYear()) { |
|
825 | - $where .= " AND d_day <= 1 AND d_mon = 8"; |
|
792 | + break; |
|
793 | + case 4: |
|
794 | + // 1 TVT includes 30 KSL (if this year didn’t have 30 KSL) |
|
795 | + if ($anniv->d === 1) { |
|
796 | + $tmp = new JewishDate(array($anniv->y, 'KSL', 1)); |
|
797 | + if ($tmp->daysInMonth() === 29) { |
|
798 | + $where .= " AND (d_day <=1 AND d_mon = 4 OR d_day = 30 AND d_mon = 3)"; |
|
799 | + } else { |
|
800 | + $where .= " AND d_day <= 1 AND d_mon = 4"; |
|
801 | + } |
|
802 | + } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
803 | + $where .= " AND d_day >= :day AND d_mon=4"; |
|
804 | + $args['day'] = $anniv->d; |
|
826 | 805 | } else { |
827 | - $where .= " AND (d_day <= 1 AND d_mon = 8 OR d_day = 30 AND d_mon = 6)"; |
|
806 | + $where .= " AND d_day = :day AND d_mon=4"; |
|
807 | + $args['day'] = $anniv->d; |
|
828 | 808 | } |
829 | - } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
830 | - $where .= " AND d_day >= :day AND d_mon = 8"; |
|
831 | - $args['day'] = $anniv->d; |
|
832 | - } else { |
|
833 | - $where .= " AND d_day = :day AND d_mon = 8"; |
|
834 | - $args['day'] = $anniv->d; |
|
835 | - } |
|
836 | - break; |
|
809 | + break; |
|
810 | + case 7: // ADS includes ADR (non-leap) |
|
811 | + if ($anniv->d === 1) { |
|
812 | + $where .= " AND d_day <= 1"; |
|
813 | + } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
814 | + $where .= " AND d_day >= :day"; |
|
815 | + $args['day'] = $anniv->d; |
|
816 | + } else { |
|
817 | + $where .= " AND d_day = :day"; |
|
818 | + $args['day'] = $anniv->d; |
|
819 | + } |
|
820 | + $where .= " AND (d_mon = 6 AND MOD(7 * d_year + 1, 19) >= 7 OR d_mon = 7)"; |
|
821 | + break; |
|
822 | + case 8: // 1 NSN includes 30 ADR, if this year is non-leap |
|
823 | + if ($anniv->d === 1) { |
|
824 | + if ($anniv->isLeapYear()) { |
|
825 | + $where .= " AND d_day <= 1 AND d_mon = 8"; |
|
826 | + } else { |
|
827 | + $where .= " AND (d_day <= 1 AND d_mon = 8 OR d_day = 30 AND d_mon = 6)"; |
|
828 | + } |
|
829 | + } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
830 | + $where .= " AND d_day >= :day AND d_mon = 8"; |
|
831 | + $args['day'] = $anniv->d; |
|
832 | + } else { |
|
833 | + $where .= " AND d_day = :day AND d_mon = 8"; |
|
834 | + $args['day'] = $anniv->d; |
|
835 | + } |
|
836 | + break; |
|
837 | 837 | } |
838 | 838 | } |
839 | 839 | // Only events in the past (includes dates without a year) |
@@ -2743,7 +2743,7 @@ |
||
2743 | 2743 | $tags = explode(':', $tag); |
2744 | 2744 | $origlevel = $level; |
2745 | 2745 | if ($level == 0) { |
2746 | - $level = $gedrec{0} + 1; |
|
2746 | + $level = $gedrec{0} +1; |
|
2747 | 2747 | } |
2748 | 2748 | |
2749 | 2749 | $subrec = $gedrec; |
@@ -934,14 +934,14 @@ discard block |
||
934 | 934 | $tags = preg_split('/[: ]/', $tag); |
935 | 935 | $value = $this->getGedcomValue($tag, $level, $this->gedrec); |
936 | 936 | switch (end($tags)) { |
937 | - case 'DATE': |
|
938 | - $tmp = new Date($value); |
|
939 | - $value = $tmp->display(); |
|
940 | - break; |
|
941 | - case 'PLAC': |
|
942 | - $tmp = new Place($value, $WT_TREE); |
|
943 | - $value = $tmp->getShortName(); |
|
944 | - break; |
|
937 | + case 'DATE': |
|
938 | + $tmp = new Date($value); |
|
939 | + $value = $tmp->display(); |
|
940 | + break; |
|
941 | + case 'PLAC': |
|
942 | + $tmp = new Place($value, $WT_TREE); |
|
943 | + $value = $tmp->getShortName(); |
|
944 | + break; |
|
945 | 945 | } |
946 | 946 | if ($useBreak == "1") { |
947 | 947 | // Insert <br> when multiple dates exist. |
@@ -1335,22 +1335,22 @@ discard block |
||
1335 | 1335 | // Arithmetic functions |
1336 | 1336 | if (preg_match("/(\d+)\s*([\-\+\*\/])\s*(\d+)/", $value, $match)) { |
1337 | 1337 | switch ($match[2]) { |
1338 | - case "+": |
|
1339 | - $t = $match[1] + $match[3]; |
|
1340 | - $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value); |
|
1341 | - break; |
|
1342 | - case "-": |
|
1343 | - $t = $match[1] - $match[3]; |
|
1344 | - $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value); |
|
1345 | - break; |
|
1346 | - case "*": |
|
1347 | - $t = $match[1] * $match[3]; |
|
1348 | - $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value); |
|
1349 | - break; |
|
1350 | - case "/": |
|
1351 | - $t = $match[1] / $match[3]; |
|
1352 | - $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value); |
|
1353 | - break; |
|
1338 | + case "+": |
|
1339 | + $t = $match[1] + $match[3]; |
|
1340 | + $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value); |
|
1341 | + break; |
|
1342 | + case "-": |
|
1343 | + $t = $match[1] - $match[3]; |
|
1344 | + $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value); |
|
1345 | + break; |
|
1346 | + case "*": |
|
1347 | + $t = $match[1] * $match[3]; |
|
1348 | + $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value); |
|
1349 | + break; |
|
1350 | + case "/": |
|
1351 | + $t = $match[1] / $match[3]; |
|
1352 | + $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value); |
|
1353 | + break; |
|
1354 | 1354 | } |
1355 | 1355 | } |
1356 | 1356 | if (strpos($value, "@") !== false) { |
@@ -1859,180 +1859,180 @@ discard block |
||
1859 | 1859 | } |
1860 | 1860 | // Some filters/sorts can be applied using SQL, while others require PHP |
1861 | 1861 | switch ($listname) { |
1862 | - case "pending": |
|
1863 | - $rows = Database::prepare( |
|
1864 | - "SELECT xref, CASE new_gedcom WHEN '' THEN old_gedcom ELSE new_gedcom END AS gedcom" . |
|
1865 | - " FROM `##change`" . " WHERE (xref, change_id) IN (" . |
|
1866 | - " SELECT xref, MAX(change_id)" . |
|
1867 | - " FROM `##change`" . |
|
1868 | - " WHERE status = 'pending' AND gedcom_id = :tree_id" . |
|
1869 | - " GROUP BY xref" . |
|
1870 | - " )" |
|
1871 | - )->execute(array( |
|
1872 | - 'tree_id' => $WT_TREE->getTreeId(), |
|
1873 | - ))->fetchAll(); |
|
1874 | - $this->list = array(); |
|
1875 | - foreach ($rows as $row) { |
|
1876 | - $this->list[] = GedcomRecord::getInstance($row->xref, $WT_TREE, $row->gedcom); |
|
1877 | - } |
|
1878 | - break; |
|
1879 | - case 'individual': |
|
1880 | - $sql_select = "SELECT i_id AS xref, i_gedcom AS gedcom FROM `##individuals` "; |
|
1881 | - $sql_join = ""; |
|
1882 | - $sql_where = " WHERE i_file = :tree_id"; |
|
1883 | - $sql_order_by = ""; |
|
1884 | - $sql_params = array('tree_id' => $WT_TREE->getTreeId()); |
|
1885 | - foreach ($attrs as $attr => $value) { |
|
1886 | - if (strpos($attr, 'filter') === 0 && $value) { |
|
1887 | - $value = $this->substituteVars($value, false); |
|
1888 | - // Convert the various filters into SQL |
|
1889 | - if (preg_match('/^(\w+):DATE (LTE|GTE) (.+)$/', $value, $match)) { |
|
1890 | - $sql_join .= " JOIN `##dates` AS {$attr} ON ({$attr}.d_file=i_file AND {$attr}.d_gid=i_id)"; |
|
1891 | - $sql_where .= " AND {$attr}.d_fact = :{$attr}fact"; |
|
1892 | - $sql_params[$attr . 'fact'] = $match[1]; |
|
1893 | - $date = new Date($match[3]); |
|
1894 | - if ($match[2] == "LTE") { |
|
1895 | - $sql_where .= " AND {$attr}.d_julianday2 <= :{$attr}date"; |
|
1896 | - $sql_params[$attr . 'date'] = $date->maximumJulianDay(); |
|
1897 | - } else { |
|
1898 | - $sql_where .= " AND {$attr}.d_julianday1 >= :{$attr}date"; |
|
1899 | - $sql_params[$attr . 'date'] = $date->minimumJulianDay(); |
|
1900 | - } |
|
1901 | - if ($sortby == $match[1]) { |
|
1902 | - $sortby = ""; |
|
1903 | - $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.d_julianday1"; |
|
1904 | - } |
|
1905 | - unset($attrs[$attr]); // This filter has been fully processed |
|
1906 | - } elseif (preg_match('/^NAME CONTAINS (.*)$/', $value, $match)) { |
|
1907 | - // Do nothing, unless you have to |
|
1908 | - if ($match[1] != '' || $sortby == 'NAME') { |
|
1909 | - $sql_join .= " JOIN `##name` AS {$attr} ON (n_file=i_file AND n_id=i_id)"; |
|
1910 | - // Search the DB only if there is any name supplied |
|
1911 | - if ($match[1] != "") { |
|
1912 | - $names = explode(" ", $match[1]); |
|
1913 | - foreach ($names as $n => $name) { |
|
1914 | - $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1915 | - $sql_params[$attr . 'name' . $n] = $name; |
|
1916 | - } |
|
1862 | + case "pending": |
|
1863 | + $rows = Database::prepare( |
|
1864 | + "SELECT xref, CASE new_gedcom WHEN '' THEN old_gedcom ELSE new_gedcom END AS gedcom" . |
|
1865 | + " FROM `##change`" . " WHERE (xref, change_id) IN (" . |
|
1866 | + " SELECT xref, MAX(change_id)" . |
|
1867 | + " FROM `##change`" . |
|
1868 | + " WHERE status = 'pending' AND gedcom_id = :tree_id" . |
|
1869 | + " GROUP BY xref" . |
|
1870 | + " )" |
|
1871 | + )->execute(array( |
|
1872 | + 'tree_id' => $WT_TREE->getTreeId(), |
|
1873 | + ))->fetchAll(); |
|
1874 | + $this->list = array(); |
|
1875 | + foreach ($rows as $row) { |
|
1876 | + $this->list[] = GedcomRecord::getInstance($row->xref, $WT_TREE, $row->gedcom); |
|
1877 | + } |
|
1878 | + break; |
|
1879 | + case 'individual': |
|
1880 | + $sql_select = "SELECT i_id AS xref, i_gedcom AS gedcom FROM `##individuals` "; |
|
1881 | + $sql_join = ""; |
|
1882 | + $sql_where = " WHERE i_file = :tree_id"; |
|
1883 | + $sql_order_by = ""; |
|
1884 | + $sql_params = array('tree_id' => $WT_TREE->getTreeId()); |
|
1885 | + foreach ($attrs as $attr => $value) { |
|
1886 | + if (strpos($attr, 'filter') === 0 && $value) { |
|
1887 | + $value = $this->substituteVars($value, false); |
|
1888 | + // Convert the various filters into SQL |
|
1889 | + if (preg_match('/^(\w+):DATE (LTE|GTE) (.+)$/', $value, $match)) { |
|
1890 | + $sql_join .= " JOIN `##dates` AS {$attr} ON ({$attr}.d_file=i_file AND {$attr}.d_gid=i_id)"; |
|
1891 | + $sql_where .= " AND {$attr}.d_fact = :{$attr}fact"; |
|
1892 | + $sql_params[$attr . 'fact'] = $match[1]; |
|
1893 | + $date = new Date($match[3]); |
|
1894 | + if ($match[2] == "LTE") { |
|
1895 | + $sql_where .= " AND {$attr}.d_julianday2 <= :{$attr}date"; |
|
1896 | + $sql_params[$attr . 'date'] = $date->maximumJulianDay(); |
|
1897 | + } else { |
|
1898 | + $sql_where .= " AND {$attr}.d_julianday1 >= :{$attr}date"; |
|
1899 | + $sql_params[$attr . 'date'] = $date->minimumJulianDay(); |
|
1917 | 1900 | } |
1918 | - // Let the DB do the name sorting even when no name was entered |
|
1919 | - if ($sortby == "NAME") { |
|
1901 | + if ($sortby == $match[1]) { |
|
1920 | 1902 | $sortby = ""; |
1921 | - $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.n_sort"; |
|
1903 | + $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.d_julianday1"; |
|
1922 | 1904 | } |
1905 | + unset($attrs[$attr]); // This filter has been fully processed |
|
1906 | + } elseif (preg_match('/^NAME CONTAINS (.*)$/', $value, $match)) { |
|
1907 | + // Do nothing, unless you have to |
|
1908 | + if ($match[1] != '' || $sortby == 'NAME') { |
|
1909 | + $sql_join .= " JOIN `##name` AS {$attr} ON (n_file=i_file AND n_id=i_id)"; |
|
1910 | + // Search the DB only if there is any name supplied |
|
1911 | + if ($match[1] != "") { |
|
1912 | + $names = explode(" ", $match[1]); |
|
1913 | + foreach ($names as $n => $name) { |
|
1914 | + $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1915 | + $sql_params[$attr . 'name' . $n] = $name; |
|
1916 | + } |
|
1917 | + } |
|
1918 | + // Let the DB do the name sorting even when no name was entered |
|
1919 | + if ($sortby == "NAME") { |
|
1920 | + $sortby = ""; |
|
1921 | + $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.n_sort"; |
|
1922 | + } |
|
1923 | + } |
|
1924 | + unset($attrs[$attr]); // This filter has been fully processed |
|
1925 | + } elseif (preg_match('/^REGEXP \/(.+)\//', $value, $match)) { |
|
1926 | + $sql_where .= " AND i_gedcom REGEXP :{$attr}gedcom"; |
|
1927 | + // PDO helpfully escapes backslashes for us, preventing us from matching "\n1 FACT" |
|
1928 | + $sql_params[$attr . 'gedcom'] = str_replace('\n', "\n", $match[1]); |
|
1929 | + unset($attrs[$attr]); // This filter has been fully processed |
|
1930 | + } elseif (preg_match('/^(?:\w+):PLAC CONTAINS (.+)$/', $value, $match)) { |
|
1931 | + $sql_join .= " JOIN `##places` AS {$attr}a ON ({$attr}a.p_file = i_file)"; |
|
1932 | + $sql_join .= " JOIN `##placelinks` AS {$attr}b ON ({$attr}a.p_file = {$attr}b.pl_file AND {$attr}b.pl_p_id = {$attr}a.p_id AND {$attr}b.pl_gid = i_id)"; |
|
1933 | + $sql_where .= " AND {$attr}a.p_place LIKE CONCAT('%', :{$attr}place, '%')"; |
|
1934 | + $sql_params[$attr . 'place'] = $match[1]; |
|
1935 | + // Don't unset this filter. This is just initial filtering |
|
1936 | + } elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) { |
|
1937 | + $sql_where .= " AND i_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
1938 | + $sql_params[$attr . 'contains1'] = $match[1]; |
|
1939 | + $sql_params[$attr . 'contains2'] = $match[2]; |
|
1940 | + $sql_params[$attr . 'contains3'] = $match[3]; |
|
1941 | + // Don't unset this filter. This is just initial filtering |
|
1923 | 1942 | } |
1924 | - unset($attrs[$attr]); // This filter has been fully processed |
|
1925 | - } elseif (preg_match('/^REGEXP \/(.+)\//', $value, $match)) { |
|
1926 | - $sql_where .= " AND i_gedcom REGEXP :{$attr}gedcom"; |
|
1927 | - // PDO helpfully escapes backslashes for us, preventing us from matching "\n1 FACT" |
|
1928 | - $sql_params[$attr . 'gedcom'] = str_replace('\n', "\n", $match[1]); |
|
1929 | - unset($attrs[$attr]); // This filter has been fully processed |
|
1930 | - } elseif (preg_match('/^(?:\w+):PLAC CONTAINS (.+)$/', $value, $match)) { |
|
1931 | - $sql_join .= " JOIN `##places` AS {$attr}a ON ({$attr}a.p_file = i_file)"; |
|
1932 | - $sql_join .= " JOIN `##placelinks` AS {$attr}b ON ({$attr}a.p_file = {$attr}b.pl_file AND {$attr}b.pl_p_id = {$attr}a.p_id AND {$attr}b.pl_gid = i_id)"; |
|
1933 | - $sql_where .= " AND {$attr}a.p_place LIKE CONCAT('%', :{$attr}place, '%')"; |
|
1934 | - $sql_params[$attr . 'place'] = $match[1]; |
|
1935 | - // Don't unset this filter. This is just initial filtering |
|
1936 | - } elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) { |
|
1937 | - $sql_where .= " AND i_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
1938 | - $sql_params[$attr . 'contains1'] = $match[1]; |
|
1939 | - $sql_params[$attr . 'contains2'] = $match[2]; |
|
1940 | - $sql_params[$attr . 'contains3'] = $match[3]; |
|
1941 | - // Don't unset this filter. This is just initial filtering |
|
1942 | 1943 | } |
1943 | 1944 | } |
1944 | - } |
|
1945 | 1945 | |
1946 | - $this->list = array(); |
|
1947 | - $rows = Database::prepare( |
|
1948 | - $sql_select . $sql_join . $sql_where . $sql_order_by |
|
1949 | - )->execute($sql_params)->fetchAll(); |
|
1950 | - |
|
1951 | - foreach ($rows as $row) { |
|
1952 | - $this->list[$row->xref] = Individual::getInstance($row->xref, $WT_TREE, $row->gedcom); |
|
1953 | - } |
|
1954 | - break; |
|
1955 | - |
|
1956 | - case 'family': |
|
1957 | - $sql_select = "SELECT f_id AS xref, f_gedcom AS gedcom FROM `##families`"; |
|
1958 | - $sql_join = ""; |
|
1959 | - $sql_where = " WHERE f_file = :tree_id"; |
|
1960 | - $sql_order_by = ""; |
|
1961 | - $sql_params = array('tree_id' => $WT_TREE->getTreeId()); |
|
1962 | - foreach ($attrs as $attr => $value) { |
|
1963 | - if (strpos($attr, 'filter') === 0 && $value) { |
|
1964 | - $value = $this->substituteVars($value, false); |
|
1965 | - // Convert the various filters into SQL |
|
1966 | - if (preg_match('/^(\w+):DATE (LTE|GTE) (.+)$/', $value, $match)) { |
|
1967 | - $sql_join .= " JOIN `##dates` AS {$attr} ON ({$attr}.d_file=f_file AND {$attr}.d_gid=f_id)"; |
|
1968 | - $sql_where .= " AND {$attr}.d_fact = :{$attr}fact"; |
|
1969 | - $sql_params[$attr . 'fact'] = $match[1]; |
|
1970 | - $date = new Date($match[3]); |
|
1971 | - if ($match[2] == "LTE") { |
|
1972 | - $sql_where .= " AND {$attr}.d_julianday2 <= :{$attr}date"; |
|
1973 | - $sql_params[$attr . 'date'] = $date->maximumJulianDay(); |
|
1974 | - } else { |
|
1975 | - $sql_where .= " AND {$attr}.d_julianday1 >= :{$attr}date"; |
|
1976 | - $sql_params[$attr . 'date'] = $date->minimumJulianDay(); |
|
1977 | - } |
|
1978 | - if ($sortby == $match[1]) { |
|
1979 | - $sortby = ""; |
|
1980 | - $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.d_julianday1"; |
|
1981 | - } |
|
1982 | - unset($attrs[$attr]); // This filter has been fully processed |
|
1983 | - } elseif (preg_match('/^REGEXP \/(.+)\//', $value, $match)) { |
|
1984 | - $sql_where .= " AND f_gedcom REGEXP :{$attr}gedcom"; |
|
1985 | - // PDO helpfully escapes backslashes for us, preventing us from matching "\n1 FACT" |
|
1986 | - $sql_params[$attr . 'gedcom'] = str_replace('\n', "\n", $match[1]); |
|
1987 | - unset($attrs[$attr]); // This filter has been fully processed |
|
1988 | - } elseif (preg_match('/^NAME CONTAINS (.+)$/', $value, $match)) { |
|
1989 | - // Do nothing, unless you have to |
|
1990 | - if ($match[1] != '' || $sortby == 'NAME') { |
|
1991 | - $sql_join .= " JOIN `##name` AS {$attr} ON n_file = f_file AND n_id IN (f_husb, f_wife)"; |
|
1992 | - // Search the DB only if there is any name supplied |
|
1993 | - if ($match[1] != "") { |
|
1994 | - $names = explode(" ", $match[1]); |
|
1995 | - foreach ($names as $n => $name) { |
|
1996 | - $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1997 | - $sql_params[$attr . 'name' . $n] = $name; |
|
1998 | - } |
|
1946 | + $this->list = array(); |
|
1947 | + $rows = Database::prepare( |
|
1948 | + $sql_select . $sql_join . $sql_where . $sql_order_by |
|
1949 | + )->execute($sql_params)->fetchAll(); |
|
1950 | + |
|
1951 | + foreach ($rows as $row) { |
|
1952 | + $this->list[$row->xref] = Individual::getInstance($row->xref, $WT_TREE, $row->gedcom); |
|
1953 | + } |
|
1954 | + break; |
|
1955 | + |
|
1956 | + case 'family': |
|
1957 | + $sql_select = "SELECT f_id AS xref, f_gedcom AS gedcom FROM `##families`"; |
|
1958 | + $sql_join = ""; |
|
1959 | + $sql_where = " WHERE f_file = :tree_id"; |
|
1960 | + $sql_order_by = ""; |
|
1961 | + $sql_params = array('tree_id' => $WT_TREE->getTreeId()); |
|
1962 | + foreach ($attrs as $attr => $value) { |
|
1963 | + if (strpos($attr, 'filter') === 0 && $value) { |
|
1964 | + $value = $this->substituteVars($value, false); |
|
1965 | + // Convert the various filters into SQL |
|
1966 | + if (preg_match('/^(\w+):DATE (LTE|GTE) (.+)$/', $value, $match)) { |
|
1967 | + $sql_join .= " JOIN `##dates` AS {$attr} ON ({$attr}.d_file=f_file AND {$attr}.d_gid=f_id)"; |
|
1968 | + $sql_where .= " AND {$attr}.d_fact = :{$attr}fact"; |
|
1969 | + $sql_params[$attr . 'fact'] = $match[1]; |
|
1970 | + $date = new Date($match[3]); |
|
1971 | + if ($match[2] == "LTE") { |
|
1972 | + $sql_where .= " AND {$attr}.d_julianday2 <= :{$attr}date"; |
|
1973 | + $sql_params[$attr . 'date'] = $date->maximumJulianDay(); |
|
1974 | + } else { |
|
1975 | + $sql_where .= " AND {$attr}.d_julianday1 >= :{$attr}date"; |
|
1976 | + $sql_params[$attr . 'date'] = $date->minimumJulianDay(); |
|
1999 | 1977 | } |
2000 | - // Let the DB do the name sorting even when no name was entered |
|
2001 | - if ($sortby == "NAME") { |
|
1978 | + if ($sortby == $match[1]) { |
|
2002 | 1979 | $sortby = ""; |
2003 | - $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.n_sort"; |
|
1980 | + $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.d_julianday1"; |
|
1981 | + } |
|
1982 | + unset($attrs[$attr]); // This filter has been fully processed |
|
1983 | + } elseif (preg_match('/^REGEXP \/(.+)\//', $value, $match)) { |
|
1984 | + $sql_where .= " AND f_gedcom REGEXP :{$attr}gedcom"; |
|
1985 | + // PDO helpfully escapes backslashes for us, preventing us from matching "\n1 FACT" |
|
1986 | + $sql_params[$attr . 'gedcom'] = str_replace('\n', "\n", $match[1]); |
|
1987 | + unset($attrs[$attr]); // This filter has been fully processed |
|
1988 | + } elseif (preg_match('/^NAME CONTAINS (.+)$/', $value, $match)) { |
|
1989 | + // Do nothing, unless you have to |
|
1990 | + if ($match[1] != '' || $sortby == 'NAME') { |
|
1991 | + $sql_join .= " JOIN `##name` AS {$attr} ON n_file = f_file AND n_id IN (f_husb, f_wife)"; |
|
1992 | + // Search the DB only if there is any name supplied |
|
1993 | + if ($match[1] != "") { |
|
1994 | + $names = explode(" ", $match[1]); |
|
1995 | + foreach ($names as $n => $name) { |
|
1996 | + $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1997 | + $sql_params[$attr . 'name' . $n] = $name; |
|
1998 | + } |
|
1999 | + } |
|
2000 | + // Let the DB do the name sorting even when no name was entered |
|
2001 | + if ($sortby == "NAME") { |
|
2002 | + $sortby = ""; |
|
2003 | + $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.n_sort"; |
|
2004 | + } |
|
2004 | 2005 | } |
2006 | + unset($attrs[$attr]); // This filter has been fully processed |
|
2007 | + |
|
2008 | + } elseif (preg_match('/^(?:\w+):PLAC CONTAINS (.+)$/', $value, $match)) { |
|
2009 | + $sql_join .= " JOIN `##places` AS {$attr}a ON ({$attr}a.p_file=f_file)"; |
|
2010 | + $sql_join .= " JOIN `##placelinks` AS {$attr}b ON ({$attr}a.p_file={$attr}b.pl_file AND {$attr}b.pl_p_id={$attr}a.p_id AND {$attr}b.pl_gid=f_id)"; |
|
2011 | + $sql_where .= " AND {$attr}a.p_place LIKE CONCAT('%', :{$attr}place, '%')"; |
|
2012 | + $sql_params[$attr . 'place'] = $match[1]; |
|
2013 | + // Don't unset this filter. This is just initial filtering |
|
2014 | + } elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) { |
|
2015 | + $sql_where .= " AND f_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
2016 | + $sql_params[$attr . 'contains1'] = $match[1]; |
|
2017 | + $sql_params[$attr . 'contains2'] = $match[2]; |
|
2018 | + $sql_params[$attr . 'contains3'] = $match[3]; |
|
2019 | + // Don't unset this filter. This is just initial filtering |
|
2005 | 2020 | } |
2006 | - unset($attrs[$attr]); // This filter has been fully processed |
|
2007 | - |
|
2008 | - } elseif (preg_match('/^(?:\w+):PLAC CONTAINS (.+)$/', $value, $match)) { |
|
2009 | - $sql_join .= " JOIN `##places` AS {$attr}a ON ({$attr}a.p_file=f_file)"; |
|
2010 | - $sql_join .= " JOIN `##placelinks` AS {$attr}b ON ({$attr}a.p_file={$attr}b.pl_file AND {$attr}b.pl_p_id={$attr}a.p_id AND {$attr}b.pl_gid=f_id)"; |
|
2011 | - $sql_where .= " AND {$attr}a.p_place LIKE CONCAT('%', :{$attr}place, '%')"; |
|
2012 | - $sql_params[$attr . 'place'] = $match[1]; |
|
2013 | - // Don't unset this filter. This is just initial filtering |
|
2014 | - } elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) { |
|
2015 | - $sql_where .= " AND f_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
2016 | - $sql_params[$attr . 'contains1'] = $match[1]; |
|
2017 | - $sql_params[$attr . 'contains2'] = $match[2]; |
|
2018 | - $sql_params[$attr . 'contains3'] = $match[3]; |
|
2019 | - // Don't unset this filter. This is just initial filtering |
|
2020 | 2021 | } |
2021 | 2022 | } |
2022 | - } |
|
2023 | 2023 | |
2024 | - $this->list = array(); |
|
2025 | - $rows = Database::prepare( |
|
2026 | - $sql_select . $sql_join . $sql_where . $sql_order_by |
|
2027 | - )->execute($sql_params)->fetchAll(); |
|
2024 | + $this->list = array(); |
|
2025 | + $rows = Database::prepare( |
|
2026 | + $sql_select . $sql_join . $sql_where . $sql_order_by |
|
2027 | + )->execute($sql_params)->fetchAll(); |
|
2028 | 2028 | |
2029 | - foreach ($rows as $row) { |
|
2030 | - $this->list[$row->xref] = Family::getInstance($row->xref, $WT_TREE, $row->gedcom); |
|
2031 | - } |
|
2032 | - break; |
|
2029 | + foreach ($rows as $row) { |
|
2030 | + $this->list[$row->xref] = Family::getInstance($row->xref, $WT_TREE, $row->gedcom); |
|
2031 | + } |
|
2032 | + break; |
|
2033 | 2033 | |
2034 | - default: |
|
2035 | - throw new \DomainException('Invalid list name: ' . $listname); |
|
2034 | + default: |
|
2035 | + throw new \DomainException('Invalid list name: ' . $listname); |
|
2036 | 2036 | } |
2037 | 2037 | |
2038 | 2038 | $filters = array(); |
@@ -2093,17 +2093,17 @@ discard block |
||
2093 | 2093 | $searchstr = "1 " . $tag; |
2094 | 2094 | } |
2095 | 2095 | switch ($expr) { |
2096 | - case "CONTAINS": |
|
2097 | - if ($t == "PLAC") { |
|
2098 | - $searchstr .= "[^\n]*[, ]*" . $val; |
|
2099 | - } else { |
|
2100 | - $searchstr .= "[^\n]*" . $val; |
|
2101 | - } |
|
2102 | - $filters[] = $searchstr; |
|
2103 | - break; |
|
2104 | - default: |
|
2105 | - $filters2[] = array("tag" => $tag, "expr" => $expr, "val" => $val); |
|
2106 | - break; |
|
2096 | + case "CONTAINS": |
|
2097 | + if ($t == "PLAC") { |
|
2098 | + $searchstr .= "[^\n]*[, ]*" . $val; |
|
2099 | + } else { |
|
2100 | + $searchstr .= "[^\n]*" . $val; |
|
2101 | + } |
|
2102 | + $filters[] = $searchstr; |
|
2103 | + break; |
|
2104 | + default: |
|
2105 | + $filters2[] = array("tag" => $tag, "expr" => $expr, "val" => $val); |
|
2106 | + break; |
|
2107 | 2107 | } |
2108 | 2108 | } |
2109 | 2109 | } |
@@ -2147,31 +2147,31 @@ discard block |
||
2147 | 2147 | } |
2148 | 2148 | |
2149 | 2149 | switch ($expr) { |
2150 | - case "GTE": |
|
2151 | - if ($t == "DATE") { |
|
2152 | - $date1 = new Date($v); |
|
2153 | - $date2 = new Date($val); |
|
2154 | - $keep = (Date::compare($date1, $date2) >= 0); |
|
2155 | - } elseif ($val >= $v) { |
|
2156 | - $keep = true; |
|
2157 | - } |
|
2158 | - break; |
|
2159 | - case "LTE": |
|
2160 | - if ($t == "DATE") { |
|
2161 | - $date1 = new Date($v); |
|
2162 | - $date2 = new Date($val); |
|
2163 | - $keep = (Date::compare($date1, $date2) <= 0); |
|
2164 | - } elseif ($val >= $v) { |
|
2165 | - $keep = true; |
|
2166 | - } |
|
2167 | - break; |
|
2168 | - default: |
|
2169 | - if ($v == $val) { |
|
2170 | - $keep = true; |
|
2171 | - } else { |
|
2172 | - $keep = false; |
|
2173 | - } |
|
2174 | - break; |
|
2150 | + case "GTE": |
|
2151 | + if ($t == "DATE") { |
|
2152 | + $date1 = new Date($v); |
|
2153 | + $date2 = new Date($val); |
|
2154 | + $keep = (Date::compare($date1, $date2) >= 0); |
|
2155 | + } elseif ($val >= $v) { |
|
2156 | + $keep = true; |
|
2157 | + } |
|
2158 | + break; |
|
2159 | + case "LTE": |
|
2160 | + if ($t == "DATE") { |
|
2161 | + $date1 = new Date($v); |
|
2162 | + $date2 = new Date($val); |
|
2163 | + $keep = (Date::compare($date1, $date2) <= 0); |
|
2164 | + } elseif ($val >= $v) { |
|
2165 | + $keep = true; |
|
2166 | + } |
|
2167 | + break; |
|
2168 | + default: |
|
2169 | + if ($v == $val) { |
|
2170 | + $keep = true; |
|
2171 | + } else { |
|
2172 | + $keep = false; |
|
2173 | + } |
|
2174 | + break; |
|
2175 | 2175 | } |
2176 | 2176 | } |
2177 | 2177 | } |
@@ -2183,26 +2183,26 @@ discard block |
||
2183 | 2183 | } |
2184 | 2184 | |
2185 | 2185 | switch ($sortby) { |
2186 | - case 'NAME': |
|
2187 | - uasort($this->list, '\Fisharebest\Webtrees\GedcomRecord::compare'); |
|
2188 | - break; |
|
2189 | - case 'CHAN': |
|
2190 | - uasort($this->list, function (GedcomRecord $x, GedcomRecord $y) { |
|
2191 | - return $y->lastChangeTimestamp(true) - $x->lastChangeTimestamp(true); |
|
2192 | - }); |
|
2193 | - break; |
|
2194 | - case 'BIRT:DATE': |
|
2195 | - uasort($this->list, '\Fisharebest\Webtrees\Individual::compareBirthDate'); |
|
2196 | - break; |
|
2197 | - case 'DEAT:DATE': |
|
2198 | - uasort($this->list, '\Fisharebest\Webtrees\Individual::compareDeathDate'); |
|
2199 | - break; |
|
2200 | - case 'MARR:DATE': |
|
2201 | - uasort($this->list, '\Fisharebest\Webtrees\Family::compareMarrDate'); |
|
2202 | - break; |
|
2203 | - default: |
|
2204 | - // unsorted or already sorted by SQL |
|
2205 | - break; |
|
2186 | + case 'NAME': |
|
2187 | + uasort($this->list, '\Fisharebest\Webtrees\GedcomRecord::compare'); |
|
2188 | + break; |
|
2189 | + case 'CHAN': |
|
2190 | + uasort($this->list, function (GedcomRecord $x, GedcomRecord $y) { |
|
2191 | + return $y->lastChangeTimestamp(true) - $x->lastChangeTimestamp(true); |
|
2192 | + }); |
|
2193 | + break; |
|
2194 | + case 'BIRT:DATE': |
|
2195 | + uasort($this->list, '\Fisharebest\Webtrees\Individual::compareBirthDate'); |
|
2196 | + break; |
|
2197 | + case 'DEAT:DATE': |
|
2198 | + uasort($this->list, '\Fisharebest\Webtrees\Individual::compareDeathDate'); |
|
2199 | + break; |
|
2200 | + case 'MARR:DATE': |
|
2201 | + uasort($this->list, '\Fisharebest\Webtrees\Family::compareMarrDate'); |
|
2202 | + break; |
|
2203 | + default: |
|
2204 | + // unsorted or already sorted by SQL |
|
2205 | + break; |
|
2206 | 2206 | } |
2207 | 2207 | |
2208 | 2208 | array_push($this->repeats_stack, array($this->repeats, $this->repeat_bytes)); |
@@ -2353,88 +2353,88 @@ discard block |
||
2353 | 2353 | if (!empty($person)) { |
2354 | 2354 | $this->list[$id] = $person; |
2355 | 2355 | switch ($group) { |
2356 | - case "child-family": |
|
2357 | - foreach ($person->getChildFamilies() as $family) { |
|
2358 | - $husband = $family->getHusband(); |
|
2359 | - $wife = $family->getWife(); |
|
2360 | - if (!empty($husband)) { |
|
2361 | - $this->list[$husband->getXref()] = $husband; |
|
2362 | - } |
|
2363 | - if (!empty($wife)) { |
|
2364 | - $this->list[$wife->getXref()] = $wife; |
|
2365 | - } |
|
2366 | - $children = $family->getChildren(); |
|
2367 | - foreach ($children as $child) { |
|
2368 | - if (!empty($child)) { |
|
2369 | - $this->list[$child->getXref()] = $child; |
|
2356 | + case "child-family": |
|
2357 | + foreach ($person->getChildFamilies() as $family) { |
|
2358 | + $husband = $family->getHusband(); |
|
2359 | + $wife = $family->getWife(); |
|
2360 | + if (!empty($husband)) { |
|
2361 | + $this->list[$husband->getXref()] = $husband; |
|
2362 | + } |
|
2363 | + if (!empty($wife)) { |
|
2364 | + $this->list[$wife->getXref()] = $wife; |
|
2365 | + } |
|
2366 | + $children = $family->getChildren(); |
|
2367 | + foreach ($children as $child) { |
|
2368 | + if (!empty($child)) { |
|
2369 | + $this->list[$child->getXref()] = $child; |
|
2370 | + } |
|
2370 | 2371 | } |
2371 | 2372 | } |
2372 | - } |
|
2373 | - break; |
|
2374 | - case "spouse-family": |
|
2375 | - foreach ($person->getSpouseFamilies() as $family) { |
|
2376 | - $husband = $family->getHusband(); |
|
2377 | - $wife = $family->getWife(); |
|
2378 | - if (!empty($husband)) { |
|
2379 | - $this->list[$husband->getXref()] = $husband; |
|
2380 | - } |
|
2381 | - if (!empty($wife)) { |
|
2382 | - $this->list[$wife->getXref()] = $wife; |
|
2383 | - } |
|
2384 | - $children = $family->getChildren(); |
|
2385 | - foreach ($children as $child) { |
|
2386 | - if (!empty($child)) { |
|
2387 | - $this->list[$child->getXref()] = $child; |
|
2373 | + break; |
|
2374 | + case "spouse-family": |
|
2375 | + foreach ($person->getSpouseFamilies() as $family) { |
|
2376 | + $husband = $family->getHusband(); |
|
2377 | + $wife = $family->getWife(); |
|
2378 | + if (!empty($husband)) { |
|
2379 | + $this->list[$husband->getXref()] = $husband; |
|
2380 | + } |
|
2381 | + if (!empty($wife)) { |
|
2382 | + $this->list[$wife->getXref()] = $wife; |
|
2383 | + } |
|
2384 | + $children = $family->getChildren(); |
|
2385 | + foreach ($children as $child) { |
|
2386 | + if (!empty($child)) { |
|
2387 | + $this->list[$child->getXref()] = $child; |
|
2388 | + } |
|
2388 | 2389 | } |
2389 | 2390 | } |
2390 | - } |
|
2391 | - break; |
|
2392 | - case "direct-ancestors": |
|
2393 | - $this->addAncestors($this->list, $id, false, $maxgen); |
|
2394 | - break; |
|
2395 | - case "ancestors": |
|
2396 | - $this->addAncestors($this->list, $id, true, $maxgen); |
|
2397 | - break; |
|
2398 | - case "descendants": |
|
2399 | - $this->list[$id]->generation = 1; |
|
2400 | - $this->addDescendancy($this->list, $id, false, $maxgen); |
|
2401 | - break; |
|
2402 | - case "all": |
|
2403 | - $this->addAncestors($this->list, $id, true, $maxgen); |
|
2404 | - $this->addDescendancy($this->list, $id, true, $maxgen); |
|
2405 | - break; |
|
2391 | + break; |
|
2392 | + case "direct-ancestors": |
|
2393 | + $this->addAncestors($this->list, $id, false, $maxgen); |
|
2394 | + break; |
|
2395 | + case "ancestors": |
|
2396 | + $this->addAncestors($this->list, $id, true, $maxgen); |
|
2397 | + break; |
|
2398 | + case "descendants": |
|
2399 | + $this->list[$id]->generation = 1; |
|
2400 | + $this->addDescendancy($this->list, $id, false, $maxgen); |
|
2401 | + break; |
|
2402 | + case "all": |
|
2403 | + $this->addAncestors($this->list, $id, true, $maxgen); |
|
2404 | + $this->addDescendancy($this->list, $id, true, $maxgen); |
|
2405 | + break; |
|
2406 | 2406 | } |
2407 | 2407 | } |
2408 | 2408 | |
2409 | 2409 | switch ($sortby) { |
2410 | - case 'NAME': |
|
2411 | - uasort($this->list, '\Fisharebest\Webtrees\GedcomRecord::compare'); |
|
2412 | - break; |
|
2413 | - case 'BIRT:DATE': |
|
2414 | - uasort($this->list, '\Fisharebest\Webtrees\Individual::compareBirthDate'); |
|
2415 | - break; |
|
2416 | - case 'DEAT:DATE': |
|
2417 | - uasort($this->list, '\Fisharebest\Webtrees\Individual::compareDeathDate'); |
|
2418 | - break; |
|
2419 | - case 'generation': |
|
2420 | - $newarray = array(); |
|
2421 | - reset($this->list); |
|
2422 | - $genCounter = 1; |
|
2423 | - while (count($newarray) < count($this->list)) { |
|
2424 | - foreach ($this->list as $key => $value) { |
|
2425 | - $this->generation = $value->generation; |
|
2426 | - if ($this->generation == $genCounter) { |
|
2427 | - $newarray[$key] = new \stdClass; |
|
2428 | - $newarray[$key]->generation = $this->generation; |
|
2410 | + case 'NAME': |
|
2411 | + uasort($this->list, '\Fisharebest\Webtrees\GedcomRecord::compare'); |
|
2412 | + break; |
|
2413 | + case 'BIRT:DATE': |
|
2414 | + uasort($this->list, '\Fisharebest\Webtrees\Individual::compareBirthDate'); |
|
2415 | + break; |
|
2416 | + case 'DEAT:DATE': |
|
2417 | + uasort($this->list, '\Fisharebest\Webtrees\Individual::compareDeathDate'); |
|
2418 | + break; |
|
2419 | + case 'generation': |
|
2420 | + $newarray = array(); |
|
2421 | + reset($this->list); |
|
2422 | + $genCounter = 1; |
|
2423 | + while (count($newarray) < count($this->list)) { |
|
2424 | + foreach ($this->list as $key => $value) { |
|
2425 | + $this->generation = $value->generation; |
|
2426 | + if ($this->generation == $genCounter) { |
|
2427 | + $newarray[$key] = new \stdClass; |
|
2428 | + $newarray[$key]->generation = $this->generation; |
|
2429 | + } |
|
2429 | 2430 | } |
2431 | + $genCounter++; |
|
2430 | 2432 | } |
2431 | - $genCounter++; |
|
2432 | - } |
|
2433 | - $this->list = $newarray; |
|
2434 | - break; |
|
2435 | - default: |
|
2436 | - // unsorted |
|
2437 | - break; |
|
2433 | + $this->list = $newarray; |
|
2434 | + break; |
|
2435 | + default: |
|
2436 | + // unsorted |
|
2437 | + break; |
|
2438 | 2438 | } |
2439 | 2439 | array_push($this->repeats_stack, array($this->repeats, $this->repeat_bytes)); |
2440 | 2440 | $this->repeat_bytes = xml_get_current_line_number($this->parser) + 1; |
@@ -57,14 +57,14 @@ |
||
57 | 57 | 'MADRI', 'MANAU', 'MANHA', 'MANIL', 'MANTI', 'MEDFO', 'MELBO', 'MEMPH', |
58 | 58 | 'MERID', 'MEXIC', 'MNTVD', 'MONTE', 'MONTI', 'MONTR', 'MTIMP', 'NASHV', |
59 | 59 | 'NAUV2', 'NAUVO', 'NBEAC', 'NUKUA', 'NYORK', 'NZEAL', 'OAKLA', 'OAXAC', |
60 | - 'OGDEN', 'OKLAH', 'OQUIR', 'ORLAN', 'PALEG', 'PALMY', 'PANAM', 'PAPEE', |
|
61 | - 'PAYSO', 'PERTH', 'PHOEN', 'POFFI', 'PORTL', 'PREST', 'PROCC', 'PROVO', |
|
60 | + 'OGDEN', 'OKLAH', 'OQUIR', 'ORLAN', 'PALEG', 'PALMY', 'PANAM', 'PAPEE', |
|
61 | + 'PAYSO', 'PERTH', 'PHOEN', 'POFFI', 'PORTL', 'PREST', 'PROCC', 'PROVO', |
|
62 | 62 | 'QUETZ', 'RALEI', 'RECIF', 'REDLA', 'REGIN', 'RENO', 'REXBU', 'SACRA', |
63 | - 'SAMOA', 'SANTI', 'SANSA', 'SANTO', 'SDIEG', 'SDOMI', 'SEATT', 'SEOUL', |
|
64 | - 'SGEOR', 'SJOSE', 'SLAKE', 'SLOUI', 'SNOWF','SPAUL', 'SPMIN', 'SPOKA', |
|
63 | + 'SAMOA', 'SANTI', 'SANSA', 'SANTO', 'SDIEG', 'SDOMI', 'SEATT', 'SEOUL', |
|
64 | + 'SGEOR', 'SJOSE', 'SLAKE', 'SLOUI', 'SNOWF', 'SPAUL', 'SPMIN', 'SPOKA', |
|
65 | 65 | 'STOCK', 'SUVA', 'SWISS', 'SYDNE', 'TAIPE', 'TAMPI', 'TEGUC', 'TGUTI', |
66 | - 'TIHUA', 'TOKYO', 'TORNO', 'TRUJI', 'TWINF', 'VANCO', 'VERAC', 'VERNA', |
|
67 | - 'VILLA', 'WASHI', 'WINTE', |
|
66 | + 'TIHUA', 'TOKYO', 'TORNO', 'TRUJI', 'TWINF', 'VANCO', 'VERAC', 'VERNA', |
|
67 | + 'VILLA', 'WASHI', 'WINTE', |
|
68 | 68 | ); |
69 | 69 | } |
70 | 70 |
@@ -77,318 +77,318 @@ |
||
77 | 77 | */ |
78 | 78 | public static function templeName($temple_code) { |
79 | 79 | switch ($temple_code) { |
80 | - case 'ABA': |
|
81 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Aba, Nigeria'); |
|
82 | - case 'ACCRA': |
|
83 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Accra, Ghana'); |
|
84 | - case 'ADELA': |
|
85 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Adelaide, Australia'); |
|
86 | - case 'ALBER': |
|
87 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Cardston, Alberta, Canada'); |
|
88 | - case 'ALBUQ': |
|
89 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Albuquerque, New Mexico, United States'); |
|
90 | - case 'ANCHO': |
|
91 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Anchorage, Alaska, United States'); |
|
92 | - case 'APIA': |
|
93 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Apia, Samoa'); |
|
94 | - case 'ARIZO': |
|
95 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Mesa, Arizona, United States'); |
|
96 | - case 'ASUNC': |
|
97 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Asuncion, Paraguay'); |
|
98 | - case 'ATLAN': |
|
99 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Atlanta, Georgia, United States'); |
|
100 | - case 'BAIRE': |
|
101 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Buenos Aires, Argentina'); |
|
102 | - case 'BILLI': |
|
103 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Billings, Montana, United States'); |
|
104 | - case 'BIRMI': |
|
105 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Birmingham, Alabama, United States'); |
|
106 | - case 'BISMA': |
|
107 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Bismarck, North Dakota, United States'); |
|
108 | - case 'BOGOT': |
|
109 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Bogota, Colombia'); |
|
110 | - case 'BOISE': |
|
111 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Boise, Idaho, United States'); |
|
112 | - case 'BOSTO': |
|
113 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Boston, Massachusetts, United States'); |
|
114 | - case 'BOUNT': |
|
115 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Bountiful, Utah, United States'); |
|
116 | - case 'BRIGH': |
|
117 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Brigham City, Utah, United States'); |
|
118 | - case 'BRISB': |
|
119 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Brisbane, Australia'); |
|
120 | - case 'BROUG': |
|
121 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Baton Rouge, Louisiana, United States'); |
|
122 | - case 'CALGA': |
|
123 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Calgary, Alberta, Canada'); |
|
124 | - case 'CAMPI': |
|
125 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Campinas, Brazil'); |
|
126 | - case 'CARAC': |
|
127 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Caracas, Venezuela'); |
|
128 | - case 'CEBUP': |
|
129 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Cebu City, Philippines'); |
|
130 | - case 'CHICA': |
|
131 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Chicago, Illinois, United States'); |
|
132 | - case 'CIUJU': |
|
133 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Ciudad Juarez, Mexico'); |
|
134 | - case 'COCHA': |
|
135 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Cochabamba, Bolivia'); |
|
136 | - case 'COLJU': |
|
137 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Colonia Juarez, Mexico'); |
|
138 | - case 'COLSC': |
|
139 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Columbia, South Carolina, United States'); |
|
140 | - case 'COLUM': |
|
141 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Columbus, Ohio, United States'); |
|
142 | - case 'COPEN': |
|
143 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Copenhagen, Denmark'); |
|
144 | - case 'CORDO': |
|
145 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Cordoba, Argentina'); |
|
146 | - case 'CRIVE': |
|
147 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Columbia River, Washington, United States'); |
|
148 | - case 'CURIT': |
|
149 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Curitiba, Brazil'); |
|
150 | - case 'DALLA': |
|
151 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Dallas, Texas, United States'); |
|
152 | - case 'DENVE': |
|
153 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Denver, Colorado, United States'); |
|
154 | - case 'DETRO': |
|
155 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Detroit, Michigan, United States'); |
|
156 | - case 'DRAPE': |
|
157 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Draper, Utah, United States'); |
|
158 | - case 'EDMON': |
|
159 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Edmonton, Alberta, Canada'); |
|
160 | - case 'EHOUS': |
|
161 | - return /* I18N: Location of an historic LDS church temple - http://en.wikipedia.org/wiki/Endowment_house */ I18N::translate('Endowment House'); |
|
162 | - case 'FORTL': |
|
163 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Fort Lauderdale, Florida, United States'); |
|
164 | - case 'FRANK': |
|
165 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Frankfurt am Main, Germany'); |
|
166 | - case 'FREIB': |
|
167 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Freiburg, Germany'); |
|
168 | - case 'FRESN': |
|
169 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Fresno, California, United States'); |
|
170 | - case 'FUKUO': |
|
171 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Fukuoka, Japan'); |
|
172 | - case 'GILAV': |
|
173 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Gila Valley, Arizona, United States'); |
|
174 | - case 'GILBE': |
|
175 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Gilbert, Arizona, United States'); |
|
176 | - case 'GUADA': |
|
177 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Guadalajara, Mexico'); |
|
178 | - case 'GUATE': |
|
179 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Guatemala City, Guatemala'); |
|
180 | - case 'GUAYA': |
|
181 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Guayaquil, Ecuador'); |
|
182 | - case 'HAGUE': |
|
183 | - return /* I18N: Location of an LDS church temple */ I18N::translate('The Hague, Netherlands'); |
|
184 | - case 'HALIF': |
|
185 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Halifax, Nova Scotia, Canada'); |
|
186 | - case 'HARTF': |
|
187 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Hartford, Connecticut, United States'); |
|
188 | - case 'HAWAI': |
|
189 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Laie, Hawaii, United States'); |
|
190 | - case 'HELSI': |
|
191 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Helsinki, Finland'); |
|
192 | - case 'HERMO': |
|
193 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Hermosillo, Mexico'); |
|
194 | - case 'HKONG': |
|
195 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Hong Kong'); |
|
196 | - case 'HOUST': |
|
197 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Houston, Texas, United States'); |
|
198 | - case 'IFALL': |
|
199 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Idaho Falls, Idaho, United States'); |
|
200 | - case 'INDIA': |
|
201 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Indianapolis, Indiana, United States'); |
|
202 | - case 'JOHAN': |
|
203 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Johannesburg, South Africa'); |
|
204 | - case 'JRIVE': |
|
205 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Jordan River, Utah, United States'); |
|
206 | - case 'KANSA': |
|
207 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Kansas City, Missouri, United States'); |
|
208 | - case 'KONA': |
|
209 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Kona, Hawaii, United States'); |
|
210 | - case 'KYIV': |
|
211 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Kiev, Ukraine'); |
|
212 | - case 'LANGE': |
|
213 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Los Angeles, California, United States'); |
|
214 | - case 'LIMA': |
|
215 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Lima, Peru'); |
|
216 | - case 'LOGAN': |
|
217 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Logan, Utah, United States'); |
|
218 | - case 'LONDO': |
|
219 | - return /* I18N: Location of an LDS church temple */ I18N::translate('London, England'); |
|
220 | - case 'LOUIS': |
|
221 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Louisville, Kentucky, United States'); |
|
222 | - case 'LUBBO': |
|
223 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Lubbock, Texas, United States'); |
|
224 | - case 'LVEGA': |
|
225 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Las Vegas, Nevada, United States'); |
|
226 | - case 'MADRI': |
|
227 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Madrid, Spain'); |
|
228 | - case 'MANAU': |
|
229 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Manaus, Brazil'); |
|
230 | - case 'MANHA': |
|
231 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Manhattan, New York, United States'); |
|
232 | - case 'MANIL': |
|
233 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Manila, Philippines'); |
|
234 | - case 'MANTI': |
|
235 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Manti, Utah, United States'); |
|
236 | - case 'MEDFO': |
|
237 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Medford, Oregon, United States'); |
|
238 | - case 'MELBO': |
|
239 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Melbourne, Australia'); |
|
240 | - case 'MEMPH': |
|
241 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Memphis, Tennessee, United States'); |
|
242 | - case 'MERID': |
|
243 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Merida, Mexico'); |
|
244 | - case 'MEXIC': |
|
245 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Mexico City, Mexico'); |
|
246 | - case 'MNTVD': |
|
247 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Montevideo, Uruguay'); |
|
248 | - case 'MONTE': |
|
249 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Monterrey, Mexico'); |
|
250 | - case 'MONTI': |
|
251 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Monticello, Utah, United States'); |
|
252 | - case 'MONTR': |
|
253 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Montreal, Quebec, Canada'); |
|
254 | - case 'MTIMP': |
|
255 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Mount Timpanogos, Utah, United States'); |
|
256 | - case 'NASHV': |
|
257 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Nashville, Tennessee, United States'); |
|
258 | - case 'NAUV2': |
|
259 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Nauvoo (new), Illinois, United States'); |
|
260 | - case 'NAUVO': |
|
261 | - return /* I18N: Location of an historic LDS church temple */ I18N::translate('Nauvoo (original), Illinois, United States'); |
|
262 | - case 'NBEAC': |
|
263 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Newport Beach, California, United States'); |
|
264 | - case 'NUKUA': |
|
265 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Nuku’Alofa, Tonga'); |
|
266 | - case 'NYORK': |
|
267 | - return /* I18N: Location of an historic LDS church temple */ I18N::translate('New York, New York, United States'); |
|
268 | - case 'NZEAL': |
|
269 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Hamilton, New Zealand'); |
|
270 | - case 'OAKLA': |
|
271 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Oakland, California, United States'); |
|
272 | - case 'OAXAC': |
|
273 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Oaxaca, Mexico'); |
|
274 | - case 'OGDEN': |
|
275 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Ogden, Utah, United States'); |
|
276 | - case 'OKLAH': |
|
277 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Oklahoma City, Oklahoma, United States'); |
|
278 | - case 'OQUIR': |
|
279 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Oquirrh Mountain, Utah, United States'); |
|
280 | - case 'ORLAN': |
|
281 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Orlando, Florida, United States'); |
|
282 | - case 'PALEG': |
|
283 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Porto Alegre, Brazil'); |
|
284 | - case 'PALMY': |
|
285 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Palmyra, New York, United States'); |
|
286 | - case 'PANAM': |
|
287 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Panama City, Panama'); |
|
288 | - case 'PAPEE': |
|
289 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Papeete, Tahiti'); |
|
290 | - case 'PAYSO': |
|
291 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Payson, Utah, United States'); |
|
292 | - case 'PERTH': |
|
293 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Perth, Australia'); |
|
294 | - case 'PHOEN': |
|
295 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Phoenix, Arizona, United States'); |
|
296 | - case 'POFFI': |
|
297 | - return /* I18N: I18N: Location of an historic LDS church temple - http://en.wikipedia.org/wiki/President_of_the_Church */ I18N::translate('President’s Office'); |
|
298 | - case 'PORTL': |
|
299 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Portland, Oregon, United States'); |
|
300 | - case 'PREST': |
|
301 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Preston, England'); |
|
302 | - case 'PROCC': |
|
303 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Provo City Center, Utah, United States'); |
|
304 | - case 'PROVO': |
|
305 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Provo, Utah, United States'); |
|
306 | - case 'QUETZ': |
|
307 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Quetzaltenango, Guatemala'); |
|
308 | - case 'RALEI': |
|
309 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Raleigh, North Carolina, United States'); |
|
310 | - case 'RECIF': |
|
311 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Recife, Brazil'); |
|
312 | - case 'REDLA': |
|
313 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Redlands, California, United States'); |
|
314 | - case 'REGIN': |
|
315 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Regina, Saskatchewan, Canada'); |
|
316 | - case 'RENO': |
|
317 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Reno, Nevada, United States'); |
|
318 | - case 'REXBU': |
|
319 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Rexburg, Idaho, United States'); |
|
320 | - case 'SACRA': |
|
321 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Sacramento, California, United States'); |
|
322 | - case 'SANSA': |
|
323 | - return /* I18N: Location of an LDS church temple */ I18N::translate('San Salvador, El Salvador'); |
|
324 | - case 'SANTI': |
|
325 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Santiago, Chile'); |
|
326 | - case 'SANTO': |
|
327 | - return /* I18N: Location of an LDS church temple */ I18N::translate('San Antonio, Texas, United States'); |
|
328 | - case 'SDIEG': |
|
329 | - return /* I18N: Location of an LDS church temple */ I18N::translate('San Diego, California, United States'); |
|
330 | - case 'SDOMI': |
|
331 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Santo Domingo, Dominican Republic'); |
|
332 | - case 'SEATT': |
|
333 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Seattle, Washington, United States'); |
|
334 | - case 'SEOUL': |
|
335 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Seoul, Korea'); |
|
336 | - case 'SGEOR': |
|
337 | - return /* I18N: Location of an LDS church temple */ I18N::translate('St. George, Utah, United States'); |
|
338 | - case 'SJOSE': |
|
339 | - return /* I18N: Location of an LDS church temple */ I18N::translate('San Jose, Costa Rica'); |
|
340 | - case 'SLAKE': |
|
341 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Salt Lake City, Utah, United States'); |
|
342 | - case 'SLOUI': |
|
343 | - return /* I18N: Location of an LDS church temple */ I18N::translate('St. Louis, Missouri, United States'); |
|
344 | - case 'SNOWF': |
|
345 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Snowflake, Arizona, United States'); |
|
346 | - case 'SPAUL': |
|
347 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Sao Paulo, Brazil'); |
|
348 | - case 'SPMIN': |
|
349 | - return /* I18N: Location of an LDS church temple */ I18N::translate('St. Paul, Minnesota, United States'); |
|
350 | - case 'SPOKA': |
|
351 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Spokane, Washington, United States'); |
|
352 | - case 'STOCK': |
|
353 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Stockholm, Sweden'); |
|
354 | - case 'SUVA': |
|
355 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Suva, Fiji'); |
|
356 | - case 'SWISS': |
|
357 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Bern, Switzerland'); |
|
358 | - case 'SYDNE': |
|
359 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Sydney, Australia'); |
|
360 | - case 'TAIPE': |
|
361 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Taipei, Taiwan'); |
|
362 | - case 'TAMPI': |
|
363 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Tampico, Mexico'); |
|
364 | - case 'TEGUC': |
|
365 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Tegucigalpa, Honduras'); |
|
366 | - case 'TGUTI': |
|
367 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Tuxtla Gutierrez, Mexico'); |
|
368 | - case 'TIJUA': |
|
369 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Tijuana, Mexico'); |
|
370 | - case 'TOKYO': |
|
371 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Tokyo, Japan'); |
|
372 | - case 'TORNO': |
|
373 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Toronto, Ontario, Canada'); |
|
374 | - case 'TRUJI': |
|
375 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Trujillo, Peru'); |
|
376 | - case 'TWINF': |
|
377 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Twin Falls, Idaho, United States'); |
|
378 | - case 'VANCO': |
|
379 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Vancouver, British Columbia, Canada'); |
|
380 | - case 'VERAC': |
|
381 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Veracruz, Mexico'); |
|
382 | - case 'VERNA': |
|
383 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Vernal, Utah, United States'); |
|
384 | - case 'VILLA': |
|
385 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Villa Hermosa, Mexico'); |
|
386 | - case 'WASHI': |
|
387 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Washington, District of Columbia, United States'); |
|
388 | - case 'WINTE': |
|
389 | - return /* I18N: Location of an LDS church temple */ I18N::translate('Winter Quarters, Nebraska, United States'); |
|
390 | - default: |
|
391 | - return $temple_code; |
|
80 | + case 'ABA': |
|
81 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Aba, Nigeria'); |
|
82 | + case 'ACCRA': |
|
83 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Accra, Ghana'); |
|
84 | + case 'ADELA': |
|
85 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Adelaide, Australia'); |
|
86 | + case 'ALBER': |
|
87 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Cardston, Alberta, Canada'); |
|
88 | + case 'ALBUQ': |
|
89 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Albuquerque, New Mexico, United States'); |
|
90 | + case 'ANCHO': |
|
91 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Anchorage, Alaska, United States'); |
|
92 | + case 'APIA': |
|
93 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Apia, Samoa'); |
|
94 | + case 'ARIZO': |
|
95 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Mesa, Arizona, United States'); |
|
96 | + case 'ASUNC': |
|
97 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Asuncion, Paraguay'); |
|
98 | + case 'ATLAN': |
|
99 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Atlanta, Georgia, United States'); |
|
100 | + case 'BAIRE': |
|
101 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Buenos Aires, Argentina'); |
|
102 | + case 'BILLI': |
|
103 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Billings, Montana, United States'); |
|
104 | + case 'BIRMI': |
|
105 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Birmingham, Alabama, United States'); |
|
106 | + case 'BISMA': |
|
107 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Bismarck, North Dakota, United States'); |
|
108 | + case 'BOGOT': |
|
109 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Bogota, Colombia'); |
|
110 | + case 'BOISE': |
|
111 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Boise, Idaho, United States'); |
|
112 | + case 'BOSTO': |
|
113 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Boston, Massachusetts, United States'); |
|
114 | + case 'BOUNT': |
|
115 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Bountiful, Utah, United States'); |
|
116 | + case 'BRIGH': |
|
117 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Brigham City, Utah, United States'); |
|
118 | + case 'BRISB': |
|
119 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Brisbane, Australia'); |
|
120 | + case 'BROUG': |
|
121 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Baton Rouge, Louisiana, United States'); |
|
122 | + case 'CALGA': |
|
123 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Calgary, Alberta, Canada'); |
|
124 | + case 'CAMPI': |
|
125 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Campinas, Brazil'); |
|
126 | + case 'CARAC': |
|
127 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Caracas, Venezuela'); |
|
128 | + case 'CEBUP': |
|
129 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Cebu City, Philippines'); |
|
130 | + case 'CHICA': |
|
131 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Chicago, Illinois, United States'); |
|
132 | + case 'CIUJU': |
|
133 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Ciudad Juarez, Mexico'); |
|
134 | + case 'COCHA': |
|
135 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Cochabamba, Bolivia'); |
|
136 | + case 'COLJU': |
|
137 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Colonia Juarez, Mexico'); |
|
138 | + case 'COLSC': |
|
139 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Columbia, South Carolina, United States'); |
|
140 | + case 'COLUM': |
|
141 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Columbus, Ohio, United States'); |
|
142 | + case 'COPEN': |
|
143 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Copenhagen, Denmark'); |
|
144 | + case 'CORDO': |
|
145 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Cordoba, Argentina'); |
|
146 | + case 'CRIVE': |
|
147 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Columbia River, Washington, United States'); |
|
148 | + case 'CURIT': |
|
149 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Curitiba, Brazil'); |
|
150 | + case 'DALLA': |
|
151 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Dallas, Texas, United States'); |
|
152 | + case 'DENVE': |
|
153 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Denver, Colorado, United States'); |
|
154 | + case 'DETRO': |
|
155 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Detroit, Michigan, United States'); |
|
156 | + case 'DRAPE': |
|
157 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Draper, Utah, United States'); |
|
158 | + case 'EDMON': |
|
159 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Edmonton, Alberta, Canada'); |
|
160 | + case 'EHOUS': |
|
161 | + return /* I18N: Location of an historic LDS church temple - http://en.wikipedia.org/wiki/Endowment_house */ I18N::translate('Endowment House'); |
|
162 | + case 'FORTL': |
|
163 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Fort Lauderdale, Florida, United States'); |
|
164 | + case 'FRANK': |
|
165 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Frankfurt am Main, Germany'); |
|
166 | + case 'FREIB': |
|
167 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Freiburg, Germany'); |
|
168 | + case 'FRESN': |
|
169 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Fresno, California, United States'); |
|
170 | + case 'FUKUO': |
|
171 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Fukuoka, Japan'); |
|
172 | + case 'GILAV': |
|
173 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Gila Valley, Arizona, United States'); |
|
174 | + case 'GILBE': |
|
175 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Gilbert, Arizona, United States'); |
|
176 | + case 'GUADA': |
|
177 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Guadalajara, Mexico'); |
|
178 | + case 'GUATE': |
|
179 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Guatemala City, Guatemala'); |
|
180 | + case 'GUAYA': |
|
181 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Guayaquil, Ecuador'); |
|
182 | + case 'HAGUE': |
|
183 | + return /* I18N: Location of an LDS church temple */ I18N::translate('The Hague, Netherlands'); |
|
184 | + case 'HALIF': |
|
185 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Halifax, Nova Scotia, Canada'); |
|
186 | + case 'HARTF': |
|
187 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Hartford, Connecticut, United States'); |
|
188 | + case 'HAWAI': |
|
189 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Laie, Hawaii, United States'); |
|
190 | + case 'HELSI': |
|
191 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Helsinki, Finland'); |
|
192 | + case 'HERMO': |
|
193 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Hermosillo, Mexico'); |
|
194 | + case 'HKONG': |
|
195 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Hong Kong'); |
|
196 | + case 'HOUST': |
|
197 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Houston, Texas, United States'); |
|
198 | + case 'IFALL': |
|
199 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Idaho Falls, Idaho, United States'); |
|
200 | + case 'INDIA': |
|
201 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Indianapolis, Indiana, United States'); |
|
202 | + case 'JOHAN': |
|
203 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Johannesburg, South Africa'); |
|
204 | + case 'JRIVE': |
|
205 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Jordan River, Utah, United States'); |
|
206 | + case 'KANSA': |
|
207 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Kansas City, Missouri, United States'); |
|
208 | + case 'KONA': |
|
209 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Kona, Hawaii, United States'); |
|
210 | + case 'KYIV': |
|
211 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Kiev, Ukraine'); |
|
212 | + case 'LANGE': |
|
213 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Los Angeles, California, United States'); |
|
214 | + case 'LIMA': |
|
215 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Lima, Peru'); |
|
216 | + case 'LOGAN': |
|
217 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Logan, Utah, United States'); |
|
218 | + case 'LONDO': |
|
219 | + return /* I18N: Location of an LDS church temple */ I18N::translate('London, England'); |
|
220 | + case 'LOUIS': |
|
221 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Louisville, Kentucky, United States'); |
|
222 | + case 'LUBBO': |
|
223 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Lubbock, Texas, United States'); |
|
224 | + case 'LVEGA': |
|
225 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Las Vegas, Nevada, United States'); |
|
226 | + case 'MADRI': |
|
227 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Madrid, Spain'); |
|
228 | + case 'MANAU': |
|
229 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Manaus, Brazil'); |
|
230 | + case 'MANHA': |
|
231 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Manhattan, New York, United States'); |
|
232 | + case 'MANIL': |
|
233 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Manila, Philippines'); |
|
234 | + case 'MANTI': |
|
235 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Manti, Utah, United States'); |
|
236 | + case 'MEDFO': |
|
237 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Medford, Oregon, United States'); |
|
238 | + case 'MELBO': |
|
239 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Melbourne, Australia'); |
|
240 | + case 'MEMPH': |
|
241 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Memphis, Tennessee, United States'); |
|
242 | + case 'MERID': |
|
243 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Merida, Mexico'); |
|
244 | + case 'MEXIC': |
|
245 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Mexico City, Mexico'); |
|
246 | + case 'MNTVD': |
|
247 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Montevideo, Uruguay'); |
|
248 | + case 'MONTE': |
|
249 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Monterrey, Mexico'); |
|
250 | + case 'MONTI': |
|
251 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Monticello, Utah, United States'); |
|
252 | + case 'MONTR': |
|
253 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Montreal, Quebec, Canada'); |
|
254 | + case 'MTIMP': |
|
255 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Mount Timpanogos, Utah, United States'); |
|
256 | + case 'NASHV': |
|
257 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Nashville, Tennessee, United States'); |
|
258 | + case 'NAUV2': |
|
259 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Nauvoo (new), Illinois, United States'); |
|
260 | + case 'NAUVO': |
|
261 | + return /* I18N: Location of an historic LDS church temple */ I18N::translate('Nauvoo (original), Illinois, United States'); |
|
262 | + case 'NBEAC': |
|
263 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Newport Beach, California, United States'); |
|
264 | + case 'NUKUA': |
|
265 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Nuku’Alofa, Tonga'); |
|
266 | + case 'NYORK': |
|
267 | + return /* I18N: Location of an historic LDS church temple */ I18N::translate('New York, New York, United States'); |
|
268 | + case 'NZEAL': |
|
269 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Hamilton, New Zealand'); |
|
270 | + case 'OAKLA': |
|
271 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Oakland, California, United States'); |
|
272 | + case 'OAXAC': |
|
273 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Oaxaca, Mexico'); |
|
274 | + case 'OGDEN': |
|
275 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Ogden, Utah, United States'); |
|
276 | + case 'OKLAH': |
|
277 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Oklahoma City, Oklahoma, United States'); |
|
278 | + case 'OQUIR': |
|
279 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Oquirrh Mountain, Utah, United States'); |
|
280 | + case 'ORLAN': |
|
281 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Orlando, Florida, United States'); |
|
282 | + case 'PALEG': |
|
283 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Porto Alegre, Brazil'); |
|
284 | + case 'PALMY': |
|
285 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Palmyra, New York, United States'); |
|
286 | + case 'PANAM': |
|
287 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Panama City, Panama'); |
|
288 | + case 'PAPEE': |
|
289 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Papeete, Tahiti'); |
|
290 | + case 'PAYSO': |
|
291 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Payson, Utah, United States'); |
|
292 | + case 'PERTH': |
|
293 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Perth, Australia'); |
|
294 | + case 'PHOEN': |
|
295 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Phoenix, Arizona, United States'); |
|
296 | + case 'POFFI': |
|
297 | + return /* I18N: I18N: Location of an historic LDS church temple - http://en.wikipedia.org/wiki/President_of_the_Church */ I18N::translate('President’s Office'); |
|
298 | + case 'PORTL': |
|
299 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Portland, Oregon, United States'); |
|
300 | + case 'PREST': |
|
301 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Preston, England'); |
|
302 | + case 'PROCC': |
|
303 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Provo City Center, Utah, United States'); |
|
304 | + case 'PROVO': |
|
305 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Provo, Utah, United States'); |
|
306 | + case 'QUETZ': |
|
307 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Quetzaltenango, Guatemala'); |
|
308 | + case 'RALEI': |
|
309 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Raleigh, North Carolina, United States'); |
|
310 | + case 'RECIF': |
|
311 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Recife, Brazil'); |
|
312 | + case 'REDLA': |
|
313 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Redlands, California, United States'); |
|
314 | + case 'REGIN': |
|
315 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Regina, Saskatchewan, Canada'); |
|
316 | + case 'RENO': |
|
317 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Reno, Nevada, United States'); |
|
318 | + case 'REXBU': |
|
319 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Rexburg, Idaho, United States'); |
|
320 | + case 'SACRA': |
|
321 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Sacramento, California, United States'); |
|
322 | + case 'SANSA': |
|
323 | + return /* I18N: Location of an LDS church temple */ I18N::translate('San Salvador, El Salvador'); |
|
324 | + case 'SANTI': |
|
325 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Santiago, Chile'); |
|
326 | + case 'SANTO': |
|
327 | + return /* I18N: Location of an LDS church temple */ I18N::translate('San Antonio, Texas, United States'); |
|
328 | + case 'SDIEG': |
|
329 | + return /* I18N: Location of an LDS church temple */ I18N::translate('San Diego, California, United States'); |
|
330 | + case 'SDOMI': |
|
331 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Santo Domingo, Dominican Republic'); |
|
332 | + case 'SEATT': |
|
333 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Seattle, Washington, United States'); |
|
334 | + case 'SEOUL': |
|
335 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Seoul, Korea'); |
|
336 | + case 'SGEOR': |
|
337 | + return /* I18N: Location of an LDS church temple */ I18N::translate('St. George, Utah, United States'); |
|
338 | + case 'SJOSE': |
|
339 | + return /* I18N: Location of an LDS church temple */ I18N::translate('San Jose, Costa Rica'); |
|
340 | + case 'SLAKE': |
|
341 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Salt Lake City, Utah, United States'); |
|
342 | + case 'SLOUI': |
|
343 | + return /* I18N: Location of an LDS church temple */ I18N::translate('St. Louis, Missouri, United States'); |
|
344 | + case 'SNOWF': |
|
345 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Snowflake, Arizona, United States'); |
|
346 | + case 'SPAUL': |
|
347 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Sao Paulo, Brazil'); |
|
348 | + case 'SPMIN': |
|
349 | + return /* I18N: Location of an LDS church temple */ I18N::translate('St. Paul, Minnesota, United States'); |
|
350 | + case 'SPOKA': |
|
351 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Spokane, Washington, United States'); |
|
352 | + case 'STOCK': |
|
353 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Stockholm, Sweden'); |
|
354 | + case 'SUVA': |
|
355 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Suva, Fiji'); |
|
356 | + case 'SWISS': |
|
357 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Bern, Switzerland'); |
|
358 | + case 'SYDNE': |
|
359 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Sydney, Australia'); |
|
360 | + case 'TAIPE': |
|
361 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Taipei, Taiwan'); |
|
362 | + case 'TAMPI': |
|
363 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Tampico, Mexico'); |
|
364 | + case 'TEGUC': |
|
365 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Tegucigalpa, Honduras'); |
|
366 | + case 'TGUTI': |
|
367 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Tuxtla Gutierrez, Mexico'); |
|
368 | + case 'TIJUA': |
|
369 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Tijuana, Mexico'); |
|
370 | + case 'TOKYO': |
|
371 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Tokyo, Japan'); |
|
372 | + case 'TORNO': |
|
373 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Toronto, Ontario, Canada'); |
|
374 | + case 'TRUJI': |
|
375 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Trujillo, Peru'); |
|
376 | + case 'TWINF': |
|
377 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Twin Falls, Idaho, United States'); |
|
378 | + case 'VANCO': |
|
379 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Vancouver, British Columbia, Canada'); |
|
380 | + case 'VERAC': |
|
381 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Veracruz, Mexico'); |
|
382 | + case 'VERNA': |
|
383 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Vernal, Utah, United States'); |
|
384 | + case 'VILLA': |
|
385 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Villa Hermosa, Mexico'); |
|
386 | + case 'WASHI': |
|
387 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Washington, District of Columbia, United States'); |
|
388 | + case 'WINTE': |
|
389 | + return /* I18N: Location of an LDS church temple */ I18N::translate('Winter Quarters, Nebraska, United States'); |
|
390 | + default: |
|
391 | + return $temple_code; |
|
392 | 392 | } |
393 | 393 | } |
394 | 394 |
@@ -139,8 +139,11 @@ discard block |
||
139 | 139 | <div class="font9"> |
140 | 140 | <?php echo $spouse->getLifeSpan(); ?> |
141 | 141 | </div> |
142 | - <?php else: ?> |
|
143 | - <?php echo $spouse->getFullName(); ?> |
|
142 | + <?php else { |
|
143 | + : ?> |
|
144 | + <?php echo $spouse->getFullName(); |
|
145 | +} |
|
146 | +?> |
|
144 | 147 | <?php endif; ?> |
145 | 148 | </td> |
146 | 149 | </tr> |
@@ -164,8 +167,11 @@ discard block |
||
164 | 167 | <div class="font9"> |
165 | 168 | <?php echo $child->getLifeSpan(); ?> |
166 | 169 | </div> |
167 | - <?php else: ?> |
|
168 | - <?php echo $child->getFullName(); ?> |
|
170 | + <?php else { |
|
171 | + : ?> |
|
172 | + <?php echo $child->getFullName(); |
|
173 | +} |
|
174 | +?> |
|
169 | 175 | <?php endif; ?> |
170 | 176 | </td> |
171 | 177 | </tr> |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | /** |
102 | 102 | * Get the male (or first female) partner of the family |
103 | 103 | * |
104 | - * @param $access_level int|null |
|
104 | + * @param integer $access_level int|null |
|
105 | 105 | * |
106 | 106 | * @return Individual|null |
107 | 107 | */ |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | /** |
119 | 119 | * Get the female (or second male) partner of the family |
120 | 120 | * |
121 | - * @param $access_level int|null |
|
121 | + * @param integer $access_level int|null |
|
122 | 122 | * |
123 | 123 | * @return Individual|null |
124 | 124 | */ |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | // Check the script used by each name, so we can match cyrillic with cyrillic, greek with greek, etc. |
344 | 344 | $husb_names = array(); |
345 | 345 | if ($this->husb) { |
346 | - $husb_names = array_filter($this->husb->getAllNames(), function(array $x) { return $x['type'] !== '_MARNM'; } ); |
|
346 | + $husb_names = array_filter($this->husb->getAllNames(), function (array $x) { return $x['type'] !== '_MARNM'; } ); |
|
347 | 347 | } |
348 | 348 | // If the individual only has married names, create a dummy birth name. |
349 | 349 | if (empty($husb_names)) { |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | |
360 | 360 | $wife_names = array(); |
361 | 361 | if ($this->wife) { |
362 | - $wife_names = array_filter($this->wife->getAllNames(), function(array $x) { return $x['type'] !== '_MARNM'; } ); |
|
362 | + $wife_names = array_filter($this->wife->getAllNames(), function (array $x) { return $x['type'] !== '_MARNM'; } ); |
|
363 | 363 | } |
364 | 364 | // If the individual only has married names, create a dummy birth name. |
365 | 365 | if (empty($wife_names)) { |
@@ -388,7 +388,7 @@ |
||
388 | 388 | * (b) Level 1 object with the Highlight option missing or set to other than "Y" or "N" |
389 | 389 | * (c) Level 2 or higher object with the Highlight option set to "Y" |
390 | 390 | * |
391 | - * @return null|Media |
|
391 | + * @return GedcomRecord|null |
|
392 | 392 | */ |
393 | 393 | public function findHighlightedMedia() { |
394 | 394 | $objectA = null; |
@@ -879,33 +879,33 @@ |
||
879 | 879 | public function getPrimaryChildFamily() { |
880 | 880 | $families = $this->getChildFamilies(); |
881 | 881 | switch (count($families)) { |
882 | - case 0: |
|
883 | - return null; |
|
884 | - case 1: |
|
885 | - return reset($families); |
|
886 | - default: |
|
887 | - // If there is more than one FAMC record, choose the preferred parents: |
|
888 | - // a) records with '2 _PRIMARY' |
|
889 | - foreach ($families as $famid => $fam) { |
|
890 | - if (preg_match("/\n1 FAMC @{$famid}@\n(?:[2-9].*\n)*(?:2 _PRIMARY Y)/", $this->getGedcom())) { |
|
891 | - return $fam; |
|
882 | + case 0: |
|
883 | + return null; |
|
884 | + case 1: |
|
885 | + return reset($families); |
|
886 | + default: |
|
887 | + // If there is more than one FAMC record, choose the preferred parents: |
|
888 | + // a) records with '2 _PRIMARY' |
|
889 | + foreach ($families as $famid => $fam) { |
|
890 | + if (preg_match("/\n1 FAMC @{$famid}@\n(?:[2-9].*\n)*(?:2 _PRIMARY Y)/", $this->getGedcom())) { |
|
891 | + return $fam; |
|
892 | + } |
|
892 | 893 | } |
893 | - } |
|
894 | - // b) records with '2 PEDI birt' |
|
895 | - foreach ($families as $famid => $fam) { |
|
896 | - if (preg_match("/\n1 FAMC @{$famid}@\n(?:[2-9].*\n)*(?:2 PEDI birth)/", $this->getGedcom())) { |
|
897 | - return $fam; |
|
894 | + // b) records with '2 PEDI birt' |
|
895 | + foreach ($families as $famid => $fam) { |
|
896 | + if (preg_match("/\n1 FAMC @{$famid}@\n(?:[2-9].*\n)*(?:2 PEDI birth)/", $this->getGedcom())) { |
|
897 | + return $fam; |
|
898 | + } |
|
898 | 899 | } |
899 | - } |
|
900 | - // c) records with no '2 PEDI' |
|
901 | - foreach ($families as $famid => $fam) { |
|
902 | - if (!preg_match("/\n1 FAMC @{$famid}@\n(?:[2-9].*\n)*(?:2 PEDI)/", $this->getGedcom())) { |
|
903 | - return $fam; |
|
900 | + // c) records with no '2 PEDI' |
|
901 | + foreach ($families as $famid => $fam) { |
|
902 | + if (!preg_match("/\n1 FAMC @{$famid}@\n(?:[2-9].*\n)*(?:2 PEDI)/", $this->getGedcom())) { |
|
903 | + return $fam; |
|
904 | + } |
|
904 | 905 | } |
905 | - } |
|
906 | 906 | |
907 | - // d) any record |
|
908 | - return reset($families); |
|
907 | + // d) any record |
|
908 | + return reset($families); |
|
909 | 909 | } |
910 | 910 | } |
911 | 911 |
@@ -142,7 +142,7 @@ |
||
142 | 142 | * |
143 | 143 | * @param int $fetch_style |
144 | 144 | * |
145 | - * @return \stdClass|array|null |
|
145 | + * @return \stdClass |
|
146 | 146 | */ |
147 | 147 | public function fetchOneRow($fetch_style = PDO::FETCH_OBJ) { |
148 | 148 | if (!$this->executed) { |
@@ -64,18 +64,18 @@ |
||
64 | 64 | $key = ':' . $key; |
65 | 65 | } |
66 | 66 | switch (gettype($bind_variable)) { |
67 | - case 'NULL': |
|
68 | - $this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_NULL); |
|
69 | - break; |
|
70 | - case 'boolean': |
|
71 | - $this->pdo_statement->bindValue($key, (int) $bind_variable, PDO::PARAM_INT); |
|
72 | - break; |
|
73 | - case 'integer': |
|
74 | - $this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_INT); |
|
75 | - break; |
|
76 | - default: |
|
77 | - $this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_STR); |
|
78 | - break; |
|
67 | + case 'NULL': |
|
68 | + $this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_NULL); |
|
69 | + break; |
|
70 | + case 'boolean': |
|
71 | + $this->pdo_statement->bindValue($key, (int) $bind_variable, PDO::PARAM_INT); |
|
72 | + break; |
|
73 | + case 'integer': |
|
74 | + $this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_INT); |
|
75 | + break; |
|
76 | + default: |
|
77 | + $this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_STR); |
|
78 | + break; |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @param string $xref2 |
160 | 160 | * @param int $tree_id |
161 | 161 | * |
162 | - * @return array |
|
162 | + * @return string[] |
|
163 | 163 | */ |
164 | 164 | private function allAncestors($xref1, $xref2, $tree_id) { |
165 | 165 | $ancestors = array($xref1, $xref2); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @param string $xref2 |
199 | 199 | * @param int $tree_id |
200 | 200 | * |
201 | - * @return array |
|
201 | + * @return string[] |
|
202 | 202 | */ |
203 | 203 | private function excludeFamilies($xref1, $xref2, $tree_id) { |
204 | 204 | return Database::prepare( |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $form_pass2 = Filter::post('form_pass2', WT_REGEX_PASSWORD); |
45 | 45 | $form_email = Filter::postEmail('form_email'); |
46 | 46 | $form_rootid = Filter::post('form_rootid', WT_REGEX_XREF); |
47 | -$form_theme = Filter::post('form_theme', implode('|', array_keys(Theme::themeNames())), '');; |
|
47 | +$form_theme = Filter::post('form_theme', implode('|', array_keys(Theme::themeNames())), ''); ; |
|
48 | 48 | $form_language = Filter::post('form_language'); |
49 | 49 | $form_timezone = Filter::post('form_timezone'); |
50 | 50 | $form_contact_method = Filter::post('form_contact_method'); |
@@ -183,8 +183,11 @@ |
||
183 | 183 | <div class="value"> |
184 | 184 | <?php if ($my_individual_record): ?> |
185 | 185 | <?php echo $my_individual_record->formatList('span'); ?> |
186 | - <?php else: ?> |
|
187 | - <?php echo I18N::translateContext('unknown people', 'Unknown'); ?> |
|
186 | + <?php else { |
|
187 | + : ?> |
|
188 | + <?php echo I18N::translateContext('unknown people', 'Unknown'); |
|
189 | +} |
|
190 | +?> |
|
188 | 191 | <?php endif; ?> |
189 | 192 | <p class="small text-muted"> |
190 | 193 | <?php echo I18N::translate('This is a link to your own record in the family tree. If this is the wrong individual, contact an administrator.'); ?> |
@@ -53,52 +53,52 @@ |
||
53 | 53 | // Respond to form action |
54 | 54 | if ($form_action && Filter::checkCsrf()) { |
55 | 55 | switch ($form_action) { |
56 | - case 'update': |
|
57 | - if ($form_username !== Auth::user()->getUserName() && User::findByUserName($form_username)) { |
|
58 | - FlashMessages::addMessage(I18N::translate('Duplicate username. A user with that username already exists. Please choose another username.')); |
|
59 | - } elseif ($form_email !== Auth::user()->getEmail() && User::findByEmail($form_email)) { |
|
60 | - FlashMessages::addMessage(I18N::translate('Duplicate email address. A user with that email already exists.')); |
|
61 | - } else { |
|
62 | - // Change username |
|
63 | - if ($form_username !== Auth::user()->getUserName()) { |
|
64 | - Log::addAuthenticationLog('User ' . Auth::user()->getUserName() . ' renamed to ' . $form_username); |
|
65 | - Auth::user()->setUserName($form_username); |
|
66 | - } |
|
67 | - |
|
68 | - // Change password |
|
69 | - if ($form_pass1 && $form_pass1 === $form_pass2) { |
|
70 | - Auth::user()->setPassword($form_pass1); |
|
71 | - } |
|
72 | - |
|
73 | - // Change other settings |
|
74 | - Auth::user() |
|
75 | - ->setRealName($form_realname) |
|
76 | - ->setEmail($form_email) |
|
77 | - ->setPreference('language', $form_language) |
|
78 | - ->setPreference('TIMEZONE', $form_timezone) |
|
79 | - ->setPreference('contactmethod', $form_contact_method) |
|
80 | - ->setPreference('visibleonline', $form_visible_online ? '1' : '0'); |
|
81 | - |
|
82 | - if ($form_theme === null) { |
|
83 | - Auth::user()->deletePreference('theme'); |
|
56 | + case 'update': |
|
57 | + if ($form_username !== Auth::user()->getUserName() && User::findByUserName($form_username)) { |
|
58 | + FlashMessages::addMessage(I18N::translate('Duplicate username. A user with that username already exists. Please choose another username.')); |
|
59 | + } elseif ($form_email !== Auth::user()->getEmail() && User::findByEmail($form_email)) { |
|
60 | + FlashMessages::addMessage(I18N::translate('Duplicate email address. A user with that email already exists.')); |
|
84 | 61 | } else { |
85 | - Auth::user()->setPreference('theme', $form_theme); |
|
62 | + // Change username |
|
63 | + if ($form_username !== Auth::user()->getUserName()) { |
|
64 | + Log::addAuthenticationLog('User ' . Auth::user()->getUserName() . ' renamed to ' . $form_username); |
|
65 | + Auth::user()->setUserName($form_username); |
|
66 | + } |
|
67 | + |
|
68 | + // Change password |
|
69 | + if ($form_pass1 && $form_pass1 === $form_pass2) { |
|
70 | + Auth::user()->setPassword($form_pass1); |
|
71 | + } |
|
72 | + |
|
73 | + // Change other settings |
|
74 | + Auth::user() |
|
75 | + ->setRealName($form_realname) |
|
76 | + ->setEmail($form_email) |
|
77 | + ->setPreference('language', $form_language) |
|
78 | + ->setPreference('TIMEZONE', $form_timezone) |
|
79 | + ->setPreference('contactmethod', $form_contact_method) |
|
80 | + ->setPreference('visibleonline', $form_visible_online ? '1' : '0'); |
|
81 | + |
|
82 | + if ($form_theme === null) { |
|
83 | + Auth::user()->deletePreference('theme'); |
|
84 | + } else { |
|
85 | + Auth::user()->setPreference('theme', $form_theme); |
|
86 | + } |
|
87 | + |
|
88 | + $WT_TREE->setUserPreference(Auth::user(), 'rootid', $form_rootid); |
|
86 | 89 | } |
87 | - |
|
88 | - $WT_TREE->setUserPreference(Auth::user(), 'rootid', $form_rootid); |
|
89 | - } |
|
90 | - break; |
|
91 | - |
|
92 | - case 'delete': |
|
93 | - // An administrator can only be deleted by another administrator |
|
94 | - if (!Auth::user()->getPreference('canadmin')) { |
|
95 | - // Keep a reference to the currently logged in user because after logging out this user, |
|
96 | - // a call to Auth::user() will not return this user anymore |
|
97 | - $currentUser = Auth::user(); |
|
98 | - Auth::logout(); |
|
99 | - $currentUser->delete(); |
|
100 | - } |
|
101 | - break; |
|
90 | + break; |
|
91 | + |
|
92 | + case 'delete': |
|
93 | + // An administrator can only be deleted by another administrator |
|
94 | + if (!Auth::user()->getPreference('canadmin')) { |
|
95 | + // Keep a reference to the currently logged in user because after logging out this user, |
|
96 | + // a call to Auth::user() will not return this user anymore |
|
97 | + $currentUser = Auth::user(); |
|
98 | + Auth::logout(); |
|
99 | + $currentUser->delete(); |
|
100 | + } |
|
101 | + break; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME); |