@@ -1847,7 +1847,7 @@ discard block |
||
1847 | 1847 | // Some filters/sorts can be applied using SQL, while others require PHP |
1848 | 1848 | switch ($listname) { |
1849 | 1849 | case 'pending': |
1850 | - $rows = Database::prepare( |
|
1850 | + $rows = Database::prepare( |
|
1851 | 1851 | "SELECT xref, CASE new_gedcom WHEN '' THEN old_gedcom ELSE new_gedcom END AS gedcom" . |
1852 | 1852 | " FROM `##change`" . " WHERE (xref, change_id) IN (" . |
1853 | 1853 | " SELECT xref, MAX(change_id)" . |
@@ -1886,7 +1886,7 @@ discard block |
||
1886 | 1886 | $sql_params[$attr . 'date'] = $date->minimumJulianDay(); |
1887 | 1887 | } |
1888 | 1888 | if ($sortby == $match[1]) { |
1889 | - $sortby = ""; |
|
1889 | + $sortby = ""; |
|
1890 | 1890 | $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.d_julianday1"; |
1891 | 1891 | } |
1892 | 1892 | unset($attrs[$attr]); // This filter has been fully processed |
@@ -1898,13 +1898,13 @@ discard block |
||
1898 | 1898 | if ($match[1] != '') { |
1899 | 1899 | $names = explode(' ', $match[1]); |
1900 | 1900 | foreach ($names as $n => $name) { |
1901 | - $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1901 | + $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1902 | 1902 | $sql_params[$attr . 'name' . $n] = $name; |
1903 | 1903 | } |
1904 | 1904 | } |
1905 | 1905 | // Let the DB do the name sorting even when no name was entered |
1906 | 1906 | if ($sortby == 'NAME') { |
1907 | - $sortby = ''; |
|
1907 | + $sortby = ''; |
|
1908 | 1908 | $sql_order_by .= ($sql_order_by ? ', ' : ' ORDER BY ') . "{$attr}.n_sort"; |
1909 | 1909 | } |
1910 | 1910 | } |
@@ -1921,7 +1921,7 @@ discard block |
||
1921 | 1921 | $sql_params[$attr . 'place'] = $match[1]; |
1922 | 1922 | // Don't unset this filter. This is just initial filtering |
1923 | 1923 | } elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) { |
1924 | - $sql_where .= " AND i_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
1924 | + $sql_where .= " AND i_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
1925 | 1925 | $sql_params[$attr . 'contains1'] = $match[1]; |
1926 | 1926 | $sql_params[$attr . 'contains2'] = $match[2]; |
1927 | 1927 | $sql_params[$attr . 'contains3'] = $match[3]; |
@@ -1963,7 +1963,7 @@ discard block |
||
1963 | 1963 | $sql_params[$attr . 'date'] = $date->minimumJulianDay(); |
1964 | 1964 | } |
1965 | 1965 | if ($sortby == $match[1]) { |
1966 | - $sortby = ''; |
|
1966 | + $sortby = ''; |
|
1967 | 1967 | $sql_order_by .= ($sql_order_by ? ', ' : ' ORDER BY ') . "{$attr}.d_julianday1"; |
1968 | 1968 | } |
1969 | 1969 | unset($attrs[$attr]); // This filter has been fully processed |
@@ -1980,13 +1980,13 @@ discard block |
||
1980 | 1980 | if ($match[1] != '') { |
1981 | 1981 | $names = explode(' ', $match[1]); |
1982 | 1982 | foreach ($names as $n => $name) { |
1983 | - $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1983 | + $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1984 | 1984 | $sql_params[$attr . 'name' . $n] = $name; |
1985 | 1985 | } |
1986 | 1986 | } |
1987 | 1987 | // Let the DB do the name sorting even when no name was entered |
1988 | 1988 | if ($sortby == 'NAME') { |
1989 | - $sortby = ''; |
|
1989 | + $sortby = ''; |
|
1990 | 1990 | $sql_order_by .= ($sql_order_by ? ', ' : ' ORDER BY ') . "{$attr}.n_sort"; |
1991 | 1991 | } |
1992 | 1992 | } |
@@ -1998,7 +1998,7 @@ discard block |
||
1998 | 1998 | $sql_params[$attr . 'place'] = $match[1]; |
1999 | 1999 | // Don't unset this filter. This is just initial filtering |
2000 | 2000 | } elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) { |
2001 | - $sql_where .= " AND f_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
2001 | + $sql_where .= " AND f_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
2002 | 2002 | $sql_params[$attr . 'contains1'] = $match[1]; |
2003 | 2003 | $sql_params[$attr . 'contains2'] = $match[2]; |
2004 | 2004 | $sql_params[$attr . 'contains3'] = $match[3]; |