Closes #298, Add condition for searching by file type
"Attachment File Type"
This commit is contained in:
parent
d261dfdba5
commit
b4bdede0d1
|
@ -308,6 +308,17 @@
|
||||||
this.createValueMenu(types);
|
this.createValueMenu(types);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'fileTypeID':
|
||||||
|
var types = Zotero.FileTypes.getTypes();
|
||||||
|
for (var i in types) {
|
||||||
|
types[i][0] = Zotero.getString('fileTypes.' + types[i]['name']);
|
||||||
|
types[i][1] = types[i]['id'];
|
||||||
|
delete types[i]['name'];
|
||||||
|
delete types[i]['id'];
|
||||||
|
}
|
||||||
|
this.createValueMenu(types);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (operatorsList.value=='isInTheLast')
|
if (operatorsList.value=='isInTheLast')
|
||||||
{
|
{
|
||||||
|
@ -341,8 +352,8 @@
|
||||||
var operatorsList = this.id('operatorsmenu');
|
var operatorsList = this.id('operatorsmenu');
|
||||||
|
|
||||||
// Drop-down menu
|
// Drop-down menu
|
||||||
if (conditionsMenu.value=='collectionID' || conditionsMenu.value=='itemTypeID')
|
if (conditionsMenu.value == 'collectionID' || conditionsMenu.value == 'itemTypeID'
|
||||||
{
|
|| conditionsMenu.value == 'fileTypeID') {
|
||||||
this.id('valuefield').hidden = true;
|
this.id('valuefield').hidden = true;
|
||||||
this.id('valuemenu').hidden = false;
|
this.id('valuemenu').hidden = false;
|
||||||
this.id('value-date-age').hidden = true;
|
this.id('value-date-age').hidden = true;
|
||||||
|
|
|
@ -645,6 +645,13 @@ Zotero.Search.prototype._buildQuery = function(){
|
||||||
skipOperators = true;
|
skipOperators = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'fileTypeID':
|
||||||
|
condSQL += 'mimeType IN (SELECT mimeType FROM '
|
||||||
|
+ 'fileTypeMimeTypes WHERE fileTypeID IN ('
|
||||||
|
+ 'SELECT fileTypeID FROM fileTypes WHERE ';
|
||||||
|
openParens = openParens + 2;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'tag':
|
case 'tag':
|
||||||
condSQL += "tagID IN (SELECT tagID FROM tags WHERE ";
|
condSQL += "tagID IN (SELECT tagID FROM tags WHERE ";
|
||||||
openParens++;
|
openParens++;
|
||||||
|
@ -1118,6 +1125,16 @@ Zotero.SearchConditions = new function(){
|
||||||
field: 'itemTypeID'
|
field: 'itemTypeID'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: 'fileTypeID',
|
||||||
|
operators: {
|
||||||
|
is: true,
|
||||||
|
isNot: true
|
||||||
|
},
|
||||||
|
table: 'itemAttachments',
|
||||||
|
field: 'fileTypeID'
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'tagID',
|
name: 'tagID',
|
||||||
operators: {
|
operators: {
|
||||||
|
|
|
@ -225,6 +225,14 @@ creatorTypes.presenter = Presenter
|
||||||
creatorTypes.guest = Guest
|
creatorTypes.guest = Guest
|
||||||
creatorTypes.podcaster = Podcaster
|
creatorTypes.podcaster = Podcaster
|
||||||
|
|
||||||
|
fileTypes.webpage = Web Page
|
||||||
|
fileTypes.image = Image
|
||||||
|
fileTypes.pdf = PDF
|
||||||
|
fileTypes.audio = Audio
|
||||||
|
fileTypes.video = Video
|
||||||
|
fileTypes.presentation = Presentation
|
||||||
|
fileTypes.document = Document
|
||||||
|
|
||||||
ingester.scraping = Saving Item...
|
ingester.scraping = Saving Item...
|
||||||
ingester.scrapeComplete = Item Saved.
|
ingester.scrapeComplete = Item Saved.
|
||||||
ingester.scrapeError = Could Not Save Item.
|
ingester.scrapeError = Could Not Save Item.
|
||||||
|
@ -285,6 +293,8 @@ searchConditions.mapType = Map Type
|
||||||
searchConditions.dateModified = Date Modified
|
searchConditions.dateModified = Date Modified
|
||||||
searchConditions.fulltextContent = Attachment Content
|
searchConditions.fulltextContent = Attachment Content
|
||||||
searchConditions.programmingLanguage = Programming Language
|
searchConditions.programmingLanguage = Programming Language
|
||||||
|
searchConditions.audioFileType = Audio File Type
|
||||||
|
searchConditions.fileTypeID = Attachment File Type
|
||||||
|
|
||||||
exportOptions.exportNotes = Export Notes
|
exportOptions.exportNotes = Export Notes
|
||||||
exportOptions.exportFileData = Export Files
|
exportOptions.exportFileData = Export Files
|
||||||
|
|
Loading…
Reference in New Issue
Block a user