Can someone please explain how this circuit works
This circuit give the user the choice of how the laser is drive :


In the 1st position (switch is as the drawing), the voltage coming from the jack + transformer lead will trigger the transistor and then power or not the laser diode. So the state of the diode depend of the voltage coming from the jack.
In the 2nd position, the laser diode is always power on because it's directly connected to the 7805 (5V voltage regulator)