Ejemplo n.º 1
0
 public function delete()
 {
     if ($this->_isAllowed()) {
         try {
             $u = new Staff_Persist_Dao_Employee();
             return $u->delete($this->_employee->getId());
         } catch (Exception $e) {
             throw $e;
         }
     }
 }
Ejemplo n.º 2
0
 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 = '';
     if ($this->_action == self::ACTION_ADD) {
         $append .= '<a id="btnPersonSearch" href="' . $urlSearch . '" ' . ' rel="colorbox-search" search-return-id="id" search-return-value="person_name">' . '<i class="icon-search" rel="tooltip" data-original-title="' . $this->translate->_("Search person") . '"></i>' . '</a>';
     }
     $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">' . $this->translate->_("Details") . '</a>' . ' | ' . '<a class="hide" id="btnPersonCreate" href="' . $urlNew . '" rel="colorbox">' . '<i class="icon-plus-sign" rel="tooltip" data-original-title="' . $this->translate->_("Add new") . ' ' . $this->translate->_("person") . '"></i>' . '</a>'));
 }