コード例 #1
0
ファイル: document_c.php プロジェクト: Diaosir/ziku
 public function view($page = 1)
 {
     $this->authority(50);
     $doc_table = new DocumentTable();
     $count = $doc_table->count();
     $page = Util::calculate_page($count, 10, $page);
     $docs = $doc_table->select_ten($page['start_num']);
     $view_data = array('docs' => $docs, 'page' => $page);
     $this->my_render('view', $view_data);
 }
コード例 #2
0
ファイル: actions.class.php プロジェクト: TheoJD/portail
 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);
 }
コード例 #3
0
ファイル: actions.class.php プロジェクト: TheoJD/portail
 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());
 }
コード例 #4
0
 public function getAllForTransaction($transaction)
 {
     $q = DocumentTable::getInstance()->createQuery('q')->where('q.transaction_id = ?', $transaction->getPrimaryKey());
     return $q;
 }