/** * Called after the check that all required registry values * have been set correctly has run. * * @return void */ public function afterRegistry() { parent::afterRegistry(); if (!$this->user) { $this->user = $this->loader->getCurrentUser(); } }
public function afterRegistry() { parent::afterRegistry(); $this->setIfExists('gof_form_id', 'label', $this->translate->_('FormID')); $this->setIfExists('gof_form_version', 'label', $this->translate->_('Version')); $this->setIfExists('gof_form_title', 'label', $this->translate->_('Name')); $this->setIfExists('gof_form_active', 'label', $this->translate->_('Active'), 'elementClass', 'checkbox'); }
/** * Called after the check that all required registry values * have been set correctly has run. * * @return void */ public function afterRegistry() { parent::afterRegistry(); $this->addColumn($this->util->getTokenData()->getStatusExpression(), 'status'); if (!$this->request instanceof \Zend_Controller_Request_Abstract) { $this->request = \Zend_Controller_Front::getInstance()->getRequest(); } }
/** * Called after the check that all required registry values * have been set correctly has run. * * @return void */ public function afterRegistry() { parent::afterRegistry(); $allowedGroups = $this->loader->getCurrentUser()->getAllowedStaffGroups(); if ($allowedGroups) { $expr = new \Zend_Db_Expr(sprintf("CASE WHEN gsf_id_primary_group IN (%s) THEN 1 ELSE 0 END", implode(", ", array_keys($allowedGroups)))); } else { $expr = new \Zend_Db_Expr('0'); } $this->addColumn($expr, 'accessible_role'); $this->set('accessible_role', 'default', 1); }
/** * Called after the check that all required registry values * have been set correctly has run. * * This function is no needed if the classes are setup correctly * * @return void */ public function afterRegistry() { parent::afterRegistry(); $this->addColumn(new \Zend_Db_Expr(sprintf("CASE WHEN gla_by IS NULL THEN '%s'\n ELSE CONCAT(\n COALESCE(gsf_last_name, '-'),\n ', ',\n COALESCE(CONCAT(gsf_first_name, ' '), ''),\n COALESCE(gsf_surname_prefix, '')\n )\n END", $this->_('(no user)'))), 'staff_name'); $this->addColumn(new \Zend_Db_Expr(sprintf("CASE WHEN grs_id_user IS NULL THEN '%s'\n ELSE CONCAT(\n COALESCE(grs_last_name, '-'),\n ', ',\n COALESCE(CONCAT(grs_first_name, ' '), ''),\n COALESCE(grs_surname_prefix, '')\n )\n END", $this->_('(no respondent)'))), 'respondent_name'); }