}
 }
 if (preg_match('#^V. testo #', $last_status->getNota())) {
     $tmpfase = explode('V. ', $last_status->getNota());
     if (substr_count($last_status->getOppEmendamento()->getNumfase(), "(") > 0) {
         $numero_fase = explode("(", $last_status->getOppEmendamento()->getNumfase());
         $numero_fase = trim($numero_fase[0]);
     } else {
         $numero_fase = $last_status->getOppEmendamento()->getNumfase();
     }
     $c = new Criteria();
     $c->addJoin(OppEmendamentoPeer::ID, OppAttoHasEmendamentoPeer::EMENDAMENTO_ID);
     $c->add(OppEmendamentoPeer::SEDE_ID, $last_status->getOppEmendamento()->getSedeId());
     $c->add(OppEmendamentoPeer::NUMFASE, $numero_fase . " (" . $tmpfase[1] . ")");
     $c->add(OppAttoHasEmendamentoPeer::ATTO_ID, $relatedAttos[0]->getOppAtto()->getId());
     $collegato = OppEmendamentoPeer::doSelectOne($c);
     if ($collegato) {
         $c = new Criteria();
         $c->addJoin(OppEmendamentoHasIterPeer::EM_ITER_ID, OppEmIterPeer::ID);
         $c->add(OppEmendamentoHasIterPeer::EMENDAMENTO_ID, $collegato->getId());
         $status_coll = OppEmIterPeer::doSelectOne($c);
         $link_collegato = link_to($last_status->getNota(), '/emendamento/' . $collegato->getId());
         if ($status_coll) {
             $link_collegato = $link_collegato . " (" . $status_coll->getFase() . ")";
         }
     }
 }
 if ($last_status->getOppEmIter()->getFase() != 'Altro') {
     echo " (" . $last_status->getNota() . ")";
 } else {
     if ($link_collegato == "") {