public function mvcjs() { $this->load->file('application/modules/app/user_settings/form/user_settings_form.php'); $data_form = new Form_App_User_Settings(); $params = array('link' => $this->link, 'linkx' => $this->linkx, 'permissions' => $this->permission->toArray(), 'user_settings_form_default' => $data_form->toArray()); Helper_App_JS::showMVC('user_settings', $params); }
private function saveAcount() { $this->load->file('application/modules/app/user_settings/form/user_settings_form.php'); $resAjax = new Response_Ajax(); $frm_data = new Form_App_User_Settings(TRUE); try { if (!$this->permission->update) { throw new Exception('No tiene permisos para editar/actualizar'); } if (!$frm_data->isValid()) { throw new Exception('Debe ingresar la información en todos los campos'); } $ePerson = $frm_data->getPersonEntity(); $eUser = $frm_data->getUserEntity(); $eUserProfile = $frm_data->getUserProfileEntity(); $eUserProfile_CompanyBranches = $frm_data->getUserProfile_CompanyBranchEntity(); $oBus = Business_App_User_Settings::saveAcount($ePerson, $eUser, $eUserProfile, $eUserProfile_CompanyBranches); if (!$oBus->isSuccess()) { throw new Exception($oBus->message()); } $resAjax->isSuccess(TRUE); $resAjax->message($oBus->message()); } catch (Exception $ex) { $resAjax->isSuccess(FALSE); $resAjax->message($ex->getMessage()); $resAjax->form('acount', $frm_data->toArray()); } echo $resAjax->toJsonEncode(); }