Commit Graph

17 Commits

Author SHA1 Message Date
Dan Stillman
97d1e0b844 Closes #346, mapping for new item types
Closes #227, Indent nested collections in search drop-down
Addresses #528, Make search condition drop-down menu less unwieldy

- Created new distinct fields for differently labeled fields
- Mapped lots of fields to base fields
- Made base field search conditions search type-specific fields as well
- Removed type-specific fields that are based on base fields not show up in search conditions drop-down
- Added a tooltip when hovering over a condition in the search conditions drop-down that shows the fields it searches (when there's more than one)
- Moved search dialog CSS to separate file
2007-02-17 09:39:51 +00:00
Dan Stillman
3e7ddd04d8 Removed abstract-as-note functionality in favor of a regular 'abstract' field
Abstract displays in metadata pane as a cropped one-line field by default; clicking the 'Abstract' label toggles between the cropped field and an expanded view

Some problems with import/export: https://www.zotero.org/trac/ticket/537

Refs #537
2007-02-15 20:33:14 +00:00
Dan Stillman
cc1517da90 Closes #220, Add a more friendly way to enter dates in search window and accessDate field
Addresss #352, Make sure data layer doesn't allow bad data via the API

Access date field is now human-friendly. Also enforcing SQL date form for the field in the DB and discarding bad data passed via setField().
2007-02-06 11:03:22 +00:00
Dan Stillman
4caa096a46 Addresses #346, mapping for new item types
Closes #453, Check if any fields will actually be discarded on item type change before giving warning
Refs #530, Add base field conversion to translation level

Added mechanism for linking item type fields via base fields, e.g. publisher => label in audioRecording

New methods:

Item.getFieldsNotInType(itemTypeID, allowBaseConversion)
ItemFields.getLocalizedString(itemTypeID, field)
ItemFields.isBaseField(fieldID)
ItemFields.getFieldIDFromTypeAndBase(itemType, baseField)
ItemFields.getBaseIDFromTypeAndField(itemType, typeField)
ItemFields.getTypeFieldsFromBase(baseField)

Currently only the publisher fields are mapped -- I need more feedback on #346 before I implement the others (specifically on whether or not all these sorts of fields should be done as distinct fields or whether some should just be localized strings (in which case they'll autocomplete but not show up separately as search conditions))

Also added 'university' as distinct publisher field for thesis

Values of equivalent fields are now preserved when switching between item types (e.g. the 'studio' value becomes the 'label' value when switching between videoRecording and audioRecording), and the pop-up is much smarter--it will only prompt you if fields will in fact be lost, and it will list the fields that would be deleted.

Not finished:

- Searching for base fields doesn't yet search the type-specific fields, as Elena requested
- import/export/bib should be updated to use the ItemFields base conversion methods where appropriate -- data coming from the 'publisher' field from translators, for example, should be put into the appropriate type-specific field.
2007-02-03 17:08:03 +00:00
Dan Stillman
a3126da160 Addresses #502, Special handling for automatic tags
- Automatic tags now appear in orange; tooltip says either "User-added tag" or "Automatically added tag"
- New menu in tag selector to toggle automatic tags
- User and automatic tags are combined in tag selector, so renaming/deleting a tag will affect both user and automatic, regardless of view mode
- Editing a tag makes it a user tag, as does adding an identical user tag to an item (rather than creating a second one)
- ingester/export will need to be adjusted to add automatic tags

Changed:

Item.addTag(tag) => addTag(tag, type)
Item.getTags() - now returns 'id', 'tag', 'type'
Item.toArray() - tags now include 'type' property (from Item.getTags())
Tags.getID(tag) => getID(tag, type)
Tags.getAll() => getAll([types]) - types is an optional array of tagTypes to fetch; now returns objects with 'tag' and 'type' properties
Tags.getAllWithinSearch(search) => Tags.getAllWithinSearch(search, [types]) - now returns object with 'tag'/'type'

Added:

Tags.get(tagID) - returns object with 'tag' and 'type' properties
Tags.getIDs(tag) - returns all tagIDs for this tag (of all types)
Tags.getType(tag) - returns array of tag types matching given tag

For type property, 0 == user, 1 == automatic
2007-01-22 22:32:52 +00:00
Simon Kornblith
be2abdf397 provide DB infrastructure for resizing annotations; this will delete any existing annotations 2007-01-03 04:48:18 +00:00
Simon Kornblith
70d06e02f2 closes #440, In-page highlighting of snapshots
closes #441, In-page annotations of snapshots

testers: please check pages containing both annotations and highlights to make sure everything works correctly
2007-01-03 02:21:26 +00:00
Dan Stillman
64e4fc0a57 Refs #362, Support abstracts
Forget changed userdata schema
2006-12-07 00:46:30 +00:00
Dan Stillman
361a1e4bc6 Add minVersion/maxVersion to translators schema and schema update mechanisms (local and remote) -- these aren't really necessary on the client but let us use the same SQL to update the repo, and we probably should include them in error reports (instead of relying on different timestamps to differentiate versions)
Added minVersion and maxVersion times to existing scrapers, setting 1.0.0b3.r1 as minVersion for any >4096 characters; these could theoretically now be added back to the repository without problems, but there's not really much reason to test that theory at the moment
2006-11-26 09:19:07 +00:00
Dan Stillman
de5b998139 Closes #388, Use relative paths for imported attachments
Also fixes breakage of linked files since multiple attachments update
2006-11-05 09:13:01 +00:00
Dan Stillman
e73285ffc5 Improve date field handling
- Item.setField() stores dates in a multipart format beginning with an SQL date followed by the user's entry, so "November 3, 2006" becomes "2006-11-03 November 3, 2006" -- date field entries are parsed with Zotero.Date.strToDate() if not already in multipart format

- Item.getField() returns just the user part unless passed the new second parameter, _unformatted_, which returns the field directly from DB without processing (e.g. the full multipart string)

- Added SQLite triggers on the itemData table to enforce multipart format even if the table is modified outside the API

- Migration step to update existing dates

- Indicator next to date field to show what we've parsed and a tooltip over the date field to show the SQL date -- though I'm not sure how well the abbreviation part will localize (i.e. can you abbreviate 'month' in Chinese?)

One obvious problem is how to handle date ranges when sorting or searching, which may end up rendering this whole method fairly useless (though I guess the multipart format could begin with two SQL dates instead of just one, at the cost of some storage space...).


Other changes:

- Utilities.lpad() handling for undefined value parameter

- new Zotero.Date methods: strToMultipart(), isMultipart(), multipartToSQL(), multipartToStr(), isSQLDate(), sqlHasYear(), sqlHasMonth, sqlHasDay getLocaleDateOrder() (the last one unused for now)

- try/catch around manual itemData INSERT execute() statements in Item.save()
2006-11-03 09:23:24 +00:00
Dan Stillman
677b047172 Addresses #367, Handle missing attachment files
- Catch errors trying to display missing files and display message to user

- Switch to persistent descriptors rather than relative paths for attachment paths -- this will fix attachments on networked drives (which, at least on Windows, were not working and apparently in some cases breaking entire Zotero installs), but since WebBrowserPersist.saveDocument() is asynchronous and file.persistentDescriptor can't be set on Macs before the file exists, Attachments.importFromDocument() no longer returns the id of the new attachment, so translate.js had to be changed accordingly

- Try to convert relative descriptors to persistent ones with migration step (and later on access, if persistent fails)

- Added Zotero.WebProgressFinishListener(onDone)


Next step would be to throw up a file dialog to let the user locate the missing file
2006-10-22 10:11:29 +00:00
Dan Stillman
214cbe499b Ack! Drop translators and CSL for people upgrading! 2006-10-06 03:49:46 +00:00
Dan Stillman
7712a24434 Moved translators and CSL CREATE TABLE statements to userdata.sql, since those are the two tables that we actually _want_ users to modify (without them being wiped on every update) 2006-10-05 23:50:29 +00:00
Dan Stillman
c59dcdc0a6 New item types, fields, creator types, and the glue to make them work
If anyone's out there, now would be the time to test this.

Missing icons for the new types -- I could try to get some of those now, or we could just launch. Maybe we'll just launch. But really, might want to test this. Just sayin'.
2006-10-05 22:27:29 +00:00
Dan Stillman
cd26267afe Closes #340, Change isInstitution to fieldMode everywhere
Including in the DB, which it turns out isn't really all that bad (thanks, among other things, to SQLite's ability to DROP tables within transactions without autocommitting (which MySQL can't do))
2006-10-05 00:59:26 +00:00
Dan Stillman
74dbdec49b Renamed user.js to userdata.js 2006-10-04 23:37:15 +00:00