Dynamical phase diagram of a one-dimensional Bose gas in a box with a tunable weak link: From Bose-Josephson oscillations to shock waves