"Urgent" repairs to cells and an immediate review of CCTV are to be carried out at a prison so "dilapidated" an inmate managed to "remove his own cell door".