Review step for delegated tasks

Since 1.23.0 (#150480) a task has one of two shapes. Agent work runs under one account: the agent claims the task, works with Peter present and completes it with its claim token, so there is nothing to review. Delegated work involves two people: the author (the person who asked) and the doer (assigned_to). The doer’s "done" means "please check", not "closed".

Flow

  1. The doer marks the task done, on its page or with complete-assigned-task. LH_Tasks_task_actions_class::needs_review() decides: when the author is a different, existing account and the task was not created with requires_review false, it goes to Awaiting review (lh_tasks-revw_task), an open status. A doer who held only a claim becomes the hard assignment, so the task can come back to them.
  2. LH_Tasks_review_class tells the author by BuddyPress notification and email, with the doer’s note.
  3. The author, or staff (the task capability), accepts or sends back, from the task page’s Check this task forms or with review-task. Accept: Resolved, the doer recorded as assignee, the note (if any) stored as the result. Send back: New, still assigned to the doer, who is notified with the note (required).

Self-assigned tasks resolve directly, as before. While a task is Awaiting review, mark as done is refused and claims skip it. Dependents keep waiting until it is accepted, because only Resolved, Closed and Cancelled are terminal. Follow-ups remind the author while it waits; see Follow-ups for assigned tasks.

Hooks

Results

A task a person marks done, or a reviewer accepts, stores the note as result {note}. With no note, an old result holding only an error is removed, so a resolved task no longer shows a stale error. A needs_human hand-off no longer writes its note into result as an error: the note is in the progress log only.

Not yet

A wp-admin Complete action (list-table row action and an editor control) for assigned tasks is planned as a separate release.