From a1485213e448e2a1ff9dc2cbd6597e018d13a4df Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 18 Feb 2007 04:46:22 +0000 Subject: [PATCH] Remove Z.Items.search(), which is no longer used Removed unnecessary debug output when a collection has no children --- chrome/content/zotero/xpcom/data_access.js | 36 ---------------------- 1 file changed, 36 deletions(-) diff --git a/chrome/content/zotero/xpcom/data_access.js b/chrome/content/zotero/xpcom/data_access.js index 24942cf29..1c83f82de 100644 --- a/chrome/content/zotero/xpcom/data_access.js +++ b/chrome/content/zotero/xpcom/data_access.js @@ -2219,7 +2219,6 @@ Zotero.Items = new function(){ this.reload = reload; this.reloadAll = reloadAll; this.getNewItemByType = getNewItemByType; - this.search = search; this.erase = erase; this.unload = unload; @@ -2336,37 +2335,6 @@ Zotero.Items = new function(){ } - /** - * Fulltext search on all fields - * - * TODO: more - **/ - function search(text, parentCollectionID){ - if (!text){ - text = ''; - } - - var sql = "SELECT itemID FROM items WHERE title LIKE ?1 UNION " - + "SELECT itemID FROM itemData WHERE value LIKE ?1 UNION " - + "SELECT itemID FROM itemCreators WHERE creatorID IN " - + "(SELECT creatorID FROM creators WHERE firstName LIKE ?1 " - + "OR lastName LIKE ?1) UNION " - + "SELECT itemID FROM itemTags WHERE tagID IN " - + "(SELECT tagID FROM tags WHERE tag LIKE ?1) UNION " - + "SELECT itemID FROM itemNotes WHERE note LIKE ?1"; - - var sqlParams = [{'string':'%' + text + '%'}]; - - if (parentCollectionID){ - sql = "SELECT itemID FROM (" + sql + ") WHERE itemID IN " - + "(SELECT itemID FROM collectionItems WHERE collectionID=?2)"; - sqlParams.push({'int':parentCollectionID}); - } - - return Zotero.DB.columnQuery(sql, sqlParams); - } - - /** * Delete item(s) from database and clear from internal array * @@ -2416,7 +2384,6 @@ Zotero.Items = new function(){ if (arguments[0]){ sql += ' AND I.itemID IN (' + Zotero.join(arguments,',') + ')'; } - var result = Zotero.DB.query(sql); if (result){ @@ -2821,9 +2788,6 @@ Zotero.Collection.prototype._loadChildItems = function(){ this._childItems.set(itemIDs[i]); } } - else { - Zotero.debug('Collection ' + this._id + ' has no child items'); - } this._childItemsLoaded = true; }