From 58e6f5e07ef004f0546754ae268f10111a662428 Mon Sep 17 00:00:00 2001 From: gracile-fr Date: Fri, 1 Mar 2013 22:26:44 +0100 Subject: [PATCH] Allow searching for dateDecided (case), dateEnacted (statute), issueDate (patent) in the "Title, Creator, Year" quicksearch mode. --- chrome/content/zotero/xpcom/search.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/search.js b/chrome/content/zotero/xpcom/search.js index 3cbdc711d8..ba806734f6 100644 --- a/chrome/content/zotero/xpcom/search.js +++ b/chrome/content/zotero/xpcom/search.js @@ -1197,8 +1197,20 @@ Zotero.Search.prototype._buildQuery = function(){ break; case 'year': - condSQL += 'fieldID IN (?) AND '; condSQLParams.push(Zotero.ItemFields.getID('date')); + //Add base field + var dateFields = Zotero.ItemFields.getTypeFieldsFromBase('date'); + if (dateFields) { + condSQL += 'fieldID IN (?,'; + // Add type-specific date fields (dateEnacted, dateDecided, issueDate) + for each(var fieldID in dateFields) { + condSQL += '?,'; + condSQLParams.push(fieldID); + } + condSQL = condSQL.substr(0, condSQL.length - 1); + condSQL += ') AND '; + } + condSQL += "valueID IN (SELECT valueID FROM " + "itemDataValues WHERE ";