diff --git a/chrome/content/zotero/xpcom/data/group.js b/chrome/content/zotero/xpcom/data/group.js index 724d5bcda6..c1e88ea991 100644 --- a/chrome/content/zotero/xpcom/data/group.js +++ b/chrome/content/zotero/xpcom/data/group.js @@ -279,7 +279,7 @@ Zotero.Group.prototype.save = function () { /** * Deletes group and all descendant objects **/ -Zotero.Group.prototype.erase = function(deleteItems) { +Zotero.Group.prototype.erase = function() { Zotero.DB.beginTransaction(); var sql, ids, obj; @@ -357,105 +357,6 @@ Zotero.Group.prototype.serialize = function() { } -/** - * Returns an array of descendent groups and items - * - * @param bool recursive Descend into subgroups - * @param bool nested Return multidimensional array with 'children' - * nodes instead of flat array - * @param string type 'item', 'group', or FALSE for both - * @return {Object[]} Array of objects with 'id', 'key', - * 'type' ('item' or 'group'), 'parent', - * and, if group, 'name' and the nesting 'level' - */ -Zotero.Group.prototype.getChildren = function(recursive, nested, type, level) { - if (!this.id) { - throw ('Zotero.Group.getChildren() cannot be called on an unsaved item'); - } - - var toReturn = []; - - if (!level) { - level = 1; - } - - // 0 == group - // 1 == item - var children = Zotero.DB.query('SELECT groupID AS id, ' - + "0 AS type, groupName AS groupName, key " - + 'FROM groups WHERE parentGroupID=?1' - + ' UNION SELECT itemID AS id, 1 AS type, NULL AS groupName, key ' - + 'FROM groupItems JOIN items USING (itemID) WHERE groupID=?1', this.id); - - if (type) { - switch (type) { - case 'item': - case 'group': - break; - default: - throw ("Invalid type '" + type + "' in Group.getChildren()"); - } - } - - for(var i=0, len=children.length; i