commit 58e6f5e07ef004f0546754ae268f10111a662428
parent 25563d2e046f2402d0867d31abd859e4273fc1c2
Author: gracile-fr <gracile@gmx.com>
Date: Fri, 1 Mar 2013 22:26:44 +0100
Allow searching for dateDecided (case), dateEnacted (statute), issueDate (patent) in the "Title, Creator, Year" quicksearch mode.
Diffstat:
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git 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 ";