Commit 947c0994 authored by Eric Seigne's avatar Eric Seigne
Browse files

version 1.0.17 : corrige un gros bug sur la base sqlite embarquee : on...

version 1.0.17 : corrige un gros bug sur la base sqlite embarquee : on risquait d'avoir des doublons
parent adaf0857
<?xml version='1.0' encoding='utf-8'?>
<widget id="fr.caprel.doliscan" version="1.0.16" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="fr.caprel.doliscan" version="1.0.17" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>doliscan</name>
<description>
A simple app for french people looking for a free and self hosting "notes de frais/expenses report" solution.
......
......@@ -423,7 +423,11 @@
globalDB.executeSql('CREATE TABLE IF NOT EXISTS config (key Text, value Text);');
// myDebug("SQL : create config ok");
globalDB.executeSql('CREATE UNIQUE INDEX IF NOT EXISTS key on config (key);');
//Si on a des entrees en double
globalDB.executeSql('DELETE FROM config WHERE rowid NOT IN (SELECT max(rowid) FROM config GROUP BY key)');
globalDB.executeSql('CREATE UNIQUE INDEX IF NOT EXISTS keyIndex on config (key);');
myDebug("SQL : fin de création des tables");
globalDB.readTransaction(function (t) {
......
......@@ -2,7 +2,7 @@
* (c) Éric Seigne <eric.seigne@cap-rel.fr> - 2019-2020 - GNU AGPLv3
* full source code in src/ subfolder, this file is minifyed
*/
var globalDevMode=false;var globalMyCamera;var globalpictureSource;var globaldestinationType;var globalNetworkResponse=Date.now();var globalCurrentPage="";var globalCurrentTitle="";var globalDB=null;var globalTenMinuts=60*10*1000;var globalCompatibleWithAPIVersion=4;var globalDoliScanDomain="";var globalLastInsertId="";var globalSyncInProgress=false;var globalAppVersion="1.0.16";var dataLDF="";var globalResumable;var globalProgressBar;var globalTypeFrais="";var globalSrvKeys=['email','api_token','firstname','name','adresse','cp','ville','pays','send_copy_to','compta_email','compta_ik','compta_peage','compta_hotel','compta_train','compta_carburant','compta_taxi','compta_restauration','compta_divers','compta_compteperso','compta_tvadeductible','official_app_version','official_app_message','mode_simple'];function readFromFile(fileName,formdata,subject){var pathToFile=cordova.file.documentsDirectory+fileName;window.resolveLocalFileSystemURL(fileName,function(fileEntry){fileEntry.file(function(file){var reader=new FileReader();var fileSize=file.size;reader.onloadend=function(e){var fileContent=new Uint8Array(reader.result);formdata.append("afile",fileContent);formdata.append("afilesize",fileSize);var today=new Date();var destFilename=today.getFullYear().toString()+('0'+(today.getMonth()+1)).slice(-2)+('0'+today.getDate()).slice(-2)+"_"
var globalDevMode=true;var globalMyCamera;var globalpictureSource;var globaldestinationType;var globalNetworkResponse=Date.now();var globalCurrentPage="";var globalCurrentTitle="";var globalDB=null;var globalTenMinuts=60*10*1000;var globalCompatibleWithAPIVersion=4;var globalDoliScanDomain="";var globalLastInsertId="";var globalSyncInProgress=false;var globalAppVersion="1.0.16";var dataLDF="";var globalResumable;var globalProgressBar;var globalTypeFrais="";var globalSrvKeys=['email','api_token','firstname','name','adresse','cp','ville','pays','send_copy_to','compta_email','compta_ik','compta_peage','compta_hotel','compta_train','compta_carburant','compta_taxi','compta_restauration','compta_divers','compta_compteperso','compta_tvadeductible','official_app_version','official_app_message','mode_simple'];function readFromFile(fileName,formdata,subject){var pathToFile=cordova.file.documentsDirectory+fileName;window.resolveLocalFileSystemURL(fileName,function(fileEntry){fileEntry.file(function(file){var reader=new FileReader();var fileSize=file.size;reader.onloadend=function(e){var fileContent=new Uint8Array(reader.result);formdata.append("afile",fileContent);formdata.append("afilesize",fileSize);var today=new Date();var destFilename=today.getFullYear().toString()+('0'+(today.getMonth()+1)).slice(-2)+('0'+today.getDate()).slice(-2)+"_"
+today.getHours().toString()+today.getMinutes().toString()+"-"+subject+"-"+basename(fileName);var newFileUri=cordova.file.documentsDirectory;moveFile(fileName,destFilename);endSendForm(formdata,destFilename);};reader.readAsArrayBuffer(file);},errorHandler.bind(null,fileName));},errorHandler.bind(null,fileName));}
function distanceAutomatique(depart,arrivee){showWait();$.ajaxSetup({timeout:5000,});$.ajax({type:"GET",timeout:5000,url:"https://geo.doliscan.fr/api/geo/"+depart+"/"+arrivee,beforeSend:function(xhr){xhr.setRequestHeader('Authorization','Bearer '+localGetData("api_token"));},success:function(result){if(result!='undefined'){hideWait();updateDistanceFromServer(result);}
else{hideWait();ons.notification.alert("Saisie manuelle nécessaire, cette distance n'est pas connue sur nos serveurs",{title:"Erreur"});}},error:function(result){hideWait();ons.notification.alert("Saisie manuelle nécessaire, cette distance n'est pas connue sur nos serveurs",{title:"Erreur"});}});}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment