Elderly farmer shot burglar in the foot over suspected diesel theft, court hears