The role of environment on the star formation history of disc galaxies