public function getProject()
 {
     if ($this->project == null) {
         $prjd = new Project_Domain_Project();
         $this->project = $prjd->getById($this->project_id);
     }
     return $this->project == null ? new Project_Model_Project() : $this->project;
 }
Exemplo n.º 2
0
 /**
  * @return Project_Model_Project
  */
 public function getProject()
 {
     if (is_null($this->project) && !empty($this->project_id)) {
         $p = new Project_Domain_Project();
         $this->project = $p->getById($this->project_id);
     } else {
         $this->project = new Project_Model_Project();
     }
     return $this->project;
 }
 private function addProjects()
 {
     $this->addElement('select', 'project_id', array('required' => true, 'label' => 'Filter by project', 'dimension' => 6));
     $el = $this->getElement('project_id');
     $pd = new Project_Domain_Project();
     $projects = $pd->getAll();
     $el->addMultiOption(null, $this->translate->_('All projects'));
     foreach ($projects as $prj) {
         $el->addMultiOption($prj->getId(), $prj->getName());
     }
 }
Exemplo n.º 4
0
 private function _addProjectId()
 {
     $this->addElement('select', 'project_id', array('required' => false, 'label' => 'Projeto', 'dimension' => 6));
     $el = $this->getElement('project_id');
     $prjDomain = new Project_Domain_Project();
     $prj = $prjDomain->getByStatus(Project_Model_Project::PROJECT_STATUS_ACTIVE_ID);
     $el->addMultiOption(null, null);
     foreach ($prj as $proj) {
         $el->addMultiOption($proj->getId(), $proj->getName());
     }
     if ($this->_model && $this->_model->project_id) {
         $el->setValue($this->_model->project_id);
     }
 }
Exemplo n.º 5
0
 public function populate($data)
 {
     $this->_event = new Assistance_Model_Event($data);
     if (isset($data['id'])) {
         $this->_event->setId($data['id']);
     }
     if (isset($data['project_id']) && !empty($data['project_id'])) {
         $this->_event->setProject_id = $data['project_id'];
         $dc = new Project_Domain_Project();
         $c = $dc->getById($data['project_id']);
         $this->_event->setProject($c);
     } else {
         $this->_event->setProject_id(null);
     }
 }
Exemplo n.º 6
0
 public function pdfProjectAction()
 {
     if ($this->_isUserAllowed(null, NULL)) {
         $this->_helper->layout->disableLayout();
         $this->_helper->viewRenderer->setNoRender(true);
         $pd = new Project_Domain_Project();
         $project = $pd->getById($this->_getParam('id'));
         $this->view->project = $project;
         $content = $this->view->render('admin/pdf-project-cover.phtml');
         $pdf = new Agana_Print_Pdf_Report(Zend_Registry::get('Zend_Translate')->_('Project') . ' :: ' . $project->name, 'MELHOR VIVER', 'ONG ONLINE', $this->view->theme_path);
         $pdf->addPage($content);
         $fulldescription = $this->view->render('admin/pdf-project-fulldescription.phtml');
         $pdf->addPage($fulldescription);
         $pdf->download('project-' . $project->getName() . '.pdf');
     }
 }