Global Types for Open Systems