www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit c97491821fed8b116f38842156549e91415b8f5b
parent 0d9f45b0fa8fb021ade5847e119fd2a3f4a0817f
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sat, 28 Aug 2010 17:21:24 +0000

Don't include deleted items in "Export Library" output


Diffstat:
Mchrome/content/zotero/xpcom/data/items.js | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/xpcom/data/items.js b/chrome/content/zotero/xpcom/data/items.js @@ -148,7 +148,7 @@ Zotero.Items = new function() { * * If |onlyTopLevel|, don't include child items */ - function getAll(onlyTopLevel, libraryID) { + function getAll(onlyTopLevel, libraryID, includeDeleted) { var sql = 'SELECT A.itemID FROM items A'; if (onlyTopLevel) { sql += ' LEFT JOIN itemNotes B USING (itemID) ' @@ -158,6 +158,9 @@ Zotero.Items = new function() { else { sql += " WHERE 1"; } + if (!includeDeleted) { + sql += " AND A.itemID NOT IN (SELECT itemID FROM deletedItems)"; + } if (libraryID) { sql += " AND libraryID=?"; var ids = Zotero.DB.columnQuery(sql, libraryID); @@ -166,7 +169,6 @@ Zotero.Items = new function() { sql += " AND libraryID IS NULL"; var ids = Zotero.DB.columnQuery(sql); } - return this.get(ids); }