Magnetic transition in orbitally ordered KCuF3, K2CuF4 and heterovalently substituted compounds