/**
  * Guardar los cambios en un registro
  * @param array $params
  * @return string
  */
 public function onClickSaveReg($params, $id = '')
 {
     $requiredFields = array('name');
     if ($this->MYFORM_validate($params, $requiredFields)) {
         $ess_master_tables = new ess_master_tables();
         if ($id) {
             $ess_master_tables->find($id);
         }
         $ess_master_tables->name = $params['name'];
         $ess_master_tables->description = $params['description'];
         $ess_master_tables->user_id = $_SESSION['user_id'];
         $ess_master_tables->datetime = date("Y-m-d H:i:s");
         if ($ess_master_tables->save()) {
             $this->closeModalWindow();
             $this->MYLIST_reload('lst_tablas');
             $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMBIOS_GUARDADOS'), 5, 'ok');
             if (!$id) {
                 $this->onClickGetDetList($ess_master_tables->getLastInsertId());
             }
         } else {
             $this->messageBox($ess_master_tables->getSqlLog() . "\n" . $ess_master_tables->getErrorLog(), 'error');
         }
     } else {
         $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMPOS_REQUERIDOS'), 5, 'error');
     }
     return $this->response;
 }