Exemplo n.º 1
0
 public function executeDeleteFromTransaction(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($document = DocumentTable::getInstance()->find(array($request->getParameter('id'))), sprintf('Object document does not exist (%s).', $request->getParameter('id')));
     $this->checkAuthorisation($document->getAsso());
     $transaction = $document->getTransaction();
     $document->deleteAndUnlink();
     $this->redirect('transaction_show', $transaction);
 }
Exemplo n.º 2
0
 public function executeShow(sfWebRequest $request)
 {
     $this->transaction = $this->getRoute()->getObject();
     $this->checkAuthorisation($this->transaction->getAsso());
     $this->documents = DocumentTable::getInstance()->getAllForTransaction($this->transaction)->execute();
     $document = new Document();
     $document->asso_id = $this->transaction->getAssoId();
     $document->transaction_id = $this->transaction->getPrimaryKey();
     $this->form = new DocumentForm($document);
     $this->getResponse()->setSlot('current_asso', $this->transaction->getAsso());
 }
Exemplo n.º 3
0
 public function getAllForTransaction($transaction)
 {
     $q = DocumentTable::getInstance()->createQuery('q')->where('q.transaction_id = ?', $transaction->getPrimaryKey());
     return $q;
 }