예제 #1
0
 private function _line(Intervention $entity)
 {
     $types = array('fixing' => 'Dépannage', 'maintenance' => 'Entretien', 'work' => 'Travaux');
     $dayTrans = array('dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi');
     $datas[0] = $dayTrans[$entity->getClose()->format('w')] . chr(10) . $entity->getClose()->format('d/m/Y');
     $datas[1] = $entity->getDoor()->getTrustee();
     $datas[2] = $entity->getDoor()->getSite()->getAddress() . '';
     $datas[3] = $types[$entity->getType()];
     $datas[4] = $entity->getContract() == 'Hors contrat' ? 'HC' : $entity->getDynContract();
     $datas[5] = $entity->getReason();
     $datas[6] = 'Rapport :' . chr(10) . $entity->getReport();
     if ($entity->getRest()) {
         $datas[6] .= chr(10) . chr(10) . 'Reste à faire :' . chr(10) . $entity->getRest();
     }
     $this->row($datas, 5, 1, false);
 }
 /**
  * Finds and displays a Intervention entity.
  *
  * @Secure(roles="ROLE_USER")
  */
 public function redirectAction(Intervention $entity, $act)
 {
     if (in_array($act, array('show', 'edit', 'close'))) {
         return $this->redirect($this->generateUrl($entity->getType() . '_' . $act, array('id' => $entity->getId())));
     }
     throw $this->createNotFoundException('Page inexistante');
 }