Recompute schedule and save changes (if any) in a private table.  Refs #9648.
Recompute schedule and save changes (if any) in a private table.  Refs #9648.

 * All datetimes used in schedule are now in local time zone.
  * Had to be "offset-aware" (to use to_utimestamp() utility function)
 * TracPM.start(), .finish() now return calculated date, then stored date, then None depending on what is available.
 * postQuery() now reads schedule from private table rather than having it queried from custom fields
 * When the rescheduler is done calculating a schedule it uses INSERT or UPDATE to write only changed tickets back to the private schedule table.
 * Changes to the schedule are stored in the schedle_history table.

This handles inserting initial schedule into DB and updating only changed tickets when rescheduling.

With the changes to TracPM.start(), .finish(), a caller (e.g., the Gantt chart) can:

 * Query tickets
 * Optionally schedule them
 * Iterate over them getting the start and/or finish dates

If the scheduling step is skipped, the dates from the database are used.

There's a potentially inefficiency in how potentially inactive tickets
are found.  We might get this set by first getting all the affected
tickets then following the predecessor links from the goal but there
isn't a function for that yet and preQuery() is fairly efficient.  I
don't want to optimize prematurely.

For this to work, I have to splice the in-memory ticket graph based on
ticket changes.

This has some gross code that is specific to plugins we use and makes
TracPM less portable but I want to prove this works before trying to
make it generic.

git-svn-id: 2159781fc7c14c6bdd1f7e265daf7a25099c31e7@12749 7322e99d-02ea-0310-aa39-e9a107903beb

trac-hacks/trac-jsGantt,trac-hacks/trac-jsGantt,trac-hacks/trac-jsGantt