@@ -85,8 +85,7 @@ |
||
85 | 85 | // Create the underlying PDO object |
86 | 86 | self::$pdo = new PDO( |
87 | 87 | (substr($DBHOST, 0, 1) === '/' ? |
88 | - "mysql:unix_socket={$DBHOST};dbname={$DBNAME}" : |
|
89 | - "mysql:host={$DBHOST};dbname={$DBNAME};port={$DBPORT}" |
|
88 | + "mysql:unix_socket={$DBHOST};dbname={$DBNAME}" : "mysql:host={$DBHOST};dbname={$DBNAME};port={$DBPORT}" |
|
90 | 89 | ), |
91 | 90 | $DBUSER, $DBPASS, |
92 | 91 | array( |
@@ -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 |
@@ -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'); |
@@ -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); |
@@ -1820,24 +1820,24 @@ |
||
1820 | 1820 | if ($endjd === WT_CLIENT_JD) { |
1821 | 1821 | // We're dealing with the Today’s Events block |
1822 | 1822 | if ($filter === 0) { |
1823 | - $html .= I18N::translate('No events exist for today.'); |
|
1823 | + $html .= I18N::translate('No events exist for today.'); |
|
1824 | 1824 | } else { |
1825 | - $html .= I18N::translate('No events for living individuals exist for today.'); |
|
1825 | + $html .= I18N::translate('No events for living individuals exist for today.'); |
|
1826 | 1826 | } |
1827 | 1827 | } else { |
1828 | 1828 | // We're dealing with the Upcoming Events block |
1829 | 1829 | if ($filter === 0) { |
1830 | 1830 | if ($endjd === $startjd) { |
1831 | - $html .= I18N::translate('No events exist for tomorrow.'); |
|
1831 | + $html .= I18N::translate('No events exist for tomorrow.'); |
|
1832 | 1832 | } else { |
1833 | - $html .= /* I18N: translation for %s==1 is unused; it is translated separately as “tomorrow” */ I18N::plural('No events exist for the next %s day.', 'No events exist for the next %s days.', $endjd - $startjd + 1, I18N::number($endjd - $startjd + 1)); |
|
1833 | + $html .= /* I18N: translation for %s==1 is unused; it is translated separately as “tomorrow” */ I18N::plural('No events exist for the next %s day.', 'No events exist for the next %s days.', $endjd - $startjd + 1, I18N::number($endjd - $startjd + 1)); |
|
1834 | 1834 | } |
1835 | 1835 | } else { |
1836 | 1836 | if ($endjd === $startjd) { |
1837 | - $html .= I18N::translate('No events for living individuals exist for tomorrow.'); |
|
1837 | + $html .= I18N::translate('No events for living individuals exist for tomorrow.'); |
|
1838 | 1838 | } else { |
1839 | 1839 | // I18N: translation for %s==1 is unused; it is translated separately as “tomorrow” |
1840 | - $html .= I18N::plural('No events for living people exist for the next %s day.', 'No events for living people exist for the next %s days.', $endjd - $startjd + 1, I18N::number($endjd - $startjd + 1)); |
|
1840 | + $html .= I18N::plural('No events for living people exist for the next %s day.', 'No events for living people exist for the next %s days.', $endjd - $startjd + 1, I18N::number($endjd - $startjd + 1)); |
|
1841 | 1841 | } |
1842 | 1842 | } |
1843 | 1843 | } |
@@ -1572,37 +1572,37 @@ discard block |
||
1572 | 1572 | |
1573 | 1573 | } |
1574 | 1574 | switch ($style) { |
1575 | - case 1: |
|
1576 | - return '<ul><li>' . implode('</li><li>', $html) . '</li></ul>'; |
|
1577 | - case 2: |
|
1578 | - return implode(I18N::$list_separator, $html); |
|
1579 | - case 3: |
|
1580 | - $i = 0; |
|
1581 | - $count = count($html); |
|
1582 | - if ($count > 36) { |
|
1583 | - $col = 4; |
|
1584 | - } elseif ($count > 18) { |
|
1585 | - $col = 3; |
|
1586 | - } elseif ($count > 6) { |
|
1587 | - $col = 2; |
|
1588 | - } else { |
|
1589 | - $col = 1; |
|
1590 | - } |
|
1591 | - $newcol = ceil($count / $col); |
|
1592 | - $html2 = '<table class="list_table"><tr>'; |
|
1593 | - $html2 .= '<td class="list_value" style="padding: 14px;">'; |
|
1594 | - |
|
1595 | - foreach ($html as $surns) { |
|
1596 | - $html2 .= $surns . '<br>'; |
|
1597 | - $i++; |
|
1598 | - if ($i == $newcol && $i < $count) { |
|
1599 | - $html2 .= '</td><td class="list_value" style="padding: 14px;">'; |
|
1600 | - $newcol = $i + ceil($count / $col); |
|
1575 | + case 1: |
|
1576 | + return '<ul><li>' . implode('</li><li>', $html) . '</li></ul>'; |
|
1577 | + case 2: |
|
1578 | + return implode(I18N::$list_separator, $html); |
|
1579 | + case 3: |
|
1580 | + $i = 0; |
|
1581 | + $count = count($html); |
|
1582 | + if ($count > 36) { |
|
1583 | + $col = 4; |
|
1584 | + } elseif ($count > 18) { |
|
1585 | + $col = 3; |
|
1586 | + } elseif ($count > 6) { |
|
1587 | + $col = 2; |
|
1588 | + } else { |
|
1589 | + $col = 1; |
|
1601 | 1590 | } |
1602 | - } |
|
1603 | - $html2 .= '</td></tr></table>'; |
|
1591 | + $newcol = ceil($count / $col); |
|
1592 | + $html2 = '<table class="list_table"><tr>'; |
|
1593 | + $html2 .= '<td class="list_value" style="padding: 14px;">'; |
|
1594 | + |
|
1595 | + foreach ($html as $surns) { |
|
1596 | + $html2 .= $surns . '<br>'; |
|
1597 | + $i++; |
|
1598 | + if ($i == $newcol && $i < $count) { |
|
1599 | + $html2 .= '</td><td class="list_value" style="padding: 14px;">'; |
|
1600 | + $newcol = $i + ceil($count / $col); |
|
1601 | + } |
|
1602 | + } |
|
1603 | + $html2 .= '</td></tr></table>'; |
|
1604 | 1604 | |
1605 | - return $html2; |
|
1605 | + return $html2; |
|
1606 | 1606 | } |
1607 | 1607 | } |
1608 | 1608 | /** |
@@ -1783,14 +1783,14 @@ discard block |
||
1783 | 1783 | |
1784 | 1784 | // Now we've filtered the list, we can sort by event, if required |
1785 | 1785 | switch ($sort_by) { |
1786 | - case 'anniv': |
|
1787 | - // Data is already sorted by anniversary date |
|
1788 | - break; |
|
1789 | - case 'alpha': |
|
1790 | - uasort($filtered_events, function (Fact $x, Fact $y) { |
|
1791 | - return GedcomRecord::compare($x->getParent(), $y->getParent()); |
|
1792 | - }); |
|
1793 | - break; |
|
1786 | + case 'anniv': |
|
1787 | + // Data is already sorted by anniversary date |
|
1788 | + break; |
|
1789 | + case 'alpha': |
|
1790 | + uasort($filtered_events, function (Fact $x, Fact $y) { |
|
1791 | + return GedcomRecord::compare($x->getParent(), $y->getParent()); |
|
1792 | + }); |
|
1793 | + break; |
|
1794 | 1794 | } |
1795 | 1795 | |
1796 | 1796 | foreach ($filtered_events as $fact) { |
@@ -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)) { |
@@ -38,38 +38,38 @@ |
||
38 | 38 | |
39 | 39 | foreach ($facts as $fact) { |
40 | 40 | switch ($fact->getTag()) { |
41 | - case 'ADDR': |
|
42 | - case 'ALIA': |
|
43 | - case 'ASSO': |
|
44 | - case 'CHAN': |
|
45 | - case 'CHIL': |
|
46 | - case 'EMAIL': |
|
47 | - case 'FAMC': |
|
48 | - case 'FAMS': |
|
49 | - case 'HUSB': |
|
50 | - case 'NAME': |
|
51 | - case 'NOTE': |
|
52 | - case 'OBJE': |
|
53 | - case 'PHON': |
|
54 | - case 'RESI': |
|
55 | - case 'RESN': |
|
56 | - case 'SEX': |
|
57 | - case 'SOUR': |
|
58 | - case 'SSN': |
|
59 | - case 'SUBM': |
|
60 | - case 'TITL': |
|
61 | - case 'URL': |
|
62 | - case 'WIFE': |
|
63 | - case 'WWW': |
|
64 | - case '_EMAIL': |
|
65 | - case '_TODO': |
|
66 | - case '_UID': |
|
67 | - case '_WT_OBJE_SORT': |
|
68 | - // Do not show these |
|
69 | - break; |
|
70 | - default: |
|
71 | - // Simple version of FunctionsPrintFacts::print_fact() |
|
72 | - echo $fact->summary(); |
|
73 | - break; |
|
41 | + case 'ADDR': |
|
42 | + case 'ALIA': |
|
43 | + case 'ASSO': |
|
44 | + case 'CHAN': |
|
45 | + case 'CHIL': |
|
46 | + case 'EMAIL': |
|
47 | + case 'FAMC': |
|
48 | + case 'FAMS': |
|
49 | + case 'HUSB': |
|
50 | + case 'NAME': |
|
51 | + case 'NOTE': |
|
52 | + case 'OBJE': |
|
53 | + case 'PHON': |
|
54 | + case 'RESI': |
|
55 | + case 'RESN': |
|
56 | + case 'SEX': |
|
57 | + case 'SOUR': |
|
58 | + case 'SSN': |
|
59 | + case 'SUBM': |
|
60 | + case 'TITL': |
|
61 | + case 'URL': |
|
62 | + case 'WIFE': |
|
63 | + case 'WWW': |
|
64 | + case '_EMAIL': |
|
65 | + case '_TODO': |
|
66 | + case '_UID': |
|
67 | + case '_WT_OBJE_SORT': |
|
68 | + // Do not show these |
|
69 | + break; |
|
70 | + default: |
|
71 | + // Simple version of FunctionsPrintFacts::print_fact() |
|
72 | + echo $fact->summary(); |
|
73 | + break; |
|
74 | 74 | } |
75 | 75 | } |
@@ -131,12 +131,12 @@ |
||
131 | 131 | // Datatables numbers columns 0, 1, 2 |
132 | 132 | // MySQL numbers columns 1, 2, 3 |
133 | 133 | switch ($value['dir']) { |
134 | - case 'asc': |
|
135 | - $order_by .= (1 + $value['column']) . " ASC "; |
|
136 | - break; |
|
137 | - case 'desc': |
|
138 | - $order_by .= (1 + $value['column']) . " DESC "; |
|
139 | - break; |
|
134 | + case 'asc': |
|
135 | + $order_by .= (1 + $value['column']) . " ASC "; |
|
136 | + break; |
|
137 | + case 'desc': |
|
138 | + $order_by .= (1 + $value['column']) . " DESC "; |
|
139 | + break; |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | } else { |
@@ -62,14 +62,14 @@ |
||
62 | 62 | foreach ($record->getFacts() as $fact) { |
63 | 63 | if ($fact->getFactId() == $fact_id) { |
64 | 64 | switch ($fact->getTag()) { |
65 | - case 'NOTE': |
|
66 | - case 'SOUR': |
|
67 | - case 'OBJE': |
|
68 | - $type = 'all'; // paste this anywhere |
|
69 | - break; |
|
70 | - default: |
|
71 | - $type = $record::RECORD_TYPE; // paste only to the same record type |
|
72 | - break; |
|
65 | + case 'NOTE': |
|
66 | + case 'SOUR': |
|
67 | + case 'OBJE': |
|
68 | + $type = 'all'; // paste this anywhere |
|
69 | + break; |
|
70 | + default: |
|
71 | + $type = $record::RECORD_TYPE; // paste only to the same record type |
|
72 | + break; |
|
73 | 73 | } |
74 | 74 | $clipboard = Session::get('clipboard'); |
75 | 75 | if (!is_array($clipboard)) { |