A Current Affair illegally recorded ex-mayor's plan to hit prostitute, court told