Example #1
0
 /**
  * Remove faxs
  *
  * @param \Enigmatic\CRMBundle\Entity\CampaignFaxingFax $faxs
  */
 public function removeFax(\Enigmatic\CRMBundle\Entity\CampaignFaxingFax $faxs)
 {
     $this->faxs->removeElement($faxs);
 }
 /**
  * @Secure(roles={"ROLE_CA"})
  */
 public function downloadAction(CampaignFaxingFax $fax)
 {
     if (!$this->get('enigmatic_crm.service.grant')->grantCampaignFaxing($fax->getCampaign())) {
         throw new AccessDeniedException();
     }
     $fichier = $fax->getAbsolutePath();
     $filename = 'fax.' . substr(strrchr($fichier, '.'), 1);
     return new Response(file_get_contents($fichier), 200, array('Content-Type' => 'application/force-download', 'Content-disposition' => 'filename=' . $filename));
 }