Error handling for text and HTML quote extraction when displaying attachments

Improves the error message by adding the attachment ID and directs bug
reports to rt-bugs@bestpractical.com.
RT::CurrentUser objects should access Attributes as an RT::User

Otherwise attributes on the user object aren't found when accessed via
an equivalent current user object.

A larger, more invasive 4.2 fix for this should be introducing an
_ObjectType method or similar which is provided by the superclass and
used instead of ref().
Allow searching for @hostname.tld to find all requestors at that domain
Anchor the upgrade directory regex to avoid potential false positives

This means we can't use upgrade directories named like
rt-4.1.13-18-gf349104, but that's okay.
Bail if it looks like --datadir is wrong during upgrade
Always filter empty strings out of OrderBy

Older OrderBy saved search preferences (which are arrays) may contain
empty strings.  Passing them to OrderByCols() can cause invalid SQL.
fix change custom field value case

Comparing the lowercased version of the old and new value prevents
changing the case of a custom field value.
Document new @domainname.com syntax for simple search
Merge branch '4.0/simplesearch-domain' into 4.0-trunk
Make sure we don't numerically compare ""

RTIR submits an input=text with the same name as the Checkbox.
Fixing RTIR to stop doing that turns out to be more interesting than
just squashing the warning.
Allow an extension to use --action upgrade with different wording

This allows RTIR to use the magic version-parsing code and friendly
wording without it confusingly asking for your RT version.

Future proof using --package which master uses to store the upgrade
steps in the database.
extract attachments processing in REST into lib
extract form editor loop into a sub for error checks

Extracts form editor with loop into vi_form_while function
that takes text and a callback, so callback can check errors
and keep asking user to fix problems.

Use it in comment command and check files existance in the callback.
REST: make it possible to attach files on create

Now ticket create form has Attachment field and
it's possible to use set attachment=foo.txt from
command line.
Merge branch '4.0/currentuser-attributes' into 4.0-trunk
Merge branch '4.0/customize-upgrade-wording' into 4.0-trunk
Default to the "attachment" disposition when none is specified

Attachments received to RT via email usually have a Content-disposition
header, which we continue to respect.

However, attachments uploaded via the web will not and rely on the
default here in AddAttachment().  Previously we relied on MIME::Entity's
default, but it is not appropriate to assume all files are inline-able.

Indeed, common sense dictates that attachments be treated as
attachments, which is in line with user expectations.  Lenient MUAs
which don't always respect the inline disposition have kept us from
noticing when RT sends mail demanding PDFs, sound files, and other
binaries are inlined.
Merge branch '4.0/non-numerical-checkbox-id-warnings' into 4.0-trunk
Merge branch '4.0/rest-attachments-on-create' into 4.0-trunk
Merge branch '4.0/error-handling-for-quote-extraction' into 4.0-trunk