function getPermission() { $plf = new PermissionListFactory(); $plf->getByCompanyIdAndPermissionControlId($this->getCompany(), $this->getId()); if ($plf->getRecordCount() > 0) { Debug::Text('Found Permissions: ' . $plf->getRecordCount(), __FILE__, __LINE__, __METHOD__, 10); foreach ($plf as $p_obj) { $current_permissions[$p_obj->getSection()][$p_obj->getName()] = $p_obj->getValue(); } return $current_permissions; } return FALSE; }
break; } } $pcf->FailTransaction(); default: $pf = new PermissionFactory(); $plf = new PermissionListFactory(); if (isset($id)) { BreadCrumb::setCrumb($title); $pclf = new PermissionControlListFactory(); $pclf->getByIdAndCompanyId($id, $current_company->getId()); foreach ($pclf as $pc_obj) { $data = array('id' => $pc_obj->getId(), 'name' => $pc_obj->getName(), 'description' => $pc_obj->getDescription(), 'user_ids' => $pc_obj->getUser(), 'created_date' => $pc_obj->getCreatedDate(), 'created_by' => $pc_obj->getCreatedBy(), 'updated_date' => $pc_obj->getUpdatedDate(), 'updated_by' => $pc_obj->getUpdatedBy(), 'deleted_date' => $pc_obj->getDeletedDate(), 'deleted_by' => $pc_obj->getDeletedBy()); } //$plf->getAllPermissionsByCompanyIdAndPermissionControlId($company_id, $id); $plf->getByCompanyIdAndPermissionControlId($current_company->getId(), $id); if ($plf->getRecordCount() > 0) { Debug::Text('Found Current Permissions!', __FILE__, __LINE__, __METHOD__, 10); foreach ($plf as $p_obj) { foreach ($plf as $p_obj) { $current_permissions[$p_obj->getSection()][$p_obj->getName()] = $p_obj; } } } //print_r($current_permissions); } $section_groups = Misc::prependArray(array(-1 => TTi18n::gettext('-- None --')), $pf->getOptions('section_group')); $section_group_map = $pf->getOptions('section_group_map'); $sections = $pf->getOptions('section'); $names = $pf->getOptions('name'); //Trim out ignored sections