diff --git a/chrome/chromeFiles/content/scholar/bindings/scholarsearch.xml b/chrome/chromeFiles/content/scholar/bindings/scholarsearch.xml index dd1bb4f18..750a65d4b 100644 --- a/chrome/chromeFiles/content/scholar/bindings/scholarsearch.xml +++ b/chrome/chromeFiles/content/scholar/bindings/scholarsearch.xml @@ -150,7 +150,7 @@ ?'; condSQLParams.push({int:tables[i][j]['value']}); break; - case 'lessThan': - condSQL += '?'; + condSQLParams.push({string:tables[i][j]['value']}); break; } } @@ -503,13 +506,13 @@ Scholar.SearchConditions = new function(){ * Define the advanced search operators */ var _operators = { - // Standard + // Standard -- these need to match those in scholarsearch.xml is: true, isNot: true, contains: true, doesNotContain: true, - lessThan: true, - greaterThan: true, + isLessThan: true, + isGreaterThan: true, isBefore: true, isAfter: true, @@ -595,6 +598,30 @@ Scholar.SearchConditions = new function(){ field: 'title' }, + { + name: 'dateAdded', + operators: { + is: true, + isNot: true, + isBefore: true, + isAfter: true + }, + table: 'items', + field: 'DATE(dateAdded)' + }, + + { + name: 'dateModified', + operators: { + is: true, + isNot: true, + isBefore: true, + isAfter: true + }, + table: 'items', + field: 'DATE(dateModified)' + }, + { name: 'itemTypeID', operators: { @@ -660,7 +687,40 @@ Scholar.SearchConditions = new function(){ }, table: 'itemData', field: 'value', - aliases: Scholar.DB.columnQuery("SELECT fieldName FROM fields"), + aliases: Scholar.DB.columnQuery("SELECT fieldName FROM fields " + + "WHERE fieldName NOT IN ('accessDate', 'date', 'pages', " + + "'section','accessionNumber','seriesNumber','issue')"), + template: true // mark for special handling + }, + + { + name: 'datefield', + operators: { + is: true, + isNot: true, + isBefore: true, + isAfter: true + }, + table: 'itemData', + field: 'DATE(value)', + aliases: ['accessDate', 'date'], + template: true // mark for special handling + }, + + { + name: 'numberfield', + operators: { + is: true, + isNot: true, + contains: true, + doesNotContain: true, + isLessThan: true, + isGreaterThan: true + }, + table: 'itemData', + field: 'value', + aliases: ['pages', 'section', 'accessionNumber', + 'seriesNumber','issue'], template: true // mark for special handling } ]; @@ -734,7 +794,7 @@ Scholar.SearchConditions = new function(){ if (!_initialized){ _init(); } - + Scholar.debug(_standardConditions); // TODO: return copy instead return _standardConditions; } diff --git a/chrome/chromeFiles/locale/en-US/scholar/scholar.properties b/chrome/chromeFiles/locale/en-US/scholar/scholar.properties index a8b6a2c53..c57b01e1f 100644 --- a/chrome/chromeFiles/locale/en-US/scholar/scholar.properties +++ b/chrome/chromeFiles/locale/en-US/scholar/scholar.properties @@ -101,8 +101,8 @@ searchOperator.is = is searchOperator.isNot = is not searchOperator.contains = contains searchOperator.doesNotContain = does not contain -searchOperator.lessThan = is less than -searchOperator.greaterThan = is greater than +searchOperator.isLessThan = is less than +searchOperator.isGreaterThan = is greater than searchOperator.isBefore = is before searchOperator.isAfter = is after @@ -112,6 +112,7 @@ searchConditions.tag = Tag searchConditions.note = Note searchConditions.creator = Creator searchConditions.thesisType = Thesis Type +searchConditions.dateModified = Date Modified exportOptions.exportNotes = Export Notes exportOptions.exportFileData = Export Files \ No newline at end of file