From 496e289dd9677b1c0b4bec43c814b72754bf09ae Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 8 Oct 2016 19:57:49 -0400 Subject: [PATCH] Fix NSF schema installation/uninstallation I don't know if this is still used, but now it works on this branch. --- chrome/content/zotero/xpcom/schema.js | 150 +++++++++++++------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index 3b07a13354..625529456f 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -195,9 +195,10 @@ Zotero.Schema = new function(){ }); + // https://www.zotero.org/support/nsf + // // This is mostly temporary // TEMP - NSF - // TODO: async this.importSchema = Zotero.Promise.coroutine(function* (str, uri) { var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); @@ -207,7 +208,7 @@ Zotero.Schema = new function(){ return; } - str = Zotero.Utilities.trim(str); + str = str.trim(); Zotero.debug(str); @@ -223,67 +224,65 @@ Zotero.Schema = new function(){ var itemTypeID = Zotero.ID.get('customItemTypes'); - Zotero.DB.beginTransaction(); - - Zotero.DB.query("INSERT INTO customItemTypes VALUES (?, 'nsfReviewer', 'NSF Reviewer', 1, 'chrome://zotero/skin/report_user.png')", itemTypeID); - - var fields = [ - ['name', 'Name'], - ['institution', 'Institution'], - ['address', 'Address'], - ['telephone', 'Telephone'], - ['email', 'Email'], - ['homepage', 'Webpage'], - ['discipline', 'Discipline'], - ['nsfID', 'NSF ID'], - ['dateSent', 'Date Sent'], - ['dateDue', 'Date Due'], - ['accepted', 'Accepted'], - ['programDirector', 'Program Director'] - ]; - for (var i=0; i