/** * Construct */ public function __construct() { // initialize dao parent::__construct(MysqlConfig::getInstance()); // set default dao settings $this->_bindDb(self::DB_NAME); }
/** * Construct * Init the acl object * @return unknown */ public function __construct() { // add roles for acl $roleDao = Ihush_Dao::load('Core_Role'); $roles = $roleDao->getAllRoles(); foreach ((array) $roles as $role) { if (!isset($role['id'])) { continue; } $this->addRole(new Zend_Acl_Role($role['id'])); } // add app for acl $appDao = Ihush_Dao::load('Core_App'); $apps = $appDao->getAllApps(); foreach ((array) $apps as $app) { if (!strlen($app['path'])) { continue; } $this->add(new Zend_Acl_Resource($app['path'])); } // add app and role's relation for acl $aclApps = $appDao->getAclApps(); foreach ((array) $aclApps as $acl) { if (!strlen($acl['role'])) { continue; } if (!strlen($acl['path'])) { continue; } $this->allow($acl['role'], $acl['path']); } // add resource for acl $resourceDao = Ihush_Dao::load('Core_Resource'); $resources = $resourceDao->getAllResources(); foreach ((array) $resources as $resource) { if (!strlen($resource['name'])) { continue; } $this->add(new Zend_Acl_Resource($resource['name'])); } // add resource and role's relation for acl $aclResources = $resourceDao->getAclResources(); foreach ((array) $aclResources as $acl) { if (!strlen($acl['role'])) { continue; } if (!strlen($acl['resource'])) { continue; } $this->allow($acl['role'], $acl['resource']); } }
public function getDetails($reqId) { $sql = $this->select()->from($this->t1, array("{$this->t1}.*", "{$this->t2}.*", "{$this->t3}.bpm_node_name", "{$this->t6}.name as author_name"))->join($this->t3, "{$this->t1}.{$this->k3} = {$this->t3}.{$this->k3}", null)->join($this->t6, "{$this->t1}.author_id = {$this->t6}.{$this->k6}", null)->joinLeft($this->t2, "{$this->t1}.{$this->k1} = {$this->t2}.{$this->k2}", null)->where("{$this->t1}.{$this->k1} = ?", $reqId); $data = $this->dbr()->fetchRow($sql); // get field name hash $bpmModelDao = Ihush_Dao::load('Core_BpmModel'); $fieldNameHash = $bpmModelDao->getFlowFieldNameHash((int) $data['bpm_flow_id']); // get request field hash $requestBodyHash = array(); $requestBody = json_decode($data['bpm_request_body']); foreach ((array) $requestBody->field as $fieldId => $fieldVal) { $fieldName = isset($fieldNameHash[$fieldId]) ? (string) $fieldNameHash[$fieldId] : null; if ($fieldName) { $requestBodyHash[$fieldName] = $fieldVal; } } $data['bpm_request_body_hash'] = $requestBodyHash; // Hush_Util::dump($data); return $data; }