public function index()
 {
     $oBus = Business_App_Rol::listRol('', NULL, NULL);
     $eRols = $oBus->getInData('eRols');
     $combo_rol = Helper_Array::entitiesToIdText($eRols, 'id', 'name', 'value', 'text');
     Helper_App_View::layout('app/html/pages/security_profile/page', array('combo_rol' => $combo_rol));
 }
 private function loadComponentsModalRol()
 {
     $resAjax = new Response_Ajax();
     $combo_rol = array(array('value' => 0, 'text' => '<< --ROLES-- >>'));
     try {
         $oBus = Business_App_Rol::listRol('', NULL, NULL);
         if (!$oBus->isSuccess()) {
             throw new Exception($oBus->message());
         }
         $eRols = $oBus->getInData('eRols');
         $combo_rol2 = Helper_Array::entitiesToIdText($eRols, 'id', 'name', 'value', 'text');
         $combo_roles = array_merge($combo_rol, $combo_rol2);
         $resAjax->isSuccess(TRUE);
     } catch (Exception $e) {
         $resAjax->isSuccess(FALSE);
         $resAjax->message($e->getMessage());
     }
     $resAjax->data(array('combo-roles' => $combo_roles));
     echo $resAjax->toJsonEncode();
 }
 private function listModules()
 {
     $resAjax = new Response_Ajax();
     $txt_filter = $this->input->get('sSearch');
     $limit = $this->input->get('iDisplayLength');
     $offset = $this->input->get('iDisplayStart');
     $oBus = Business_App_Rol::listRol($txt_filter, $limit, $offset);
     $data = $oBus->data();
     $eRols = $data['eRols'];
     $count = $data['count'];
     $aaData = array();
     if (!empty($eRols)) {
         /* @var $eRol eRol */
         foreach ($eRols as $num => $eRol) {
             $aaData[] = array(trim($eRol->name), trim($eRol->name_key), trim($eRol->id));
         }
     }
     $resAjax->isSuccess($oBus->isSuccess());
     $resAjax->message($oBus->message());
     $resAjax->datatable($aaData, $count);
     echo $resAjax->toJsonEncode();
 }