FSN#35566 LCL's die overruled zijn toch wel proberen te registreren in de database

svn path=/Website/trunk/; revision=28263
This commit is contained in:
Jos Groot Lipman
2016-02-23 09:54:33 +00:00
parent f079a8d8f3
commit 3887f2e603

View File

@@ -92,8 +92,8 @@ lcl = {
this.loadLCL(); this.loadLCL();
} }
if (!(p_lcl in cache_lcls)) if (!(p_lcl in cache_lcls) || cache_lcls[p_lcl].overrulefallback)
{ { // Laatste keer individueel uit de database ophalen
var sql = "SELECT fac_locale_xsl_key," var sql = "SELECT fac_locale_xsl_key,"
+ " COALESCE(fac_locale_xsl_cust, fac_locale_xsl_tekst) fac_locale_xsl_tekst" + " COALESCE(fac_locale_xsl_cust, fac_locale_xsl_tekst) fac_locale_xsl_tekst"
+ " FROM fac_locale_xsl" + " FROM fac_locale_xsl"
@@ -110,9 +110,16 @@ lcl = {
oRs.Close(); oRs.Close();
if (locale_xsl_key == -1) if (locale_xsl_key == -1)
{ {
cache_lcls[p_lcl] = { txt: "??" + safe.html(p_lcl) + "??" }; // undefined fallback if (!cache_lcls[p_lcl])
__DoLog("LCL '" + p_lcl + "' is undefined!", "#FFFF00"); {
return cache_lcls[p_lcl].txt; cache_lcls[p_lcl] = { txt: "??" + safe.html(p_lcl) + "??" }; // zelfs geen overrulefallback
__DoLog("LCL '{0}' is undefined!".format(p_lcl), "#F00");
}
else
{
__DoLog("LCL '{0}' is undefined but overruled to '{1}'".format(p_lcl, cache_lcls[p_lcl].txt), "#FF0");
}
return cache_lcls[p_lcl].txt||"";
} }
else else
{ {
@@ -126,16 +133,7 @@ lcl = {
} }
} }
var txt = cache_lcls[p_lcl].txt||""; return cache_lcls[p_lcl].txt||"";
if (cache_lcls[p_lcl].overrulefallback)
{
// Als je deze tekst voor een bepaalde lcl maar blijft terugzien bij een klant
// is waarschijnlijk de lcl nog nooit geregistreerd in fac_locale_xref.
// Dan moet je heel even de overrule weghalen uit cust/custenv.wsc zodat
// fac_locale_xref de lcl 'leert'. Daarna kan de overrule weer terug.
__DoLog("LCL '" + p_lcl + "' is undefined! Fallback to cust/custenv.wsc overrule: <em>" + txt+ "</em>", "#FF0000");
}
return txt;
}, },
loadLCL: function(path) loadLCL: function(path)