Closes #340, Change isInstitution to fieldMode everywhere

Including in the DB, which it turns out isn't really all that bad (thanks, among other things, to SQLite's ability to DROP tables within transactions without autocommitting (which MySQL can't do))
This commit is contained in:
Dan Stillman 2006-10-05 00:59:26 +00:00
parent 74dbdec49b
commit cd26267afe
7 changed files with 50 additions and 50 deletions

View file

@ -150,9 +150,9 @@ ZoteroAutoComplete.prototype.startSearch = function(searchString, searchParam,
if (fieldMode==2)
{
var sql = "SELECT DISTINCT CASE isInstitution WHEN 1 THEN lastName "
var sql = "SELECT DISTINCT CASE fieldMode WHEN 1 THEN lastName "
+ "WHEN 0 THEN firstName || ' ' || lastName END AS name "
+ "FROM creators WHERE CASE isInstitution "
+ "FROM creators WHERE CASE fieldMode "
+ "WHEN 1 THEN lastName "
+ "WHEN 0 THEN firstName || ' ' || lastName END "
+ "LIKE ? ORDER BY name";
@ -181,7 +181,7 @@ ZoteroAutoComplete.prototype.startSearch = function(searchString, searchParam,
}
var fromSQL = " FROM creators WHERE " + searchParts[2]
+ " LIKE ?1 " + "AND isInstitution=?2";
+ " LIKE ?1 " + "AND fieldMode=?2";
var sqlParams = [searchString + '%', parseInt(fieldMode)];
if (itemID){
fromSQL += " AND creatorID NOT IN (SELECT creatorID FROM "