From 1be37c6aa764f0f5e636e7dcf884f7ed773abd1d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 16 Feb 2007 08:50:47 +0000 Subject: [PATCH] Don't know if it will stay exposed, but I added a search condition for child notes (e.g. find the parent containing a child matching the specified text) --- chrome/content/zotero/xpcom/search.js | 16 ++++++++++++++++ chrome/locale/en-US/zotero/zotero.properties | 1 + 2 files changed, 17 insertions(+) diff --git a/chrome/content/zotero/xpcom/search.js b/chrome/content/zotero/xpcom/search.js index 7ce06a537..2a0adeb13 100644 --- a/chrome/content/zotero/xpcom/search.js +++ b/chrome/content/zotero/xpcom/search.js @@ -663,6 +663,12 @@ Zotero.Search.prototype._buildQuery = function(){ openParens++; break; + case 'childNote': + condSQL += "itemID IN (SELECT sourceItemID FROM " + + "itemNotes WHERE "; + openParens++; + break; + case 'fulltextWord': condSQL += "wordID IN (SELECT wordID FROM fulltextWords " + "WHERE "; @@ -1168,6 +1174,16 @@ Zotero.SearchConditions = new function(){ field: 'note' }, + { + name: 'childNote', + operators: { + contains: true, + doesNotContain: true + }, + table: 'items', + field: 'note' + }, + { name: 'creator', operators: { diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index c984e83f7..4423d7a21 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -283,6 +283,7 @@ searchConditions.collectionID = Collection searchConditions.itemTypeID = Item Type searchConditions.tag = Tag searchConditions.note = Note +searchConditions.childNote = Child Note searchConditions.creator = Creator searchConditions.thesisType = Thesis Type searchConditions.reportType = Report Type