Completed
Push — 1.7 ( ce7091...0d97cf )
by Greg
14:14 queued 07:41
created
app/Database.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,8 +85,7 @@
 block discarded – undo
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(
Please login to merge, or discard this patch.
app/Report/ReportParserGenerate.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2743,7 +2743,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Switch Indentation   +332 added lines, -332 removed lines patch added patch discarded remove patch
@@ -934,14 +934,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
-								}
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
1942
-					}
1943
-				}
1944
-			}
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
-								}
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
-							}
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
2020
-					}
2021
-				}
2022
-			}
2023
-
2024
-			$this->list = array();
2025
-			$rows       = Database::prepare(
2026
-				$sql_select . $sql_join . $sql_where . $sql_order_by
2027
-			)->execute($sql_params)->fetchAll();
2028
-
2029
-			foreach ($rows as $row) {
2030
-				$this->list[$row->xref] = Family::getInstance($row->xref, $WT_TREE, $row->gedcom);
2031
-			}
2032
-			break;
2033
-
2034
-		default:
2035
-			throw new \DomainException('Invalid list name: ' . $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
+								    }
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
1942
+					    }
1943
+				    }
1944
+			    }
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
+								    }
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
+							    }
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
2020
+					    }
2021
+				    }
2022
+			    }
2023
+
2024
+			    $this->list = array();
2025
+			    $rows       = Database::prepare(
2026
+				    $sql_select . $sql_join . $sql_where . $sql_order_by
2027
+			    )->execute($sql_params)->fetchAll();
2028
+
2029
+			    foreach ($rows as $row) {
2030
+				    $this->list[$row->xref] = Family::getInstance($row->xref, $WT_TREE, $row->gedcom);
2031
+			    }
2032
+			    break;
2033
+
2034
+		    default:
2035
+			    throw new \DomainException('Invalid list name: ' . $listname);
2036 2036
 		}
2037 2037
 
2038 2038
 		$filters  = array();
@@ -2093,17 +2093,17 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
2370
-						}
2371
-					}
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;
2388
-						}
2389
-					}
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;
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
+						    }
2371
+					    }
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;
2388
+						    }
2389
+					    }
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;
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;
2429
-					}
2430
-				}
2431
-				$genCounter++;
2432
-			}
2433
-			$this->list = $newarray;
2434
-			break;
2435
-		default:
2436
-			// unsorted
2437
-			break;
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
+					    }
2430
+				    }
2431
+				    $genCounter++;
2432
+			    }
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;
Please login to merge, or discard this patch.
app/GedcomCode/GedcomCodeTemp.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,14 +57,14 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Switch Indentation   +312 added lines, -312 removed lines patch added patch discarded remove patch
@@ -77,318 +77,318 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
edituser.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
Switch Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -53,52 +53,52 @@
 block discarded – undo
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');
84
-			} else {
85
-				Auth::user()->setPreference('theme', $form_theme);
86
-			}
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;
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');
84
+			    } else {
85
+				    Auth::user()->setPreference('theme', $form_theme);
86
+			    }
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;
102 102
 	}
103 103
 
104 104
 	header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
Please login to merge, or discard this patch.
app/Functions/FunctionsPrintLists.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1820,24 +1820,24 @@
 block discarded – undo
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
 			}
Please login to merge, or discard this patch.
Switch Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -1572,37 +1572,37 @@  discard block
 block discarded – undo
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);
1601
-				}
1602
-			}
1603
-			$html2 .= '</td></tr></table>';
1604
-
1605
-			return $html2;
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);
1601
+				    }
1602
+			    }
1603
+			    $html2 .= '</td></tr></table>';
1604
+
1605
+			    return $html2;
1606 1606
 		}
1607 1607
 	}
1608 1608
 	/**
@@ -1783,14 +1783,14 @@  discard block
 block discarded – undo
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) {
Please login to merge, or discard this patch.
app/Family.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
admin_trees_renumber.php 1 patch
Switch Indentation   +137 added lines, -137 removed lines patch added patch discarded remove patch
@@ -86,143 +86,143 @@
 block discarded – undo
86 86
 		);
87 87
 		$new_xref = $WT_TREE->getNewXref($type);
88 88
 		switch ($type) {
89
-		case 'INDI':
90
-			Database::prepare(
91
-				"UPDATE `##individuals` SET i_id = ?, i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_id = ? AND i_file = ?"
92
-			)->execute(array($new_xref, "0 @$old_xref@ INDI\n", "0 @$new_xref@ INDI\n", $old_xref, $WT_TREE->getTreeId()));
93
-			Database::prepare(
94
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'HUSB') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
95
-			)->execute(array($old_xref, " HUSB @$old_xref@", " HUSB @$new_xref@", $WT_TREE->getTreeId()));
96
-			Database::prepare(
97
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'WIFE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
98
-			)->execute(array($old_xref, " WIFE @$old_xref@", " WIFE @$new_xref@", $WT_TREE->getTreeId()));
99
-			Database::prepare(
100
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'CHIL') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
101
-			)->execute(array($old_xref, " CHIL @$old_xref@", " CHIL @$new_xref@", $WT_TREE->getTreeId()));
102
-			Database::prepare(
103
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'ASSO') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
104
-			)->execute(array($old_xref, " ASSO @$old_xref@", " ASSO @$new_xref@", $WT_TREE->getTreeId()));
105
-			Database::prepare(
106
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = '_ASSO') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
107
-			)->execute(array($old_xref, " _ASSO @$old_xref@", " _ASSO @$new_xref@", $WT_TREE->getTreeId()));
108
-			Database::prepare(
109
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'ASSO') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
110
-			)->execute(array($old_xref, " ASSO @$old_xref@", " ASSO @$new_xref@", $WT_TREE->getTreeId()));
111
-			Database::prepare(
112
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = '_ASSO') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
113
-			)->execute(array($old_xref, " _ASSO @$old_xref@", " _ASSO @$new_xref@", $WT_TREE->getTreeId()));
114
-			Database::prepare(
115
-				"UPDATE `##placelinks` SET pl_gid = ? WHERE pl_gid = ? AND pl_file = ?"
116
-			)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
117
-			Database::prepare(
118
-				"UPDATE `##dates` SET d_gid = ? WHERE d_gid = ? AND d_file = ?"
119
-			)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
120
-			Database::prepare(
121
-				"UPDATE `##user_gedcom_setting` SET setting_value = ? WHERE setting_value = ? AND gedcom_id = ? AND setting_name IN ('gedcomid', 'rootid')"
122
-			)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
123
-			break;
124
-		case 'FAM':
125
-			Database::prepare(
126
-				"UPDATE `##families` SET f_id = ?, f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_id = ? AND f_file = ?"
127
-			)->execute(array($new_xref, "0 @$old_xref@ FAM\n", "0 @$new_xref@ FAM\n", $old_xref, $WT_TREE->getTreeId()));
128
-			Database::prepare(
129
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'FAMC') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
130
-			)->execute(array($old_xref, " FAMC @$old_xref@", " FAMC @$new_xref@", $WT_TREE->getTreeId()));
131
-			Database::prepare(
132
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'FAMS') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
133
-			)->execute(array($old_xref, " FAMS @$old_xref@", " FAMS @$new_xref@", $WT_TREE->getTreeId()));
134
-			Database::prepare(
135
-				"UPDATE `##placelinks` SET pl_gid = ? WHERE pl_gid = ? AND pl_file = ?"
136
-			)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
137
-			Database::prepare(
138
-				"UPDATE `##dates` SET d_gid = ? WHERE d_gid = ? AND d_file = ?"
139
-			)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
140
-			break;
141
-		case 'SOUR':
142
-			Database::prepare(
143
-				"UPDATE `##sources` SET s_id = ?, s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_id = ? AND s_file = ?"
144
-			)->execute(array($new_xref, "0 @$old_xref@ SOUR\n", "0 @$new_xref@ SOUR\n", $old_xref, $WT_TREE->getTreeId()));
145
-			Database::prepare(
146
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'SOUR') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
147
-			)->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
148
-			Database::prepare(
149
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'SOUR') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
150
-			)->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
151
-			Database::prepare(
152
-				"UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ? AND l_type = 'SOUR') SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
153
-			)->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
154
-			Database::prepare(
155
-				"UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ? AND l_type = 'SOUR') SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
156
-			)->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
157
-			break;
158
-		case 'REPO':
159
-			Database::prepare(
160
-				"UPDATE `##other` SET o_id = ?, o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_id = ? AND o_file = ?"
161
-			)->execute(array($new_xref, "0 @$old_xref@ REPO\n", "0 @$new_xref@ REPO\n", $old_xref, $WT_TREE->getTreeId()));
162
-			Database::prepare(
163
-				"UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ? AND l_type = 'REPO') SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
164
-			)->execute(array($old_xref, " REPO @$old_xref@", " REPO @$new_xref@", $WT_TREE->getTreeId()));
165
-			break;
166
-		case 'NOTE':
167
-			Database::prepare(
168
-				"UPDATE `##other` SET o_id = ?, o_gedcom = REPLACE(REPLACE(o_gedcom, ?, ?), ?, ?) WHERE o_id = ? AND o_file = ?"
169
-			)->execute(array($new_xref, "0 @$old_xref@ NOTE\n", "0 @$new_xref@ NOTE\n", "0 @$old_xref@ NOTE ", "0 @$new_xref@ NOTE ", $old_xref, $WT_TREE->getTreeId()));
170
-			Database::prepare(
171
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'NOTE') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
172
-			)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
173
-			Database::prepare(
174
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'NOTE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
175
-			)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
176
-			Database::prepare(
177
-				"UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ? AND l_type = 'NOTE') SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
178
-			)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
179
-			Database::prepare(
180
-				"UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ? AND l_type = 'NOTE') SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
181
-			)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
182
-			Database::prepare(
183
-				"UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ? AND l_type = 'NOTE') SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
184
-			)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
185
-			break;
186
-		case 'OBJE':
187
-			Database::prepare(
188
-				"UPDATE `##media` SET m_id = ?, m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_id = ? AND m_file = ?"
189
-			)->execute(array($new_xref, "0 @$old_xref@ OBJE\n", "0 @$new_xref@ OBJE\n", $old_xref, $WT_TREE->getTreeId()));
190
-			Database::prepare(
191
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'OBJE') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
192
-			)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
193
-			Database::prepare(
194
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'OBJE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
195
-			)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
196
-			Database::prepare(
197
-				"UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ? AND l_type = 'OBJE') SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
198
-			)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
199
-			Database::prepare(
200
-				"UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ? AND l_type = 'OBJE') SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
201
-			)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
202
-			Database::prepare(
203
-				"UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ? AND l_type = 'OBJE') SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
204
-			)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
205
-			break;
206
-		default:
207
-			Database::prepare(
208
-				"UPDATE `##other` SET o_id = ?, o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_id = ? AND o_file = ?"
209
-			)->execute(array($new_xref, "0 @$old_xref@ $type\n", "0 @$new_xref@ $type\n", $old_xref, $WT_TREE->getTreeId()));
210
-			Database::prepare(
211
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ?) SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
212
-			)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
213
-			Database::prepare(
214
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ?) SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
215
-			)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
216
-			Database::prepare(
217
-				"UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ?) SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
218
-			)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
219
-			Database::prepare(
220
-				"UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ?) SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
221
-			)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
222
-			Database::prepare(
223
-				"UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ?) SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
224
-			)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
225
-			break;
89
+		    case 'INDI':
90
+			    Database::prepare(
91
+				    "UPDATE `##individuals` SET i_id = ?, i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_id = ? AND i_file = ?"
92
+			    )->execute(array($new_xref, "0 @$old_xref@ INDI\n", "0 @$new_xref@ INDI\n", $old_xref, $WT_TREE->getTreeId()));
93
+			    Database::prepare(
94
+				    "UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'HUSB') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
95
+			    )->execute(array($old_xref, " HUSB @$old_xref@", " HUSB @$new_xref@", $WT_TREE->getTreeId()));
96
+			    Database::prepare(
97
+				    "UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'WIFE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
98
+			    )->execute(array($old_xref, " WIFE @$old_xref@", " WIFE @$new_xref@", $WT_TREE->getTreeId()));
99
+			    Database::prepare(
100
+				    "UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'CHIL') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
101
+			    )->execute(array($old_xref, " CHIL @$old_xref@", " CHIL @$new_xref@", $WT_TREE->getTreeId()));
102
+			    Database::prepare(
103
+				    "UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'ASSO') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
104
+			    )->execute(array($old_xref, " ASSO @$old_xref@", " ASSO @$new_xref@", $WT_TREE->getTreeId()));
105
+			    Database::prepare(
106
+				    "UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = '_ASSO') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
107
+			    )->execute(array($old_xref, " _ASSO @$old_xref@", " _ASSO @$new_xref@", $WT_TREE->getTreeId()));
108
+			    Database::prepare(
109
+				    "UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'ASSO') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
110
+			    )->execute(array($old_xref, " ASSO @$old_xref@", " ASSO @$new_xref@", $WT_TREE->getTreeId()));
111
+			    Database::prepare(
112
+				    "UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = '_ASSO') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
113
+			    )->execute(array($old_xref, " _ASSO @$old_xref@", " _ASSO @$new_xref@", $WT_TREE->getTreeId()));
114
+			    Database::prepare(
115
+				    "UPDATE `##placelinks` SET pl_gid = ? WHERE pl_gid = ? AND pl_file = ?"
116
+			    )->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
117
+			    Database::prepare(
118
+				    "UPDATE `##dates` SET d_gid = ? WHERE d_gid = ? AND d_file = ?"
119
+			    )->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
120
+			    Database::prepare(
121
+				    "UPDATE `##user_gedcom_setting` SET setting_value = ? WHERE setting_value = ? AND gedcom_id = ? AND setting_name IN ('gedcomid', 'rootid')"
122
+			    )->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
123
+			    break;
124
+		    case 'FAM':
125
+			    Database::prepare(
126
+				    "UPDATE `##families` SET f_id = ?, f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_id = ? AND f_file = ?"
127
+			    )->execute(array($new_xref, "0 @$old_xref@ FAM\n", "0 @$new_xref@ FAM\n", $old_xref, $WT_TREE->getTreeId()));
128
+			    Database::prepare(
129
+				    "UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'FAMC') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
130
+			    )->execute(array($old_xref, " FAMC @$old_xref@", " FAMC @$new_xref@", $WT_TREE->getTreeId()));
131
+			    Database::prepare(
132
+				    "UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'FAMS') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
133
+			    )->execute(array($old_xref, " FAMS @$old_xref@", " FAMS @$new_xref@", $WT_TREE->getTreeId()));
134
+			    Database::prepare(
135
+				    "UPDATE `##placelinks` SET pl_gid = ? WHERE pl_gid = ? AND pl_file = ?"
136
+			    )->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
137
+			    Database::prepare(
138
+				    "UPDATE `##dates` SET d_gid = ? WHERE d_gid = ? AND d_file = ?"
139
+			    )->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
140
+			    break;
141
+		    case 'SOUR':
142
+			    Database::prepare(
143
+				    "UPDATE `##sources` SET s_id = ?, s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_id = ? AND s_file = ?"
144
+			    )->execute(array($new_xref, "0 @$old_xref@ SOUR\n", "0 @$new_xref@ SOUR\n", $old_xref, $WT_TREE->getTreeId()));
145
+			    Database::prepare(
146
+				    "UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'SOUR') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
147
+			    )->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
148
+			    Database::prepare(
149
+				    "UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'SOUR') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
150
+			    )->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
151
+			    Database::prepare(
152
+				    "UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ? AND l_type = 'SOUR') SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
153
+			    )->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
154
+			    Database::prepare(
155
+				    "UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ? AND l_type = 'SOUR') SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
156
+			    )->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
157
+			    break;
158
+		    case 'REPO':
159
+			    Database::prepare(
160
+				    "UPDATE `##other` SET o_id = ?, o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_id = ? AND o_file = ?"
161
+			    )->execute(array($new_xref, "0 @$old_xref@ REPO\n", "0 @$new_xref@ REPO\n", $old_xref, $WT_TREE->getTreeId()));
162
+			    Database::prepare(
163
+				    "UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ? AND l_type = 'REPO') SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
164
+			    )->execute(array($old_xref, " REPO @$old_xref@", " REPO @$new_xref@", $WT_TREE->getTreeId()));
165
+			    break;
166
+		    case 'NOTE':
167
+			    Database::prepare(
168
+				    "UPDATE `##other` SET o_id = ?, o_gedcom = REPLACE(REPLACE(o_gedcom, ?, ?), ?, ?) WHERE o_id = ? AND o_file = ?"
169
+			    )->execute(array($new_xref, "0 @$old_xref@ NOTE\n", "0 @$new_xref@ NOTE\n", "0 @$old_xref@ NOTE ", "0 @$new_xref@ NOTE ", $old_xref, $WT_TREE->getTreeId()));
170
+			    Database::prepare(
171
+				    "UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'NOTE') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
172
+			    )->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
173
+			    Database::prepare(
174
+				    "UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'NOTE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
175
+			    )->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
176
+			    Database::prepare(
177
+				    "UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ? AND l_type = 'NOTE') SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
178
+			    )->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
179
+			    Database::prepare(
180
+				    "UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ? AND l_type = 'NOTE') SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
181
+			    )->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
182
+			    Database::prepare(
183
+				    "UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ? AND l_type = 'NOTE') SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
184
+			    )->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
185
+			    break;
186
+		    case 'OBJE':
187
+			    Database::prepare(
188
+				    "UPDATE `##media` SET m_id = ?, m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_id = ? AND m_file = ?"
189
+			    )->execute(array($new_xref, "0 @$old_xref@ OBJE\n", "0 @$new_xref@ OBJE\n", $old_xref, $WT_TREE->getTreeId()));
190
+			    Database::prepare(
191
+				    "UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'OBJE') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
192
+			    )->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
193
+			    Database::prepare(
194
+				    "UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'OBJE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
195
+			    )->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
196
+			    Database::prepare(
197
+				    "UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ? AND l_type = 'OBJE') SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
198
+			    )->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
199
+			    Database::prepare(
200
+				    "UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ? AND l_type = 'OBJE') SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
201
+			    )->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
202
+			    Database::prepare(
203
+				    "UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ? AND l_type = 'OBJE') SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
204
+			    )->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
205
+			    break;
206
+		    default:
207
+			    Database::prepare(
208
+				    "UPDATE `##other` SET o_id = ?, o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_id = ? AND o_file = ?"
209
+			    )->execute(array($new_xref, "0 @$old_xref@ $type\n", "0 @$new_xref@ $type\n", $old_xref, $WT_TREE->getTreeId()));
210
+			    Database::prepare(
211
+				    "UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ?) SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
212
+			    )->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
213
+			    Database::prepare(
214
+				    "UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ?) SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
215
+			    )->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
216
+			    Database::prepare(
217
+				    "UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ?) SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
218
+			    )->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
219
+			    Database::prepare(
220
+				    "UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ?) SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
221
+			    )->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
222
+			    Database::prepare(
223
+				    "UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ?) SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
224
+			    )->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
225
+			    break;
226 226
 		}
227 227
 		Database::prepare(
228 228
 			"UPDATE `##name` SET n_id = ? WHERE n_id = ? AND n_file = ?"
Please login to merge, or discard this patch.
editnews.php 1 patch
Switch Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -44,44 +44,44 @@
 block discarded – undo
44 44
 $text      = Filter::post('text');
45 45
 
46 46
 switch ($action) {
47
-case 'compose':
48
-	if (Module::getModuleByName('ckeditor')) {
49
-		CkeditorModule::enableEditor($controller);
50
-	}
47
+    case 'compose':
48
+	    if (Module::getModuleByName('ckeditor')) {
49
+		    CkeditorModule::enableEditor($controller);
50
+	    }
51 51
 
52
-	echo '<h3>' . I18N::translate('Add/edit a journal/news entry') . '</h3>';
53
-	echo '<form style="overflow: hidden;" name="messageform" method="post" action="editnews.php?action=save&news_id=' . $news_id . '">';
54
-	if ($news_id) {
55
-		$news = Database::prepare("SELECT news_id AS id, user_id, gedcom_id, UNIX_TIMESTAMP(updated) AS date, subject, body FROM `##news` WHERE news_id=?")->execute(array($news_id))->fetchOneRow(PDO::FETCH_ASSOC);
56
-	} else {
57
-		$news              = array();
58
-		$news['user_id']   = $user_id;
59
-		$news['gedcom_id'] = $gedcom_id;
60
-		$news['date']      = WT_TIMESTAMP;
61
-		$news['subject']   = '';
62
-		$news['body']      = '';
63
-	}
64
-	echo '<input type="hidden" name="user_id" value="' . $news['user_id'] . '">';
65
-	echo '<input type="hidden" name="gedcom_id" value="' . $news['gedcom_id'] . '">';
66
-	echo '<input type="hidden" name="date" value="' . $news['date'] . '">';
67
-	echo '<table>';
68
-	echo '<tr><th style="text-align:start;">' . I18N::translate('Title') . '</th><tr>';
69
-	echo '<tr><td><input type="text" name="title" size="50" dir="auto" autofocus value="' . $news['subject'] . '"></td></tr>';
70
-	echo '<tr><th style="text-align:start;">' . I18N::translate('Content') . '</th></tr>';
71
-	echo '<tr><td>';
72
-	echo '<textarea name="text" class="html-edit" cols="80" rows="10" dir="auto">' . Filter::escapeHtml($news['body']) . '</textarea>';
73
-	echo '</td></tr>';
74
-	echo '<tr><td><input type="submit" value="' . I18N::translate('save') . '"></td></tr>';
75
-	echo '</table>';
76
-	echo '</form>';
77
-	break;
78
-case 'save':
79
-	if ($news_id) {
80
-		Database::prepare("UPDATE `##news` SET subject=?, body=?, updated=FROM_UNIXTIME(?) WHERE news_id=?")->execute(array($title, $text, $date, $news_id));
81
-	} else {
82
-		Database::prepare("INSERT INTO `##news` (user_id, gedcom_id, subject, body, updated) VALUES (NULLIF(?, ''), NULLIF(?, '') ,? ,?, CURRENT_TIMESTAMP)")->execute(array($user_id, $gedcom_id, $title, $text));
83
-	}
52
+	    echo '<h3>' . I18N::translate('Add/edit a journal/news entry') . '</h3>';
53
+	    echo '<form style="overflow: hidden;" name="messageform" method="post" action="editnews.php?action=save&news_id=' . $news_id . '">';
54
+	    if ($news_id) {
55
+		    $news = Database::prepare("SELECT news_id AS id, user_id, gedcom_id, UNIX_TIMESTAMP(updated) AS date, subject, body FROM `##news` WHERE news_id=?")->execute(array($news_id))->fetchOneRow(PDO::FETCH_ASSOC);
56
+	    } else {
57
+		    $news              = array();
58
+		    $news['user_id']   = $user_id;
59
+		    $news['gedcom_id'] = $gedcom_id;
60
+		    $news['date']      = WT_TIMESTAMP;
61
+		    $news['subject']   = '';
62
+		    $news['body']      = '';
63
+	    }
64
+	    echo '<input type="hidden" name="user_id" value="' . $news['user_id'] . '">';
65
+	    echo '<input type="hidden" name="gedcom_id" value="' . $news['gedcom_id'] . '">';
66
+	    echo '<input type="hidden" name="date" value="' . $news['date'] . '">';
67
+	    echo '<table>';
68
+	    echo '<tr><th style="text-align:start;">' . I18N::translate('Title') . '</th><tr>';
69
+	    echo '<tr><td><input type="text" name="title" size="50" dir="auto" autofocus value="' . $news['subject'] . '"></td></tr>';
70
+	    echo '<tr><th style="text-align:start;">' . I18N::translate('Content') . '</th></tr>';
71
+	    echo '<tr><td>';
72
+	    echo '<textarea name="text" class="html-edit" cols="80" rows="10" dir="auto">' . Filter::escapeHtml($news['body']) . '</textarea>';
73
+	    echo '</td></tr>';
74
+	    echo '<tr><td><input type="submit" value="' . I18N::translate('save') . '"></td></tr>';
75
+	    echo '</table>';
76
+	    echo '</form>';
77
+	    break;
78
+    case 'save':
79
+	    if ($news_id) {
80
+		    Database::prepare("UPDATE `##news` SET subject=?, body=?, updated=FROM_UNIXTIME(?) WHERE news_id=?")->execute(array($title, $text, $date, $news_id));
81
+	    } else {
82
+		    Database::prepare("INSERT INTO `##news` (user_id, gedcom_id, subject, body, updated) VALUES (NULLIF(?, ''), NULLIF(?, '') ,? ,?, CURRENT_TIMESTAMP)")->execute(array($user_id, $gedcom_id, $title, $text));
83
+	    }
84 84
 
85
-	$controller->addInlineJavascript('window.opener.location.reload();window.close();');
86
-	break;
85
+	    $controller->addInlineJavascript('window.opener.location.reload();window.close();');
86
+	    break;
87 87
 }
Please login to merge, or discard this patch.
includes/session.php 1 patch
Switch Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -200,29 +200,29 @@  discard block
 block discarded – undo
200 200
 		$frame += array('args' => array(), 'file' => 'unknown', 'line' => 'unknown');
201 201
 		array_walk($frame['args'], function (&$arg) {
202 202
 			switch (gettype($arg)) {
203
-			case 'boolean':
204
-			case 'integer':
205
-			case 'double':
206
-			case 'null':
207
-				$arg = var_export($arg, true);
208
-				break;
209
-			case 'string':
210
-				if (mb_strlen($arg) > 30) {
211
-					$arg = substr($arg, 0, 30) . '…';
212
-				}
213
-				$arg = var_export($arg, true);
214
-				break;
215
-			case 'object':
216
-				$reflection = new \ReflectionClass($arg);
217
-				if (is_object($arg) && method_exists($arg, '__toString')) {
218
-					$arg = '[' . $reflection->getShortName() . ' ' . (string) $arg . ']';
219
-				} else {
220
-					$arg = '[' . $reflection->getShortName() . ']';
221
-				}
222
-				break;
223
-			default:
224
-				$arg = '[' . gettype($arg) . ']';
225
-				break;
203
+			    case 'boolean':
204
+			    case 'integer':
205
+			    case 'double':
206
+			    case 'null':
207
+				    $arg = var_export($arg, true);
208
+				    break;
209
+			    case 'string':
210
+				    if (mb_strlen($arg) > 30) {
211
+					    $arg = substr($arg, 0, 30) . '…';
212
+				    }
213
+				    $arg = var_export($arg, true);
214
+				    break;
215
+			    case 'object':
216
+				    $reflection = new \ReflectionClass($arg);
217
+				    if (is_object($arg) && method_exists($arg, '__toString')) {
218
+					    $arg = '[' . $reflection->getShortName() . ' ' . (string) $arg . ']';
219
+				    } else {
220
+					    $arg = '[' . $reflection->getShortName() . ']';
221
+				    }
222
+				    break;
223
+			    default:
224
+				    $arg = '[' . gettype($arg) . ']';
225
+				    break;
226 226
 			}
227 227
 		});
228 228
 		$frame['file'] = str_replace(dirname(__DIR__), '', $frame['file']);
@@ -319,25 +319,25 @@  discard block
 block discarded – undo
319 319
 )->execute(array(WT_CLIENT_IP, Filter::server('HTTP_USER_AGENT', null, '')))->fetchOne();
320 320
 
321 321
 switch ($rule) {
322
-case 'allow':
323
-	$SEARCH_SPIDER = false;
324
-	break;
325
-case 'deny':
326
-	http_response_code(403);
327
-	exit;
328
-case 'robot':
329
-case 'unknown':
330
-	// Search engines don’t send cookies, and so create a new session with every visit.
331
-	// Make sure they always use the same one
332
-	Session::setId('search-engine-' . str_replace('.', '-', WT_CLIENT_IP));
333
-	$SEARCH_SPIDER = true;
334
-	break;
335
-case '':
336
-	Database::prepare(
337
-		"INSERT INTO `##site_access_rule` (ip_address_start, ip_address_end, user_agent_pattern, comment) VALUES (IFNULL(INET_ATON(?), 0), IFNULL(INET_ATON(?), 4294967295), ?, '')"
338
-	)->execute(array(WT_CLIENT_IP, WT_CLIENT_IP, Filter::server('HTTP_USER_AGENT', null, '')));
339
-	$SEARCH_SPIDER = true;
340
-	break;
322
+    case 'allow':
323
+	    $SEARCH_SPIDER = false;
324
+	    break;
325
+    case 'deny':
326
+	    http_response_code(403);
327
+	    exit;
328
+    case 'robot':
329
+    case 'unknown':
330
+	    // Search engines don’t send cookies, and so create a new session with every visit.
331
+	    // Make sure they always use the same one
332
+	    Session::setId('search-engine-' . str_replace('.', '-', WT_CLIENT_IP));
333
+	    $SEARCH_SPIDER = true;
334
+	    break;
335
+    case '':
336
+	    Database::prepare(
337
+		    "INSERT INTO `##site_access_rule` (ip_address_start, ip_address_end, user_agent_pattern, comment) VALUES (IFNULL(INET_ATON(?), 0), IFNULL(INET_ATON(?), 4294967295), ?, '')"
338
+	    )->execute(array(WT_CLIENT_IP, WT_CLIENT_IP, Filter::server('HTTP_USER_AGENT', null, '')));
339
+	    $SEARCH_SPIDER = true;
340
+	    break;
341 341
 }
342 342
 
343 343
 // Store our session data in the database.
Please login to merge, or discard this patch.