Commit 5bae21c3 authored by Eric Seigne's avatar Eric Seigne
Browse files

version 1.8.5

parent 45f6a8ed
1.8.5
- ajoute un bouton pour supprimer un compte de la liste des comptes préférés
- affiche le choix du compte par défaut au lancement si on a plusieurs comptes
actifs
# 1.8.4
- fin de l'implémentation de la solution de changement rapide d'utilisateur pour
......
<?xml version='1.0' encoding='utf-8'?>
<widget id="fr.caprel.doliscan" version="1.8.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="fr.caprel.doliscan" version="1.8.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>doliscan</name>
<description>DoliSCAN is a tiny app for french people looking for a free and self hosting "notes de frais/expenses report" solution.</description>
<author email="eric.seigne@cap-rel.fr" href="https://cap-rel.fr">Eric Seigne</author>
......@@ -152,5 +152,5 @@
</feature>
</platform>
<plugin name="cordova-plugin-calendar" />
<preference name="OverrideUserAgent" value="Mozilla/5.0 OpenNDF/1.8.4 Android" />
<preference name="OverrideUserAgent" value="Mozilla/5.0 OpenNDF/1.8.5 Android" />
</widget>
......@@ -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 globalAppVersion="1.8.4";var globalDevMode=false;var globalMyCamera;var globalpictureSource;var globaldestinationType;var globalNetworkResponse=Date.now();var globalCurrentPage="";var globalCurrentTitle="";var globalTenMinuts=60*10*1000;var globalCompatibleWithAPIVersion=4;var globalDoliScanDomain="";var globalLastInsertId="";var globalSyncInProgress=false;var globalPictureFileName="";var globalPicturesAvailable=[];var globalSyncObject=[];var dataLDF="";var dataIK="";var globalMyNavigator=undefined;var globalResumable=undefined;var globalProgressBar=undefined;var globalTypeFrais="";var globalVehiculeEd=undefined;var loginAPIKeyErrorInProgress=false;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','compta_tva_tx1','compta_tva_tx2','compta_tva_tx3','compta_tva_tx4'];function errorHandlerCustomFile(title,message){myDebug('errorHandlerCustomFile : '+title+' -- message follow:');myDebug(message);}
var globalAppVersion="1.8.5";var globalDevMode=false;var globalMyCamera;var globalpictureSource;var globaldestinationType;var globalNetworkResponse=Date.now();var globalCurrentPage="";var globalCurrentTitle="";var globalTenMinuts=60*10*1000;var globalCompatibleWithAPIVersion=4;var globalDoliScanDomain="";var globalLastInsertId="";var globalSyncInProgress=false;var globalPictureFileName="";var globalPicturesAvailable=[];var globalSyncObject=[];var dataLDF="";var dataIK="";var globalMyNavigator=undefined;var globalResumable=undefined;var globalProgressBar=undefined;var globalTypeFrais="";var globalVehiculeEd=undefined;var loginAPIKeyErrorInProgress=false;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','compta_tva_tx1','compta_tva_tx2','compta_tva_tx3','compta_tva_tx4'];function errorHandlerCustomFile(title,message){myDebug('errorHandlerCustomFile : '+title+' -- message follow:');myDebug(message);}
function loadCustomCSS(){if((typeof cordova=='undefined')||(cordova===null)||(cordova=="")){return;}
if((typeof cordova.file=='undefined')||(cordova.file===null)||(cordova.file=="")){return;}
if((typeof cordova.file.cacheDirectory=='undefined')||(cordova.file.cacheDirectory===null)||(cordova.file.cacheDirectory=="")){return;}
......@@ -106,8 +106,11 @@ html+="</ul>";html+="<ons-button modifier='material large' onclick='createIK(\""
$(formField).append(html);}
function onErrorAgendaIK(msg){hideWait();ons.notification.alert("Erreur d'accès à l'agenda"+JSON.stringify(msg),{title:"Erreur"});}
function createIK(titre,ladate,message,arrivee,depart){myDebug("createIK : "+titre);dataIK={label:titre+" "+message,ladate:ladate,arrivee:arrivee,depart:depart,};myDebug("createIK : avant le Goto : "+JSON.stringify(dataIK));gotoPage("frais-ik.html",true);}
function makeOneAccount(id,title,mail){let html="";html="<ons-row>\n";html+=" <ons-col>\n";html+=" <ons-card>\n";html+=" <ons-row>\n";html+=" <ons-col width=\"20%\">\n";html+=" <ons-icon icon=\"fa-user-tie\" size=\"50px\"></ons-icon>\n";html+=" </ons-col>\n";html+=" <ons-col style=\"text-align: center;\">\n";html+=" <div class=\"title\">\n";html+=" "+title+"\n";html+=" </div>\n";html+=" </ons-col>\n";html+=" </ons-row>\n";html+=" <ons-row>\n";html+=" <ons-col style=\"text-align: center;\">\n";html+=" <ons-button modifier=\"material large\" onclick=\"loginAPIKeyErrorInProgress=false;loginWithAPIToken("+id+");\" class=\"menubutton\">\n";html+=" <ons-icon icon=\"md-sign-in\"></ons-icon>\n";html+=" <span class=\"menulabel translate\">AUTH</span>\n";html+=" </ons-button>\n";html+=" </ons-col>\n";html+=" </ons-row>\n";html+=" </ons-card>\n";html+=" </ons-col>\n";html+="</ons-row>\n";return html;}
function feedMyAccounts(fieldName){let formField='#'+fieldName;let html="";$(formField).empty();let accounts=JSON.parse(localGetData("accounts"));if(accounts!==null){for(let f=0;f<accounts.length;f++){lemail=accounts[f]['email'];html+=makeOneAccount(f,lemail,lemail);}}
function makeOneAccount(fieldName,id,title,mail){let html="";html="<ons-row>\n";html+=" <ons-col>\n";html+=" <span class=\"deleteiconAccount\">\n";html+=" <span class=\"deleteiconAccount2\" onclick=\"deletePrefAccount('"+id+"','"+fieldName+"');\"><i style=\"font-size: x-large;\" class=\"zmdi zmdi-close-circle-o\"></i></span>\n";html+=" </span>\n";html+=" <ons-card>\n";html+=" <ons-row>\n";html+=" <ons-col width=\"20%\">\n";html+=" <ons-icon icon=\"fa-user-tie\" size=\"50px\"></ons-icon>\n";html+=" </ons-col>\n";html+=" <ons-col style=\"text-align: center;\">\n";html+=" <div class=\"title\">\n";html+=" "+title+"\n";html+=" </div>\n";html+=" </ons-col>\n";html+=" </ons-row>\n";html+=" <ons-row>\n";html+=" <ons-col style=\"text-align: center;\">\n";html+=" <ons-button modifier=\"material large\" onclick=\"loginAPIKeyErrorInProgress=false;loginWithAPIToken("+id+");\" class=\"menubutton\">\n";html+=" <ons-icon icon=\"md-sign-in\"></ons-icon>\n";html+=" <span class=\"menulabel translate\">AUTH</span>\n";html+=" </ons-button>\n";html+=" </ons-col>\n";html+=" </ons-row>\n";html+=" </ons-card>\n";html+=" </ons-col>\n";html+="</ons-row>\n";return html;}
function deletePrefAccount(id,fieldName){let c=JSON.parse(localGetData("accounts"));c.splice(id,1);if(c.length>0){localStoreData("accounts",JSON.stringify(c));}
else{localStoreData("accounts",null);}
feedMyAccounts(fieldName);}
function feedMyAccounts(fieldName){console.log("appel de feedMyAccounts :: "+fieldName);let formField='#'+fieldName;let html="";$(formField).empty();let a=localGetData("accounts");console.log("on a feedMyAccounts :: "+a);if(a!==null&&a!==""){console.log("on a feedMyAccounts non null ... ");let accounts=JSON.parse(a);for(let f=0;f<accounts.length;f++){lemail=accounts[f]['email'];html+=makeOneAccount(fieldName,f,lemail,lemail);}}
$(formField).append(html);}
function sendForm(leformName){myDebug("sendForm "+leformName);showWait();$.ajaxSetup({timeout:10000,headers:{'X-CSRF-TOKEN':localGetData("api_token")}});if(document.getElementById('ladate')){myDebug("on a ladate : "+document.getElementById('ladate').value);localStoreData("ladate",document.getElementById('ladate').value);}
var moyenPaiement=null;var els=document.getElementsByName('moyenPaiement');for(var i=0;i<els.length;i++){if(els[i].checked){moyenPaiement=els[i].value;myDebug("on a moyenPaiement : "+moyenPaiement);localStoreData("moyenPaiement",moyenPaiement);break;}}
......@@ -246,8 +249,8 @@ localStoreData(storageKey,JSON.stringify(accounts));else
localStoreData(storageKey,null);}
function nullKeyAccount(storageKey,email){return new Promise((resolve,reject)=>{let update=0;let accounts=JSON.parse(localGetData(storageKey));if(accounts!==null){for(let f=0;f<accounts.length;f++){if(accounts[f]['email']==email){accounts[f]['apikey']=null;}}}
resolve(localStoreData(storageKey,JSON.stringify(accounts)));});}
function addAccount(storageKey,email,apikey,server){myDebug("addAccount : "+email);return new Promise((resolve,reject)=>{let update=0;let accounts=JSON.parse(localGetData(storageKey));if(accounts===null){accounts=[];}
else{for(let f=0;f<accounts.length;f++){if(accounts[f]['email']==email){accounts[f]['apikey']=apikey;accounts[f]['server']=server;update=1;myDebug("addAccount : update");}}}
function addAccount(storageKey,email,apikey,server){myDebug("addAccount : "+email);return new Promise((resolve,reject)=>{let update=0;let a=localGetData(storageKey);let accounts=[];if(a!==null&&a!==""){accounts=JSON.parse(a);}
for(let f=0;f<accounts.length;f++){if(accounts[f]['email']==email){accounts[f]['apikey']=apikey;accounts[f]['server']=server;update=1;myDebug("addAccount : update");}}
if(update==0){let accountNew={"email":email,"apikey":apikey,"server":server};myDebug("addAccount : insert : "+accountNew);accounts.push(accountNew);}
resolve(localStoreData(storageKey,JSON.stringify(accounts)));});}
function askQuitOrGoto(destination){if(device!==undefined){if(device.platform=="iOS"){gotoPage(destination,false);}
......@@ -348,7 +351,7 @@ ajaxHistory.abort();var ajaxHistory=$.ajax({url:localGetData("api_server")+"/api
else{styleTxt="style=\"background: #efefef;\"";if(data.montant>0){montantTxt=" ("+data.montant+" €)";}}
var loadthis="<ons-button modifier=\"material large\" onclick=\"localStoreData('ndfId','"+data.sid+"'); localStoreData('ndfStatus','"+data.status+"');localStoreData('ndfLabel','"+data.label+"');gotoPage('details.html');\" class=\"menubutton\""+styleTxt+"><i class=\"fas fa-angle-right\"></i> "+data.label+montantTxt+"</ons-button>";$(loadthis).hide().appendTo($('#contenuNDF')).fadeIn(1000);}
else{closePage();}}},error:function(result){hideWait();closePage();}});return;}
if(lapage=='ONSlogin'){myDebug("ons show login.html ...");if(localGetData("api_server")!==null){myDebug("Login with API token...");loginWithAPIToken();}
if(lapage=='ONSlogin'){myDebug("ons show login.html ...");if(localGetData("api_server")!==null){myDebug("Login with API token...");let a=localGetData("accounts");if(a!==null&&a!==""){accounts=JSON.parse(a);if(accounts.length==1){loginWithAPIToken();}}}
$(".toggle-password").click(function(){myDebug("Clic sur l'affichage du mot de passe ...");$(this).toggleClass("fa-eye fa-eye-slash");var input=$($(this).attr("toggle"));if(input.attr("type")=="password"){input.attr("type","text");}else{input.attr("type","password");}});return;}
if(lapage=='ONSMenu'){dataLDF="";feedDoliscanAccount();}
if(lapage=='ONSMessageDone'){return;}
......
......@@ -3,7 +3,7 @@
*/
// **********************************************************************
//Ne pas toucher, mis à jour automatiquement à partir du config.xml
var globalAppVersion = "1.8.4"; // mis à jour automatiquement à partir du fichier config.xml lors du build android
var globalAppVersion = "1.8.5"; // mis à jour automatiquement à partir du fichier config.xml lors du build android
// **********************************************************************
......
Markdown is supported
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