The ESO nearby Abell cluster survey. IX. The morphology-radius and morphology-density relations in rich galaxy clusters