pressbooks/pressbooks — pull request #67 by drlippman (2014-08-15 23:37:18+00:00)
Title: Retain order in WRX import of PB export

Currently when a Pressbooks export is re-imported, 1) the content comes loaded in content order, rather than sorted display order, 2) any part structure that was created is lost, and 3) any part text is lost.

This is one possible way to address this, so a Pressbooks export can be re-imported retaining all the original structure and ordering.

First, the order of content on the import selection page and during import is put in proper display order based on the Part structure and post menu_order. The post type radios are automatically selected for PressBooks imports based on their original export type.

For WRX imports, a new column is added on the import page for Parts, allowing an item to be imported as a Part. During import, when an item is imported as a Part, it becomes the parent Part for any chapters that follow it in the import, until a new Part is imported. Any chapters imported before the first Part get assigned to the first available Part, as is the current default.