Commit 60f7392a authored by Eric Seigne's avatar Eric Seigne
Browse files

version 1.6.1

parent 9e68e6f7
# 1.6.1
- corrige l'authentification automatique avec le qrCode
- corrige le retour sur l'historique lorsqu'on est sur un détail de note de frais
# 1.6.0
- modification profonde de l'outil de gestion des indemnités kilométriques pour gérer les
......
......@@ -180,8 +180,10 @@ function closePage(refresh=false){if(globalMyNavigator===undefined)globalMyNavig
return true;}
function gotoPage(destination,saveHistory=true){if(globalMyNavigator===undefined)globalMyNavigator=document.getElementById('myNavigator');myDebug("gotoPage 1 ("+destination+") historique ("+saveHistory+")");if(globalMyNavigator.topPage!=null)
if(globalMyNavigator.topPage.data.name==destination){return;}
if(globalMyNavigator!==undefined){globalCurrentPage=destination;myDebug("gotoPage : on change globalCurrentPage pour avoir maintenant : "+globalCurrentPage);if(destination=="menu.html"){globalMyNavigator.resetToPage(destination,{data:{title:'avenir',name:destination}});}
else{globalMyNavigator.pushPage(destination,{data:{title:'avenir',name:destination}});}}
if(globalMyNavigator!==undefined){let changeIsDone=false;if(globalCurrentPage=="details.html"&&destination=="historique.html"){myDebug("gotoPage : cas particulier details ->historique ");globalMyNavigator.popPage();changeIsDone=true;}
if(globalCurrentPage=="detailsLdf.html"&&destination=="historique.html"){myDebug("gotoPage : cas particulier details ->historique ");globalMyNavigator.popPage();changeIsDone=true;}
globalCurrentPage=destination;myDebug("gotoPage : on change globalCurrentPage pour avoir maintenant : "+globalCurrentPage);if(destination=="menu.html"){globalMyNavigator.resetToPage(destination,{data:{title:'avenir',name:destination}});}
else{if(!changeIsDone){globalMyNavigator.pushPage(destination,{data:{title:'avenir',name:destination}});}}}
let onsRightMenu=document.getElementById('rightmenu');if(onsRightMenu!=undefined)
onsRightMenu.close();requestKeepAlive();return true;if(saveHistory){historique(destination);}
globalCurrentPage=destination;let onsContent=document.getElementById('maincontent');onsContent.innerHTML='';onsContent.load(destination);if(destination=="menu.html"){onsRightMenu.load("parts/splitter.html");}
......@@ -246,7 +248,7 @@ if(lapage=='ONSDetails'){showWait();if(ajaxDetailsNDF)
ajaxDetailsNDF.abort();var ajaxDetailsNDF=$.ajax({url:localGetData("api_server")+"/api/NdeFraisDetails/"+localGetData("ndfId"),timeout:5000,type:"GET",dataType:"json",beforeSend:function(xhr){xhr.setRequestHeader('Authorization','Bearer '+localGetData("api_token"));},xhrFields:{withCredentials:true},success:function(result){globalNetworkResponse=Date.now();let titre="";if(localGetData("ndfStatus")==0){titre="Historique de la note de frais #";}
else{titre="Note de frais provisoire #";}
$('#ndfLabel').text(titre+localGetData("ndfLabel"));for(var i in result){data=result[i];var ladate=dateFormatDDMMYYYY(data.ladate);var icone=faIcone(data.label,data.type_frais_id);var texte=ladate+" "+data.label;if(data.ttc>0){texte+=" ("+nbFR(data.ttc)+")";}
var loadthis="<ons-list-item modifier=\"longdivider\" tappable onclick=\"localStoreData('ldfId','"+data.sid+"');gotoPage('detailsLdf.html', true);\"><div class=\"left\">"+icone+"</div><div class=\"center\">"+texte+"</div></ons-list-item>";$(loadthis).hide().appendTo($('#contenuNDFS')).fadeIn(1000);}
var loadthis="<ons-list-item modifier=\"longdivider\" tappable onclick=\"localStoreData('ldfId','"+data.sid+"');gotoPage('detailsLdf.html');\"><div class=\"left\">"+icone+"</div><div class=\"center\">"+texte+"</div></ons-list-item>";$(loadthis).hide().appendTo($('#contenuNDFS')).fadeIn(1000);}
hideWait();},error:function(result){hideWait();closePage();}});return;}
if(lapage=='ONSDetailsLDF'){let el=document.querySelector('#contenuLDFImage');let pz=new PinchZoom(el,{});$('#ldfId').text(localGetData("ldfId"));$('#contenuLDF').empty();showWait();if(ajaxUpdateServerLDF)
ajaxUpdateServerLDF.abort();var ajaxUpdateServerLDF=$.ajax({url:localGetData("api_server")+"/api/LdeFrais/"+localGetData("ldfId"),timeout:5000,type:"GET",dataType:"json",beforeSend:function(xhr){xhr.setRequestHeader('Authorization','Bearer '+localGetData("api_token"));},xhrFields:{withCredentials:true},success:function(result){dataLDF=result;dataLDF['moyenPaiement']=result.paiement_slug;localStoreData('moyenPaiement',result.paiement_slug);globalNetworkResponse=Date.now();var ladate=dateFormatDDMMYYYY(dataLDF.ladate);var loadthis="";if(dataLDF.isUpdatable){loadthis="<input type=\"button\" onclick=\"gotoPage('frais-"+dataLDF.frais_slug+".html',false);\" value=\"Modifier cette fiche\" />";}
......@@ -257,7 +259,7 @@ ajaxUpdateServerLDFBis.abort();var ajaxUpdateServerLDFBis=$.ajax({url:imgURI,tim
if(lapage=='ONSHistorique'){$('#contenuNDF').empty();if(ajaxHistory)
ajaxHistory.abort();var ajaxHistory=$.ajax({url:localGetData("api_server")+"/api/NdeFrais",timeout:5000,type:"GET",dataType:"json",beforeSend:function(xhr){xhr.setRequestHeader('Authorization','Bearer '+localGetData("api_token"));},xhrFields:{withCredentials:true},success:function(result){globalNetworkResponse=Date.now();hideWait();for(var i=0;i<result.length;i++){var data=result[i];if(typeof data=='object'&&data!==null){let montantTxt="";let styleTxt="";if(i==0){montantTxt=" ( en cours )";}
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', true);\" class=\"menubutton\""+styleTxt+"><i class=\"fas fa-angle-right\"></i> "+data.label+montantTxt+"</ons-button>";$(loadthis).hide().appendTo($('#contenuNDF')).fadeIn(1000);}
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();}
$(".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;}
......
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