Display and add attachments in alphabetical order by name

Without any sorting, the ordering is random and determined by Perl's
internal hash key/value ordering.  While preserving upload order would
probably be best for the cases touched in this commit, it would require
a more invasive or hackish change not suitable for the 4.0 series.

We already display attachments in alphabetical order in the ticket
metadata.  Extend that same consistent ordering to the attachments list
during ticket create/update and when adding the attachments to the
create/update MIME entity.
Merge branch '4.0/report-ticketsql-errors' into 4.0-trunk
mark __Bookmarks__ as deprecated

__Bookmarks__ was to be removed in 4.2 but the user was never warned
in 4.0, so marking the feature deprecated for 4.2 and will be fully
removed later

see issues#20297
Add newlines into debug output from mail-gateway, and thus rt-mailgate

These newlines were unintentionally and silently removed in a2b50db, and
cause the output from rt-mailgate to be jumbled together on one line.
Insert newlines to make understanding them simpler.
Fix time slider to range 0-24 instead of 0-12,0-12

In the timepicker widget, as of version 1.1 and above (RT upgraded to
1.2 in a3de102), a format of "hh" is 12-hour time, not 24-hour time.
This caused the value inserted by the slider to only range from 0-12.
Properly insert 24-hour times by using "HH" in the format instead of
"hh".
Note the RT::Attribute id which contains the deprecated __Bookmarks__ syntax

Without it, any admin trying to track down the deprecated syntax will be
pretty frustrated.
Correct a misspelling in log messages
Clean orphaned session file locks more aggressively

When using file-based sessions, lock files are orphaned once the session
is deleted through any call to tied(%session)->delete, such as logging
out.  These lock files continue to accumulate until the session cleaner
eventually picks them after a set age.

Over the course of even a relatively short, and common, 7 day max age
limit, the accumulated orphaned locks on a busy site (combined with all
the active sessions + locks) can bloat the size of the session directory
beyond the capacity of a standard ext3/4 filesystem directory entry.
Once this happens, sessions will start to fail sporadically with "No
space left on device" errors, despite plenty of disk space being
available.

Once a lock file is orphaned, it is safe to delete regardless of its
age.  Aggressively remove such locks whenever the session cleaner runs.

Arguably this should be handled inside Apache::Session when ->delete is
called.  Until then, the extra cleaning is simple to implement.
codes can mean other errors

We switched from matching errstr to codes, but codes are shared
between a few errors, so our guess about problem can be wrong.

Assume that in most cases guess is correct, but still publish
DB's error message.
Add SelectObject callback for modifying collection
Merge branch '4.0/fulltext-indexer-errors' into 4.0-trunk
Rename quoting tests to avoid a filename conflict upon merge
Update RT perl dependency to 5.10.1

Consistently use eval{require ...} to check perl version
for best backward compatibility and standardize
error message in rt-test-dependencies and RT.pm.
Add docs on managing Perl for RT
Remove an extra "my" which causes "masks earlier declaration in same scope" warnings
Merge branch '4.0/text-wrap-and-quoting-long-lines' into 4.0-trunk

Conflicts:
	lib/RT/Transaction.pm
Merge branch '4.0/session-store-failure' into 4.0-trunk
Merge branch '4.0/file-based-session-locks' into 4.0-trunk
Merge branch '4.2/deprecate-bookmarks-syntax'
remove ability to update resolved date

The bulk updater lets you set the resolved date, but its generally
assumed that the only reason this is set is because the ticket has
been resolved at some point. This commit removes the bulk updater's
ability to set resolved date.

see issues#20302