Some libraryID follow-ups
This commit is contained in:
parent
d50b6667f0
commit
417335baf2
|
@ -146,9 +146,16 @@ Zotero.API = {
|
||||||
|
|
||||||
|
|
||||||
getLibraryPrefix: function (libraryID) {
|
getLibraryPrefix: function (libraryID) {
|
||||||
return libraryID
|
switch (Zotero.Libraries.getType(libraryID)) {
|
||||||
? 'groups/' + Zotero.Groups.getGroupIDFromLibraryID(libraryID)
|
case 'user':
|
||||||
: 'library';
|
return 'library';
|
||||||
|
|
||||||
|
case 'publications':
|
||||||
|
return 'publications';
|
||||||
|
|
||||||
|
case 'groups':
|
||||||
|
return 'groups/' + Zotero.Groups.getGroupIDFromLibraryID(libraryID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1155,13 +1155,7 @@ var ZoteroPane = new function()
|
||||||
// editability of the library
|
// editability of the library
|
||||||
if (collectionTreeRow.isTrash() &&
|
if (collectionTreeRow.isTrash() &&
|
||||||
disableIfNoEdit[i] == 'cmd_zotero_newCollection') {
|
disableIfNoEdit[i] == 'cmd_zotero_newCollection') {
|
||||||
if (collectionTreeRow.ref.libraryID) {
|
var overrideEditable = Zotero.Libraries.isEditable(collectionTreeRow.ref.libraryID);
|
||||||
var overrideEditable =
|
|
||||||
Zotero.Libraries.isEditable(collectionTreeRow.ref.libraryID);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var overrideEditable = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var overrideEditable = false;
|
var overrideEditable = false;
|
||||||
|
@ -3360,14 +3354,7 @@ var ZoteroPane = new function()
|
||||||
}
|
}
|
||||||
itemType = Zotero.ItemTypes.getID(itemType);
|
itemType = Zotero.ItemTypes.getID(itemType);
|
||||||
var item = yield this.newItem(itemType, data, row);
|
var item = yield this.newItem(itemType, data, row);
|
||||||
|
var filesEditable = Zotero.Libraries.isFilesEditable(item.libraryID);
|
||||||
if (item.libraryID) {
|
|
||||||
var group = Zotero.Groups.getByLibraryID(item.libraryID);
|
|
||||||
var filesEditable = group.filesEditable;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var filesEditable = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (saveSnapshot) {
|
if (saveSnapshot) {
|
||||||
var link = false;
|
var link = false;
|
||||||
|
@ -3481,13 +3468,7 @@ var ZoteroPane = new function()
|
||||||
}
|
}
|
||||||
|
|
||||||
var item = yield ZoteroPane_Local.newItem(itemType, {}, row)
|
var item = yield ZoteroPane_Local.newItem(itemType, {}, row)
|
||||||
if (item.libraryID) {
|
var filesEditable = Zotero.Libraries.isFilesEditable(item.libraryID);
|
||||||
var group = Zotero.Groups.getByLibraryID(item.libraryID);
|
|
||||||
filesEditable = group.filesEditable;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
filesEditable = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save snapshot if explicitly enabled or automatically pref is set and not explicitly disabled
|
// Save snapshot if explicitly enabled or automatically pref is set and not explicitly disabled
|
||||||
if (saveSnapshot || (saveSnapshot !== false && Zotero.Prefs.get('automaticSnapshots'))) {
|
if (saveSnapshot || (saveSnapshot !== false && Zotero.Prefs.get('automaticSnapshots'))) {
|
||||||
|
@ -3816,12 +3797,8 @@ var ZoteroPane = new function()
|
||||||
}
|
}
|
||||||
|
|
||||||
var collectionTreeRow = this.collectionsView.getRow(row);
|
var collectionTreeRow = this.collectionsView.getRow(row);
|
||||||
// TODO: isEditable for user library should just return true
|
|
||||||
if (collectionTreeRow.ref.libraryID) {
|
|
||||||
return Zotero.Libraries.isEditable(collectionTreeRow.ref.libraryID);
|
return Zotero.Libraries.isEditable(collectionTreeRow.ref.libraryID);
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user