public function getExpertiseAreas($id) { $db = $this->getDefaultAdapter(); $sql = $db->select(); $sql->from('volunteer_expertise_area'); $sql->where('volunteer_id = ?', $id); $db->setFetchMode(Zend_DB::FETCH_ASSOC); $res = $db->fetchAll($sql); $areas = array(); $expdomain = new Staff_Domain_Expertisearea(); foreach ($res as $exp) { $areas[] = $expdomain->getById($exp['expertise_area_id']); } return $areas; }
private function _addElementExpertiseareas() { $this->addElement('MultiCheckbox', 'expertise_areas_id', array('required' => true, 'label' => 'Expertise areas', 'dimension' => 1)); $el = $this->getElement('expertise_areas_id'); $expd = new Staff_Domain_Expertisearea(); $exp = $expd->getAll('name'); foreach ($exp as $e) { $el->addMultiOption($e->getId(), $e->getName()); } $el->setSeparator('   '); $el->setAttrib('label_class', 'display-inline-block'); if ($this->_model) { $check = array(); foreach ($this->_model->getExpertisearea() as $key => $expItem) { $check[] = $expItem->id; } $el->setValue($check); } }
public function __construct() { $boot = Agana_Util_Bootstrap::getBootstrap('staff'); $boot = $boot->getOptions(); $this->_name = 'Staff'; $this->_navigation[] = array('icon' => 'icon-group', 'label' => 'Employees', 'module' => 'staff', 'controller' => 'employee', 'action' => 'list', 'route' => 'default', 'uri' => '', 'title' => ''); if (Staff_Domain_Volunteer::isControllerEnabled()) { $this->_navigation[] = array('icon' => 'icon-group', 'label' => 'Volunteers', 'module' => 'staff', 'controller' => 'volunteer', 'action' => 'list', 'route' => 'default', 'uri' => '', 'title' => ''); } $this->_navigation[] = array('icon' => 'icon-wrench', 'label' => 'Job function', 'module' => 'staff', 'controller' => 'jobfunction', 'action' => 'list', 'route' => 'default', 'uri' => '', 'title' => ''); if (Staff_Domain_Expertisearea::isControllerEnabled()) { $this->_navigation[] = array('icon' => 'icon-certificate', 'label' => 'Expertise area', 'module' => 'staff', 'controller' => 'expertisearea', 'action' => 'list', 'route' => 'default', 'uri' => '', 'title' => ''); } }