private function _addElementPerson()
 {
     $translate = Zend_Registry::get("Zend_Translate");
     $url = new Zend_View_Helper_Url();
     $urlSearch = $url->url(array('module' => 'persons', 'controller' => 'person', 'action' => 'search-form'), null, true);
     $urlNew = $url->url(array('module' => 'persons', 'controller' => 'person', 'action' => 'create'), null, true);
     $append = '';
     $this->addElement('text', 'person_name', array('label' => 'Person', 'value' => $this->_model ? $this->_model->getPerson()->getName() : '', 'dimension' => 6, 'disabled' => true, 'placeholder' => $translate->_('Use the links aside to search a person or create a new one'), 'append' => $append . ' | ' . '<a class="hide" id="btnPersonDetails" href="#" rel="colorbox-details">' . $translate->_("Details") . '</a>' . ' | ' . '<a class="hide" id="btnPersonCreate" href="' . $urlNew . '" rel="colorbox">' . '<i class="icon-plus-sign" rel="tooltip" data-original-title="' . $translate->_("Add new") . ' ' . $translate->_("person") . '"></i>' . '</a>'));
 }
Пример #2
0
 /**
  * 
  * @param integer $id The person helped id
  * @return array Persons_Model_PersonHelpedSocialProject
  */
 public function getSocialProjectsByPerson($id)
 {
     $db = $this->getDefaultAdapter();
     $sql = $db->select('numero, nome, sigla, pfs_id, person.id')->from('person_programa_federal_social')->joinInner('person', 'person_programa_federal_social.person_id = person.id')->joinInner('programa_federal_social', 'person_programa_federal_social.pfs_id = programa_federal_social.id')->where('person_id = ?', $id)->order('programa_federal_social.nome');
     $db->setFetchMode(Zend_DB::FETCH_ASSOC);
     $r = $db->fetchAll($sql);
     $socialProjects = array();
     foreach ($r as $person_sprj) {
         $p = new Persons_Model_PersonHelpedSocialProject();
         $p->setPerson_id($id);
         $p->setPfs_id($person_sprj['pfs_id']);
         $p->setNome($person_sprj['nome']);
         $p->setSigla($person_sprj['sigla']);
         $p->setNumero($person_sprj['numero']);
         $socialProjects[] = $p;
     }
     return $socialProjects;
 }