Index: scrapers.sql
===================================================================
--- scrapers.sql	(revision 910)
+++ scrapers.sql	(working copy)
@@ -6751,12 +6751,13 @@
 	interview:"misc",
 	film:"misc",
 	artwork:"misc",
-	webpage:"misc"
+	webpage:"misc",
+	conferencePaper:"inproceedings"
 };
 
 // supplements outputTypeMap for importing
 var inputTypeMap = {
-	inproceedings:"journalArticle",
+	inproceedings:"conferencePaper",
 	conference:"journalArticle",
 	techreport:"book",
 	booklet:"book",
@@ -7018,7 +7019,9 @@
 	}
 }
 
-function writeField(field, value) {
+// some fields are, in fact, macros.  If that is the case then we should not put the
+// data in the braces as it will cause the macros to not expand properly
+function writeMacroField(field, value) {
 	if(!value) return;
 	
 	value = value.toString();
@@ -7033,6 +7036,27 @@
 	value = value.replace(/[\u0080-\uFFFF]/g, "?")
 	
 	// write
+	Zotero.write(",\n\t"+field+" = "+value);
+}
+
+function writeField(field, value) {
+	if(!value) return;
+	
+	value = value.toString();
+	// replace naughty chars
+	value = value.replace(/([#$%&~_^\\{}])/g, "\\$1");
+	// we assume people who use braces in their title probably did so intentionally
+    if (field == "title") {
+        value = value.replace(/\\([{}])/g, "$1");
+    }
+	// replace accented characters	
+	for(var i in accentedCharacters) {
+		value = value.replace(accentedCharacters[i], i);
+	}
+	// replace other accented characters
+	value = value.replace(/[\u0080-\uFFFF]/g, "?")
+	
+	// write
 	Zotero.write(",\n\t"+field+" = {"+value+"}");
 }
 
@@ -7059,8 +7083,24 @@
 		// create a unique citation key
 		var basekey = "";
 		if(item.creators && item.creators[0] && item.creators[0].lastName) {
-			basekey = item.creators[0].lastName.toLowerCase();
+			basekey = item.creators[0].lastName.toLowerCase().replace(/ /g,"_").replace(/,/g,"");
 		}
+
+        // include the item title as part of the citation key
+        if(item["title"]) {
+            // this is a list of words that should not appear as part of the citation key
+            bannedTitleKeys = {"a" : 1, "an" : 1, "does": 1, "how": 1, "it''s": 1, "on" : 1, "some": 1, "the" : 1, "this" : 1, "why" : 1 };
+            titleElements = item["title"].split(" ");
+            appendKey = "";
+            for (te in titleElements) {
+                if (!bannedTitleKeys[titleElements[te].toLowerCase()]) {
+                    appendKey = "_" + titleElements[te].toLowerCase() + "_";
+                    break;
+                } 
+            }
+            basekey = basekey + appendKey;
+        }
+
 		if(item.date) {
 			var date = Zotero.Utilities.strToDate(item.date);
 			if(date.year && numberRe.test(date.year)) {
@@ -7068,6 +7108,8 @@
 			}
 		}
 		
+		// make sure we do not have any other funny characters
+		basekey = basekey.replace(/[\. ,'':\"!&]/g,"");
 		var citekey = basekey;
 		var i = 0;
 		while(citekeys[citekey]) {
@@ -7086,6 +7128,10 @@
 			}
 		}
 		
+		if(item.conferenceName) {
+			writeField("booktitle", item.conferenceName);
+		}
+
 		if(item.publicationTitle) {
 			if(item.itemType == "chapter") {
 				writeField("booktitle", item.publicationTitle);
@@ -7108,8 +7154,9 @@
 			var editor = "";
 			for each(var creator in item.creators) {
 				var creatorString = creator.lastName;
-				if(creator.firstName) creatorString += ", "+creator.firstName;
-				
+
+				if(creator.firstName) creatorString = creator.firstName + " " + creator.lastName;
+
 				if(creator.creatorType == "editor") {
 					author += " and "+creatorString;
 				} else {
@@ -7121,14 +7168,14 @@
 				writeField("author", author.substr(5));
 			}
 			if(editor) {
-				writeField("author", editor.substr(5));
+				writeField("editor", editor.substr(5));
 			}
 		}
 		
 		if(item.date) {
 			// need to use non-localized abbreviation
 			if(date.month) {
-				writeField("month", months[date.month]);
+				writeMacroField("month", months[date.month]);
 			}
 			if(date.year) {
 				writeField("year", date.year);
@@ -7142,6 +7189,9 @@
 		if(item.tags && item.tags.length) {
 			writeField("keywords", item.tags.join(","));
 		}
+		if(item.pages) {
+			writeField("pages", item.pages);
+		}
 		
 		Zotero.write("\n}");
 	}
@@ -7938,4 +7988,4 @@
       </item>
     </layout>
   </bibliography>
-</style>');
\ No newline at end of file
+</style>');
Index: system.sql
===================================================================
--- system.sql	(revision 910)
+++ system.sql	(working copy)
@@ -15,8 +15,6 @@
     
     -- Describes various types of fields and their format restrictions,
     -- and indicates whether data should be stored as strings or integers
-    --
-    -- unused
     DROP TABLE IF EXISTS fieldFormats;
     CREATE TABLE fieldFormats (
         fieldFormatID INTEGER PRIMARY KEY,
@@ -115,11 +113,10 @@
     );
     
     
-    -- unused
     INSERT INTO "fieldFormats" VALUES(1, '.*', 0);
     INSERT INTO "fieldFormats" VALUES(2, '[0-9]*', 1);
     INSERT INTO "fieldFormats" VALUES(3, '[0-9]{4}', 1);
-
+    
 INSERT INTO itemTypes VALUES (1,'note',NULL,0);
 INSERT INTO itemTypes VALUES (2,'book',NULL,2);
 INSERT INTO itemTypes VALUES (3,'bookSection',2,2);
@@ -152,6 +149,7 @@
 INSERT INTO itemTypes VALUES (30,'radioBroadcast',NULL,1);
 INSERT INTO itemTypes VALUES (31,'podcast',NULL,1);
 INSERT INTO itemTypes VALUES (32,'computerProgram',NULL,1);
+INSERT INTO itemTypes VALUES (33,'conferencePaper',NULL,1);
 
 INSERT INTO fields VALUES (1,'url',NULL);
 INSERT INTO fields VALUES (2,'rights',NULL);
@@ -218,6 +216,7 @@
 INSERT INTO fields VALUES (81,'version',NULL);
 INSERT INTO fields VALUES (82,'system',NULL);
 INSERT INTO fields VALUES (83,'company',NULL);
+INSERT INTO fields VALUES (84,'conferenceName',NULL);
 
 INSERT INTO itemTypeFields VALUES (2, 3, NULL, 1);
 INSERT INTO itemTypeFields VALUES (2, 30, NULL, 2);
@@ -572,6 +571,18 @@
 INSERT INTO itemTypeFields VALUES (32, 1, NULL, 11);
 INSERT INTO itemTypeFields VALUES (32, 27, NULL, 12);
 INSERT INTO itemTypeFields VALUES (32, 22, NULL, 13);
+-- Conference Paper
+INSERT INTO itemTypeFields VALUES (33, 14, NULL, 1);  -- date
+INSERT INTO itemTypeFields VALUES (33, 10, NULL, 2);  -- pages
+INSERT INTO itemTypeFields VALUES (33, 3, NULL, 3);   -- series
+INSERT INTO itemTypeFields VALUES (33, 84, NULL, 4);  -- conference name
+INSERT INTO itemTypeFields VALUES (33, 7, NULL, 5);   -- conference location
+INSERT INTO itemTypeFields VALUES (33, 8, NULL, 6);   -- publisher
+INSERT INTO itemTypeFields VALUES (33, 26, NULL, 7);  -- DOI
+INSERT INTO itemTypeFields VALUES (33, 19, NULL, 8);  -- Location in archive
+INSERT INTO itemTypeFields VALUES (33, 1, NULL, 9);   -- URL 
+INSERT INTO itemTypeFields VALUES (33, 27, NULL, 10); -- access date
+INSERT INTO itemTypeFields VALUES (33, 22, NULL, 11); -- extra
 
 INSERT INTO creatorTypes VALUES(1, "author");
 INSERT INTO creatorTypes VALUES(2, "contributor");
@@ -701,8 +712,12 @@
 INSERT INTO itemTypeCreatorTypes VALUES(31,25,0);
 INSERT INTO itemTypeCreatorTypes VALUES(32,21,1);
 INSERT INTO itemTypeCreatorTypes VALUES(32,2,0);
+-- Conference Paper
+INSERT INTO itemTypeCreatorTypes VALUES(33,1,1);  -- author
+INSERT INTO itemTypeCreatorTypes VALUES(33,2,0);  -- contributor
+INSERT INTO itemTypeCreatorTypes VALUES(33,3,0);  -- editor
+INSERT INTO itemTypeCreatorTypes VALUES(33,4,0);  -- translator
 
-
     INSERT INTO "fileTypes" VALUES(1, 'webpage');
     INSERT INTO "fileTypes" VALUES(2, 'image');
     INSERT INTO "fileTypes" VALUES(3, 'pdf');
Index: chrome/locale/en-US/zotero/zotero.properties
===================================================================
--- chrome/locale/en-US/zotero/zotero.properties	(revision 910)
+++ chrome/locale/en-US/zotero/zotero.properties	(working copy)
@@ -39,6 +39,7 @@
 pane.item.attachments.count.singular  = %S attachment:
 pane.item.attachments.count.plural    = %S attachments:
 pane.item.attachments.select			= Select a File
+pane.item.attachments.bugzilla67001 = Unable to view the file.\n\nIf you're on Linux or Unix, it is most likely related to Mozilla bug 67001.
 pane.item.tags.count.zero       = %S tags:
 pane.item.tags.count.singular   = %S tag:
 pane.item.tags.count.plural     = %S tags:
@@ -78,6 +79,7 @@
 itemTypes.radioBroadcast		= Radio Broadcast
 itemTypes.podcast				= Podcast
 itemTypes.computerProgram		= Computer Program
+itemTypes.conferencePaper		= Conference Paper
 
 itemFields.title        		= Title
 itemFields.dateAdded    		= Date Added
@@ -149,6 +151,7 @@
 itemFields.version				= Version
 itemFields.system				= System
 itemFields.company				= Company
+itemFields.conferenceName		= Conference Name
 
 creatorTypes.author				= Author
 creatorTypes.contributor		= Contributor
@@ -243,4 +246,4 @@
 date.abbreviation.day           = d
 
 citation.multipleSources		= Multiple Sources...
-citation.singleSource			= Single Source...
\ No newline at end of file
+citation.singleSource			= Single Source...
Index: chrome/content/zotero/overlay.js
===================================================================
--- chrome/content/zotero/overlay.js	(revision 910)
+++ chrome/content/zotero/overlay.js	(working copy)
@@ -965,7 +965,23 @@
 						window.loadURI(attachment.getLocalFileURL());
 					}
 					else {
-						file.launch();
+						/* some platforms don't have nsILocalFile.launch, this bit of code works
+						around all of that by catching the exception and opening the file using the
+						interfaces built into FireFox instead. */
+						try {
+							file.launch();
+						} catch (e) {
+							try {
+								var ios = Components.classes["@mozilla.org/network/io-service;1"]
+								                    .getService(Components.interfaces.nsIIOService);
+								var fileHandler = ios.getProtocolHandler("file")
+								                     .QueryInterface(Components.interfaces.nsIFileProtocolHandler);
+								var URL = fileHandler.getURLSpecFromFile(file);
+								window.open(URL);
+							} catch (e) {
+								alert(Zotero.getString('pane.item.attachments.bugzilla67001'));
+							}
+						}
 					}
 				}
 				else {
@@ -990,7 +1006,11 @@
 			{
 				var file = attachment.getFile();
 				if (file){
-					file.reveal();
+					try {
+						file.reveal();
+					} catch (e) {
+						alert(Zotero.getString('pane.item.attachments.bugzilla67001'));
+					}
 				}
 				else {
 					alert(Zotero.getString('pane.item.attachments.fileNotFound'));
@@ -1001,4 +1021,4 @@
 }
 
 window.addEventListener("load", function(e) { ZoteroPane.onLoad(e); }, false);
-window.addEventListener("unload", function(e) { ZoteroPane.onUnload(e); }, false);
\ No newline at end of file
+window.addEventListener("unload", function(e) { ZoteroPane.onUnload(e); }, false);
