Influence of trapping potentials on the phase diagram of bosonic atoms in optical lattices