Add option for hidng closed sections on class change grid

This is a local change from MIT Splash 2012.  The 'manage class' page can
be used to disable registration for a particular class section without
cancelling or notifying its students.  This causes the registration_status
field on the ClassSection object to be set to 10; the default value of 0
means that registration functions normally.  Previously, all sections were
showing up in the onsite class change grid, even if their registration was
closed; however, trying to add a student to one of those sections failed.
This commit adds an option to show/hide those sections, and they are
hidden by default to avoid confusion.
Merge branch 'price-sr3' of audionest.org:/apps/git/esp-project into price-sr3
Add ability to send schedules without room numbers

This adds a new smart text variable, {{ program.student_schedule_norooms
}}, to the comm panel.  It does the same thing as the normal student
schedule, except that the third column of the table ("Room") is excluded.
This should address issue #385.
Remove unnecessary template library load in adminclass/listclasses.html
Add selectable sort criteria to dashboard class list

This adds a dropdown box with some possible criteria like "Name", "ID",
and "Status"; changing the selection causes the sorttable_customkey
attributes of all the table rows to be rewritten, so that the next time
you click on the column header sorttable can order the classes the way you
want them to be ordered.

The "Size" and "Special Requests" options are crudely implemented but in
this case I felt something would be better than nothing.  Please let me
know if you think they should be taken out.
Make availability module required by default

This will help ensure that teachers are shown the availability form before
submitting their first class (or after, if the sequence numbers are set
appropriately).
Add UserAvailability cache dependency for JSON sections view

The Ajax scheduler wasn't noticing when a teacher's availability was
changed.  Adding this dependency fixes that.  If this proves to be too
much of a performance hit, then we can reconsider.
Add role option to ESPUser.addAvailableTime()

I noticed some UserAvailability objects getting created with the Volunteer
role instead of the Teacher role.  To fix that, I made
ESPUser.addAvailableTime() explicitly set the role on each
UserAvailability object it creates. I think we are only using this function
for the Teacher role, so I made that the default.
Send e-mails to teachers when their availability gets forced

I'm not sure how much this feature gets used, but we have a view that sets
the availability of all teachers that have infeasible schedules (not
enough availability to teach the classes they signed up for).  Since this
may still be desired in some circumstances, I made it e-mail the teachers
so they know what's going on.
Clarify survey review_single page

This change adds explanatory text to the template, which helps explain to
teachers why so many of them are blank (only responses pertinent to their
classes are shown).  Furthermore, I added links to the survey responses
for their class.
Fix link to individual survey reviews on survey summary page
Hide confirm button on student reg page if confirmation is not allowed

This change checks the Student/Confirm bit and hides the confirm button at
the bottom of the main student reg page if it is not set.  Note that
students can still access the confirmation view by clicking the 'Confirm
Registration' link (in the list of steps at the top of the page) if the
StudentRegConfirm module is included.

Addresses issue #414.
Tweak behavior of AjaxForeignKeyNewformField

If a value was preloaded into the AjaxForeignKeyNewformField, and the user
manually cleared the text (or typed something and failed to select from
the resulting autocomplete options), the underlying value would not be
changed; this isn't consistent with what the user sees.  This happened
even when the initial value was "null".

To make the behavior more intuitive, I changed it so the underlying (e.g.
foreign key) value is cleared whenever the text in the text box gets
changed; it can then be reassigned by selecting from the autocomplete list.

The disadvantage of this is that it's easier to clear the school selected
on the student profile... but hopefully there will be less confusion.
Make class_subjects JSON view robust to missing duration
Fix Javascript error in dashboard

The sorttable init code was hitting an error because the 'Loading
classes...' message only occupied one column, whereas the table has a
total of 7 columns.  (It was trying to guess the data type of columns for
which there was no <td> in the table body at the time.)  Making the <td>
wider seems to do the trick.
Add SplashInfo statistics to Ajax admin vitals

This adds to Anthony's changes in pull request #517, by modifying the JSON
stats view to include a summary of SplashInfos for the program.  The
changes in #517 should also be included because they allow the students in
particular categories to be contacted using the comm panel.

Addresses issue #284.
Invalidate entire TemplateOverride cache when any one is saved

This should cause all templates to be updated when you change an override.
Previously, if you changed an override that was included in other
templates, it would not affect the parent templates.

Addresses issue #302.
Add migration to make availability module required (see a290929)
Fix to teachers' survey/review_single view

For historical reasons, we have survey questions (and answers) that anchor
on ClassSections, and we also have some that anchor on ClassSubjects.
When I made the changes addressing ticket #488, I tested only with my own
survey responses, which (because they were from old programs) were
anchored only on ClassSubjects.  As Gurtej found, this still didn't work
if you had survey responses for a more recent program.  This change
collects survey responses anchored to the combination of their previously
taught sections and previously taught classes, so that there is always
something to see when you click on a survey response link.
Fix bugs in dashboard table sorting

Now, when you change the sort mode on the dashboard, the table will be
sorted according to the mode (you don't have to click a column header to
update).

There were also some issues causing Javascript errors in sorttable when
the functions were called at page load, which I've worked around.