Investigation of ultrafast photoinduced processes for salicylidene aniline in solution and gas phase: toward a general photo-dynamical scheme