Don't return non-independent file items in Scholar.getItems() (thanks David)

This commit is contained in:
Dan Stillman 2006-07-27 15:55:03 +00:00
parent c093e7b62b
commit 441696767a

View file

@ -3273,8 +3273,9 @@ Scholar.getItems = function(parent){
var toReturn = new Array();
if (!parent){
var sql = "SELECT itemID FROM items LEFT JOIN itemNotes USING (itemID) "
+ "WHERE sourceItemID IS NULL";
var sql = "SELECT A.itemID FROM items A LEFT JOIN itemNotes B USING (itemID) "
+ "LEFT JOIN itemFiles C ON (C.itemID=A.itemID) WHERE B.sourceItemID IS NULL"
+ " AND C.sourceItemID IS NULL";
}
else {
var sql = 'SELECT itemID FROM collectionItems '