示例#1
0
 public function testModele()
 {
     $opportunites = new Application_Model_Opportunities();
     $mailMerge = $opportunites->init_liveDocs();
     $file_doc = APPLICATION_PATH . "/../var/test/test.doc";
     $file_pdf = APPLICATION_PATH . "/../var/test/test.pdf";
     $mailMerge->setLocalTemplate($file_doc);
     $mailMerge->assign('intro__c', 'tested');
     $mailMerge->createDocument();
     $document = $mailMerge->retrieveDocument('pdf');
     file_put_contents($file_pdf, $document);
 }
 public function createallpdfAction()
 {
     // action body
     $lstId = $this->_getParam('selected_id', '');
     if ($lstId == '') {
         $compte_rendu[] = array('log' => 'Vous devez sélectionner des lignes!!');
     } else {
         $opportunities = new Application_Model_Opportunities();
         $compte_rendu = array();
         foreach ($lstId as $id) {
             if ($id == '') {
                 continue;
             }
             $compte_rendu[] = $opportunities->createDocx($id);
         }
     }
     $this->view->entries = $compte_rendu;
 }
示例#3
0
 public function opportunityAction()
 {
     // action body
     $id = $this->_getParam('id', 0);
     $code = $this->_getParam('code', '');
     $opportunities = new Application_Model_Opportunities();
     if ($id > 0) {
         $this->_helper->json($opportunities->createJson($id));
     }
     if ($code != '') {
         $code = trim($code);
         $where = "Code__c='" . $code . "'";
         $info = $opportunities->fetchAll('Id', $where);
         if (isset($info['opportunities'][0]['Id'])) {
             $id = $info['opportunities'][0]['Id'];
             $result = $opportunities->createJson($id);
             $this->_helper->json($result);
         } else {
             $this->_helper->json('');
         }
     } else {
         $this->_helper->json('');
     }
 }