canonicalize date/datetime cfs in ticket history and search results
show original text in editor when reediting

before we only show the error messages returned from server, which is bad for
user to correct.

I also tweaked error messages a bit so it won't affect the upcoming
submission, e.g. error messages from server could be:

    # Could not create ticket.
    # Foo: Unknown field

    Foo: bar

after tweaking, it becomes:

    # Could not create ticket.
    # Foo: Unknown field
    #
    #     Foo: bar

see also #22287
enable warnings globally in RT::Test as first thing

Our smoke testing system runs tests with -w flag, so
if you run tests with prove -vl with -w then you
may get different results or even failures.

Let's just enable them globally for tests.
Valid HTML for emailed dashboards

Commit b0ec8b3 added the opening <div> to satisfy the assumptions of
/Elements/Footer, but /Elements/Footer is not used when emailing the
dashboard due to RT::Dashboard::Mailer disabling Mason autohandlers.
This meant dashboard emails ended with the opening <div> and never
closed <body> or <html>.

Additionally the Footer and PageLayout *are* used when viewing
dashboards in the browser, so the extra opening <div> forced the footer
and remaining page content as a child of the "#body" div instead of a
sibling.

Fix this comedy of errors by properly closing the HTML document when in
email (with no footer) and letting the Footer close PageLayout's opened
"#body" div as expected when in the browser.
clean up global BrandedSubjectTag, which we missed in 3.9.7 upgrade script
Failing test demonstrating incorrect MIME word decoding with quotes

Extra quotes appear around MIME words containing special chars, such as
a comma.  See [rt3 #23813].
Avoid adding too many quotes around decoded MIME words

As demonstrated by the tests in the previous commit.

This case, and much more, is handled better by
4.2-on-4.0/protect-more-chars-while-decoding-headers, but that branch is
destined for 4.2.  For now, simply check the leading and trailing
snippets around the matched word for quotes.

See [rt3 #23813].
Failing tests showing MakeClicky incorrectly includes trailing punctuation
Limit the Admin Queues list to 50 rows per page by default

Otherwise instances with a large number of queues take forever to load
and display (such as rt.cpan.org).
Time::ParseDate::parsedate could return error message and we shall log it
Fix uninitialized value warning in RT::Principal::HasRight

HasRight was storing the cananicalized value of a passed-in Right
argument back in the argument hash, so the debug log output on an
invalid right had an uninitialized value rather than the invalid right
argument.

Use a temporary variable to store the canonicalized value, in case
canonicalization fails and we need access to the pre-canonicalized form.
Tests for right name canonicalization

Tests inserting into the database and pulling back out of the database.
Note that as RT::User->Load is used, the user/email must already exist
If __check_user returns false, attempting to use that value in a warning is pointless

Store the original user or group, and use that value in the warning.
Add a quick callback to allow you to stop an Approval

Useful to force people to provide a Note.
Show filename and line in syslog only when the level _is_ debug

… instead of only when it _isn't_.  The commit which introduced logging
to syslog, b5956dc, had this backwards from the start.
Log the process id at the beginning of each log line

This helps differentiate multiple web server processes when untangling
logs.  It's very useful for tracing mail flow more quickly.
A quick tool for pulling out the most useful lines relating to mail from an RT log
Don't check for strict/warnings if a shebang is OK and the shebang isn't perl

This prevents bogus strict/warnings tests on bash scripts, for instance.

The only file this change affects at the moment is
devel/tools/rt-parse-mail-log.
goto existing principal link directly if the principal is selected in "ADD USER" or "ADD GROUP"

usually admins can click a principal link directly to edit its rights, but if
one missed the link and used the input below "ADD USER" or "ADD GROUP"
instead, then it's treated like a principal without any right, which is kinda
misleading. this commit fixes it by automatically switching to existing links.