Commit 7ace5f30 authored by Penny Leach's avatar Penny Leach
Browse files

renamed prefname -> preferredname in search

parent e56aab83
...@@ -45,22 +45,22 @@ class PluginSearchInternal extends PluginSearch { ...@@ -45,22 +45,22 @@ class PluginSearchInternal extends PluginSearch {
* offset => integer, // starting from which result * offset => integer, // starting from which result
* results => array( // the result records * results => array( // the result records
* array( * array(
* id => integer, * id => integer,
* username => string, * username => string,
* institution => string, * institution => string,
* firstname => string, * firstname => string,
* lastname => string, * lastname => string,
* prefname => string, * preferredname => string,
* email => string, * email => string,
* ), * ),
* array( * array(
* id => integer, * id => integer,
* username => string, * username => string,
* institution => string, * institution => string,
* firstname => string, * firstname => string,
* lastname => string, * lastname => string,
* prefname => string, * preferredname => string,
* email => string, * email => string,
* ), * ),
* array(...), * array(...),
* ), * ),
...@@ -70,13 +70,13 @@ class PluginSearchInternal extends PluginSearch { ...@@ -70,13 +70,13 @@ class PluginSearchInternal extends PluginSearch {
if ( is_postgres() ) { if ( is_postgres() ) {
$data = get_rows_sql(" $data = get_rows_sql("
SELECT SELECT
id, username, institution, firstname, lastname, prefname, email id, username, institution, firstname, lastname, preferredname, email
FROM FROM
" . get_config('dbprefix') . "usr u " . get_config('dbprefix') . "usr u
WHERE WHERE
firstname ILIKE '%' || ? || '%' firstname ILIKE '%' || ? || '%'
OR lastname ILIKE '%' || ? || '%' OR lastname ILIKE '%' || ? || '%'
OR prefname ILIKE '%' || ? || '%' OR preferredname ILIKE '%' || ? || '%'
OR email ILIKE '%' || ? || '%' OR email ILIKE '%' || ? || '%'
", ",
array($query_string, $query_string, $query_string, $query_string), array($query_string, $query_string, $query_string, $query_string),
...@@ -92,7 +92,7 @@ class PluginSearchInternal extends PluginSearch { ...@@ -92,7 +92,7 @@ class PluginSearchInternal extends PluginSearch {
WHERE WHERE
firstname ILIKE '%' || ? || '%' firstname ILIKE '%' || ? || '%'
OR lastname ILIKE '%' || ? || '%' OR lastname ILIKE '%' || ? || '%'
OR prefname ILIKE '%' || ? || '%' OR preferredname ILIKE '%' || ? || '%'
OR email ILIKE '%' || ? || '%' OR email ILIKE '%' || ? || '%'
", ",
array($query_string, $query_string, $query_string, $query_string), array($query_string, $query_string, $query_string, $query_string),
......
...@@ -44,23 +44,24 @@ abstract class PluginSearch { ...@@ -44,23 +44,24 @@ abstract class PluginSearch {
* limit => integer, // how many results are returned * limit => integer, // how many results are returned
* offset => integer, // starting from which result * offset => integer, // starting from which result
* results => array( // the result records * results => array( // the result records
* array( * array(
* id => integer, * id => integer,
* username => string, * username => string,
* institution => string, * institution => string,
* firstname => string, * firstname => string,
* lastname => string, * lastname => string,
* prefname => string, * preferredname => string,
* email => string, * email => string,
* ), * ),
* array( * array(
* id => integer, * id => integer,
* username => string, * username => string,
* institution => string, * institution => string,
* firstname => string, * firstname => string,
* lastname => string, * lastname => string,
* prefname => string, * preferredname => string,
* email => string, * email => string,
* ), * ),
* array(...), * array(...),
* ), * ),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment