Code formatting, no functional changes
Move creation of link transactions from RT::Ticket into RT::Record

Now articles and other objects will record transactions for links.
Refactor our link type and direction maps into RT::Link

A single definition is much cleaner and easier to maintain than
duplicates scattered among the classes or pointers into RT::Ticket.

Any existing non-core code which needs the maps will need to be updated
to point to RT::Link.
Remove hardcoded duplicate types from CreateTickets.pm

Provides a convenience method, RT::Link->DisplayTypes, for extracting
the canonical directional link types from the (for now) public RT::Link
data structures.

The link data structures sorely want to be refactored even harder into
an API.
Support singular link types for ticket creation

The singular forms are more intuitive than the plurals when dealing with
a single link.
Use our link maps instead of hardcoding link type pairs
Refactor processing %ARGS for new links during record creation

The inputs processed are generated by /Elements/EditLinks and may be
used by object types other than tickets.  Refactoring into a function
lets other objects re-use the same code.
Only link relationship labels to ticket searches when editing ticket links

EditLinks supports other object types than RT::Ticket and shouldn't
display nonsensical links to ticket searches when the object in question
isn't a ticket.

Pass Object to ShowRelationLabel instead of id so ShowRelationLabel can
make a more informed decision about display.
Provide a callback for extensions to modify the relationship label link

This lets any extensions using ShowLinks/EditLinks for objects other
than tickets to link the labels as they see fit.
ShowLinks: Consolidate generation of Clone links and use RT::Link API
ShowLinks: Construct clone links only if the current user can CreateTicket

Instead of separating the CreateTicket check from the URL construction,
simply skip constructing any clone URLs if the user can't CreateTicket
and conditionalize the display of clone links on the presence of the
constructed URLs themselves.

A cleaner separation of concerns is useful in preparation for ShowLinks
working on other objects other than Tickets.
ShowLinks: Work with any object that isa RT::Record, not just RT::Ticket

One less not-actually-generic component in the top-level /Elements/ tree.

There is still a lot of room for more refactoring, simplification, and
consistency.
ShowLinks: Refactor to remove a lot of repetition

Removes the useless ShowParents element.  Moves most RT::Link loop and
display logic into a separate component, ShowLinksOfType, where it's
easier to make consistent changes.
ShowLinksOfType: Add a callback to allow changing $Recurse and $MaxDepth

It is sometimes useful to recurse on link types other than just
Children.
ShowLinks: Sort links in all relationship types as not tickets, active, or inactive

It's useful to see inactive linked tickets last as well as to have an
overall consistent ordering.
ShowLinks: Not all RefersTo links have a LocalTarget; weed out undefined values
Merge branch '4.2/link-api-refactoring'

Conflicts:
	lib/RT/Interface/Web.pm
	lib/RT/Record.pm
	share/html/Elements/ShowLinks