United Airlines moved to the brink Wednesday of getting a final go-ahead to leave bankruptcy, winning court approval for its controversial management stock plan and resolving differences with its combative flight attendants’ union.

With all big issues out of the way on the first day of a court hearing on its reorganization plan, a bankruptcy judge is expected to sign off on the plan at the end of the week.