From 9c7f33e21a4480921f29e1b6436bc904adf0f924 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 11 Aug 2006 05:15:56 +0000 Subject: [PATCH] Extended itemCreators primary key to include orderIndex and removed artificial restriction on adding the same creator/creatorType more than once for the same source -- who knows, maybe they just have the same name... Properly ignore firstName for institutional creators in Item.setCreator() and Item.creatorExists() (which is now unused) --- .../content/scholar/xpcom/data_access.js | 73 +++++++------------ .../content/scholar/xpcom/schema.js | 4 +- schema.sql | 4 +- 3 files changed, 30 insertions(+), 51 deletions(-) diff --git a/chrome/chromeFiles/content/scholar/xpcom/data_access.js b/chrome/chromeFiles/content/scholar/xpcom/data_access.js index 1a4994f815..07ae3383e8 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/data_access.js +++ b/chrome/chromeFiles/content/scholar/xpcom/data_access.js @@ -228,7 +228,7 @@ Scholar.Item.prototype.setCreator = function(orderIndex, firstName, lastName, cr this._loadCreators(); } - if (!firstName){ + if (isInstitution || !firstName){ firstName = ''; } @@ -287,11 +287,23 @@ Scholar.Item.prototype.removeCreator = function(orderIndex){ } +// Currently unused Scholar.Item.prototype.creatorExists = function(firstName, lastName, creatorTypeID, isInstitution, skipIndex){ + if (isInstitution || !firstName){ + firstName = ''; + } + + if (!lastName){ + lastName = ''; + } + + isInstitution = !!isInstitution; + for (var j=0, len=this.numCreators(); j