Merge pull request #20687 from fred1201/fred01dev

Fix display in take post  when special caracter are store in database
This commit is contained in:
Laurent Destailleur 2022-04-29 18:02:49 +02:00 committed by GitHub
commit d00a4baeab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -232,7 +232,7 @@ function PrintCategories(first) {
continue;
}
$("#catdivdesc"+i).show();
$("#catdesc"+i).text(categories[parseInt(i)+parseInt(first)]['label']);
$("#catdesc"+i).html(categories[parseInt(i)+parseInt(first)]['label']);
$("#catimg"+i).attr("src","genimg/index.php?query=cat&id="+categories[parseInt(i)+parseInt(first)]['rowid']);
$("#catdiv"+i).data("rowid",categories[parseInt(i)+parseInt(first)]['rowid']);
$("#catdiv"+i).attr('class', 'wrapper');
@ -266,7 +266,7 @@ function MoreCategories(moreorless) {
continue;
}
$("#catdivdesc"+i).show();
$("#catdesc"+i).text(categories[i+(<?php echo ($MAXCATEG - 2); ?> * pagecategories)]['label']);
$("#catdesc"+i).html(categories[i+(<?php echo ($MAXCATEG - 2); ?> * pagecategories)]['label']);
$("#catimg"+i).attr("src","genimg/index.php?query=cat&id="+categories[i+(<?php echo ($MAXCATEG - 2); ?> * pagecategories)]['rowid']);
$("#catdiv"+i).data("rowid",categories[i+(<?php echo ($MAXCATEG - 2); ?> * pagecategories)]['rowid']);
$("#catwatermark"+i).show();
@ -295,8 +295,8 @@ function LoadProducts(position, issubcat) {
jQuery.each(subcategories, function(i, val) {
if (currentcat==val.fk_parent) {
$("#prodivdesc"+ishow).show();
$("#prodesc"+ishow).text(val.label);
$("#probutton"+ishow).text(val.label);
$("#prodesc"+ishow).html(val.label);
$("#probutton"+ishow).html(val.label);
$("#probutton"+ishow).show();
$("#proprice"+ishow).attr("class", "hidden");
$("#proprice"+ishow).html("");
@ -343,13 +343,13 @@ function LoadProducts(position, issubcat) {
if (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 1) {
echo '$("#prodesc"+ishow).html(data[parseInt(idata)][\'ref\'].bold() + \' - \' + data[parseInt(idata)][\'label\']);';
} else {
echo '$("#prodesc"+ishow).text(data[parseInt(idata)][\'label\']);';
echo '$("#prodesc"+ishow).html(data[parseInt(idata)][\'label\']);';
}
echo '$("#proimg"+ishow).attr("title", titlestring);';
echo '$("#proimg"+ishow).attr("src", "genimg/index.php?query=pro&id="+data[idata][\'id\']);';
} else {
echo '$("#probutton"+ishow).show();';
echo '$("#probutton"+ishow).text(data[parseInt(idata)][\'label\']);';
echo '$("#probutton"+ishow).html(data[parseInt(idata)][\'label\']);';
}
?>
if (data[parseInt(idata)]['price_formated']) {
@ -417,9 +417,9 @@ function MoreProducts(moreorless) {
if (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 1) { ?>
$("#prodesc"+ishow).html(data[parseInt(idata)]['ref'].bold() + ' - ' + data[parseInt(idata)]['label']);
<?php } else { ?>
$("#prodesc"+ishow).text(data[parseInt(idata)]['label']);
$("#prodesc"+ishow).html(data[parseInt(idata)]['label']);
<?php } ?>
$("#probutton"+ishow).text(data[parseInt(idata)]['label']);
$("#probutton"+ishow).html(data[parseInt(idata)]['label']);
$("#probutton"+ishow).show();
if (data[parseInt(idata)]['price_formated']) {
$("#proprice"+ishow).attr("class", "productprice");
@ -609,10 +609,10 @@ function Search2(keyCodeForEnter, moreorless) {
if (getDolGlobalInt('TAKEPOS_SHOW_PRODUCT_REFERENCE') == 1) { ?>
$("#prodesc" + i).html(data[i]['ref'].bold() + ' - ' + data[i]['label']);
<?php } else { ?>
$("#prodesc" + i).text(data[i]['label']);
$("#prodesc" + i).html(data[i]['label']);
<?php } ?>
$("#prodivdesc" + i).show();
$("#probutton" + i).text(data[i]['label']);
$("#probutton" + i).html(data[i]['label']);
$("#probutton" + i).show();
if (data[i]['price_formated']) {
$("#proprice" + i).attr("class", "productprice");