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