changes #3

Merged
guillermo merged 1 commits from HOTFIX into master 2022-11-16 08:32:57 +00:00
1 changed files with 1 additions and 10 deletions

View File

@ -250,7 +250,7 @@ var App = {
throw new Error(_('Enter a user name')); throw new Error(_('Enter a user name'));
if (!password || password === '') if (!password || password === '')
throw new Error(_('Enter a password')); throw new Error(_('Enter a password'));
if (!password || password === '') if (!branch || branch === '')
throw new Error(_('Select a branch')); throw new Error(_('Select a branch'));
this.regWrite(Conf.dsPath, 'UID', user); this.regWrite(Conf.dsPath, 'UID', user);
@ -324,15 +324,11 @@ var App = {
throw err; throw err;
} }
// revisar var sql = "SELECT version FROM versiones WHERE programa = '"+ this.module +"'";
var sql = "SELECT version " + var sql = "SELECT version " +
" FROM vn.mdbVersion " + " FROM vn.mdbVersion " +
" WHERE app = '"+ this.module +"' " + " WHERE app = '"+ this.module +"' " +
" AND branchFk = '" + this.$('branch').value + "'"; " AND branchFk = '" + this.$('branch').value + "'";
// var sql = "SELECT version FROM versiones WHERE programa = '"+ this.module +"'";
var rs = mysqlConn.execute(sql); var rs = mysqlConn.execute(sql);
var version = rs.EOF ? false : parseInt(rs.fields(0).value); var version = rs.EOF ? false : parseInt(rs.fields(0).value);
rs.close(); rs.close();
@ -342,7 +338,6 @@ var App = {
version -= 1; version -= 1;
// Checks if it's already open // Checks if it's already open
if (this.fso.fileExists(this.lockFile)) if (this.fso.fileExists(this.lockFile))
try { try {
this.fso.deleteFile(this.lockFile); this.fso.deleteFile(this.lockFile);
@ -352,19 +347,16 @@ var App = {
} }
// Checks if MDB exists // Checks if MDB exists
if (!this.fso.fileExists(this.mdbFile)) if (!this.fso.fileExists(this.mdbFile))
return version; return version;
// If it's abnormaly bigger, maybe is corrupted, so force download // If it's abnormaly bigger, maybe is corrupted, so force download
var file = this.fso.getFile(this.mdbFile); var file = this.fso.getFile(this.mdbFile);
if (file.size > Conf.maxCorruptSize * 1024 * 1024) if (file.size > Conf.maxCorruptSize * 1024 * 1024)
return version; return version;
// Obtains the local version number from the MDB file // Obtains the local version number from the MDB file
var localVersion = this.mdbGetValue( var localVersion = this.mdbGetValue(
'SELECT Version FROM tblVariables', 'SELECT Version FROM tblVariables',
'Version', parseInt 'Version', parseInt
@ -372,7 +364,6 @@ var App = {
if (!localVersion) localVersion = false; if (!localVersion) localVersion = false;
// Determines if should download // Determines if should download
return !localVersion || version === false || localVersion != version return !localVersion || version === false || localVersion != version
? version ? version
: null; : null;