Allow disabling line highlighting on click in `PhabricatorSourceCodeView`

Summary:
There may be times when we don't want lines in some embeded source
code to be highlighted on click, this adds that functionality.

Also use the functionalty in `PasteEmbedView`

Test Plan:
- View paste, make sure everything works.
- Embed paste in comment, make sure everything works apart from click hl

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Maniphest Tasks: T3881

Differential Revision: https://secure.phabricator.com/D7111
Remove ManiphestAuxiliaryFieldSpecification

Summary: Ref T2217. This legacy writer is no longer called.

Test Plan: `grep`

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2217

Differential Revision: https://secure.phabricator.com/D7112
Remove ManiphestTransactionType

Summary: These constants have moved to ManiphestTransaction. The other method only has one plausible callsite, just inline it.

Test Plan: Used Maniphest.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7113
Restore some missing features from Maniphest mail

Summary:
Ref T2217. Fixes two issues:

  # The "task created" email didn't include the task description, but should.
  # We were treaging the "status" event as the "create", but that's kind of a mess. Treat the "title" event as the "create" instead. This makes initial emails say "[Created]".

Test Plan: Created some tasks, got better emails.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2217

Differential Revision: https://secure.phabricator.com/D7115
Allow standard date fields to read default dates as strings

Summary: Ref T2217. Fixes T3866. We need to do a little more massaging before we can set strings as the value on datetime controls.

Test Plan: Set default to "1:23 AM", "2001/02/03".

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2217, T3866

Differential Revision: https://secure.phabricator.com/D7116
Remove a bunch of reundant checks for transactions with no effect from Maniphest

Summary: Ref T2217. These checks are no longer necessary, ApplicationTransactions handle them for us.

Test Plan:
  - Made a no-effect edit, verified no new transactions showed up.
  - Made real edits, saw them happen and leave transactions.
  - Made an edit which just reorders CCs, saw it detected as no-effect.
  - As above, with projects.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2217

Differential Revision: https://secure.phabricator.com/D7117
Add viewPolicy, editPolicy storage to tasks

Summary: Ref T603. Adds storage for custom policies.

Test Plan: Ran storage upgrade. Created and edited tasks.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D7118
Move PHUIFormBoxView to PHUIObjectBoxView

Summary: I'd like to reuse this for other content areas, renaming for now. This might be weird to keep setForm, but I can fix that later if we need.

Test Plan: reload a few forms in maniphest, projects, differential

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D7120
Add herald support for Maniphest

Summary:
standing on the shoulders of the badass work to move Maniphest to ApplicationTransactions, this diff implements a few methods and adds an adapter class.

For now, we can add cc and flag tasks. I figure see what people ask for?  Ref T1368.

Test Plan: created herald rules for title and description text hits. made tasks and verified CC and flags worked.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Maniphest Tasks: T1368, T1638

Differential Revision: https://secure.phabricator.com/D7122
Padding on Maniphest status

Summary: adds padding to the maniphest status subheader

Test Plan: see padding in inspect element

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D7125
Allow draggable elements to be dragged to the first list position

Summary:
Currently, draggable lists (in Config and ApplicationSearch, for example) don't let you drag an item into the first position.

This is because the behavior is correct in Maniphest: the first position is above an initial header, like "High Prioirty", and shouldn't be targetable.

Permit the behavior in general; forbid it in Maniphest.

Test Plan:
  - Dragged elements into the first position in ApplicationSearch.
  - Failed to drag elements into the first position in Maniphest.

Reviewers: garoevans, btrahan

Reviewed By: garoevans

CC: aran

Differential Revision: https://secure.phabricator.com/D7128
Show full names for attached diffs and tasks in email in Maniphest

Summary:
Ref T2217. Use `getLinkName()` instead of `getName()` so that we get, e.g.,

  alincoln attached a revision: D123 Chop some logs

...instead of:

  alincoln attached a revision: D123

Test Plan: Attached stuff, looked at the email, saw full object name.

Reviewers: btrahan, asherkin

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2217

Differential Revision: https://secure.phabricator.com/D7127
Use ManiphestTaskQuery in nearly all interfaces

Summary:
Ref T603. Make almost every task read policy-aware. Notable exceptions are:

  - Edge editor -- this stuff is prescreened and should be moved to ApplicationTransactions eventually anyway.
  - Search/attach stuff -- this stuff needs some general work. The actual list should be fine since you can't pull handles. There may be a very indirect hole here where you could attach an object you can't see (but do know the ID of) to an object you can see. Pretty fluff.
  - The "Tasks" field in Differential will let you reference objects you can't see. Possibly this is desirable, in the case of commandeering revisions. Mostly, it was inconvenient to get a viewer (I think).

Test Plan:
  - Called `maniphest.info`.
  - Called `maniphest.update`.
  - Batch edited tasks.
  - Dragged and dropped tasks to change subpriority.
  - Subscribed and unsubscribed from a task.
  - Edited a task.
  - Created a task.
  - Created a task with a parent.
  - Created a task with a template.
  - Previewed a task update.
  - Commented on a task.
  - Added a dependency.
  - Searched for "T33" in object search dialog.
  - Created a branch "T33", ran `arc diff`, verified link.
  - Pushed a commit with "Fixes T33", verified close.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D7119
Remove obsolete code from ManiphestTaskQuery

Summary:
Ref T603. Cleans up some obsolete stuff here:

  - We no longer ever query by min/max priority (instead, `withPriorities(...)`).
  - A parent class provides limit/offset.
  - Result count is no longer reliable with policies. We could do "about X tasks" or something, but just drop it for now. There's only one remaining callsite anyway.

Test Plan:
  - `grep`
  - Viewed task list.
  - Viewed a project page.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D7121
Allow task policies to be edited from the UI; show policy information on the detail page

Summary:
Ref T603. Adds policy controls to the task edit UI.

@chad, status + policy renders a little weird -- did I mess something up? See screenshot.

Test Plan: Edited policies, viewed a task.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D7123
Make Maniphest detail page react to viewer capabilities

Summary:
Ref T603. Disable things the user can't use, allow logged-out users to get a reasonable version of the page.

Also allow logged-out users to view edit history of comments if they're able to see the object.

Test Plan: Viewed Maniphest detail as a logged-out user, got a largely sensible page.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D7124
Make Maniphest list page react to viewer capabilities

Summary:
Ref T603. Basically:

  - Hide "Reports".
  - Hide "batch edit" and "export to excel".
  - Hide reprioritization controls.
  - I left the edit controls, they show a "login to continue" dialog when hit.
  - Allow tokenizer results to fill for public users.
  - Fix a bug where membership in projects was computed incorrectly in certain cases.
  - Add a unit test covering the project membership bug.

Test Plan: Viewed /maniphest/ when logged out, and while logged in.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D7126
Clean up Maniphest email "to"

Summary:
We currently try to send Maniphest email "To" the owner and actor, but for unassigned tasks there is no owner.

Just filter the PHIDs in the parent, since it's reasonable for subclasses to be liberal about construction here.

Test Plan: Commented on an unassigned task, got an email without a bogus "To".

Reviewers: btrahan, asherkin

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7129
Make most repository reads policy-aware

Summary: Ref T603. This swaps almost all queries against the repository table over to be policy aware.

Test Plan:
  - Made an audit comment on a commit.
  - Ran `save_lint.php`.
  - Looked up a commit with `diffusion.getcommits`.
  - Looked up lint messages with `diffusion.getlintmessages`.
  - Clicked an external/submodule in Diffusion.
  - Viewed main lint and repository lint in Diffusion.
  - Completed and validated Owners paths in Owners.
  - Executed dry runs via Herald.
  - Queried for package owners with `owners.query`.
  - Viewed Owners package.
  - Edited Owners package.
  - Viewed Owners package list.
  - Executed `repository.query`.
  - Viewed "Repository" tool repository list.
  - Edited Arcanist project.
  - Hit "Delete" on repository (this just tells you to use the CLI).
  - Created a repository.
  - Edited a repository.
  - Ran `bin/repository list`.
  - Ran `bin/search index rGTESTff45d13dffcfb3ea85b03aac8cc36251cacdf01c`
  - Pushed and parsed a commit.
  - Skipped all the Drydock stuff, as it it's hard to test and isn't normally reachable.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D7132