function showRespondentReassign($primkey) { $household = new Household($primkey); $oldurid = $household->getUrid(); $newurid = loadvar('uridsel'); $display = new Display(); if ($household->getUrid() != $newurid) { //check for double submit -> not yet assigned to this urid $household->setUrid($newurid); //for local! $household->saveChanges(); $respondents = $household->getRespondents(); foreach ($respondents as $respondent) { $respondent->setUrid($newurid); $respondent->saveChanges(); } $communication = new Communication(); $communication->reassignHousehold($household, $oldurid, $newurid); return $this->showInterviewer($display->displayInfo(Language::labelSupervisorHouseholdReassigned())); } else { return $this->showInterviewer($display->displayInfo(Language::labelSupervisorHouseholdNotReassigned())); } }