Merge pull request #19525 from altairis-melina/categorydescription

NEW : Add constant to show category description in TakePos
This commit is contained in:
Laurent Destailleur 2022-05-08 20:39:50 +02:00 committed by GitHub
commit ff065e0302
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -232,7 +232,12 @@ function PrintCategories(first) {
continue;
}
$("#catdivdesc"+i).show();
$("#catdesc"+i).html(categories[parseInt(i)+parseInt(first)]['label']);
<?php
if (getDolGlobalString('TAKEPOS_SHOW_CATEGORY_DESCRIPTION') == 1) { ?>
$("#catdesc"+i).html(categories[parseInt(i)+parseInt(first)]['label'].bold() + ' - ' + categories[parseInt(i)+parseInt(first)]['description']);
<?php } else { ?>
$("#catdesc"+i).text(categories[parseInt(i)+parseInt(first)]['label']);
<?php } ?>
$("#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 +271,12 @@ function MoreCategories(moreorless) {
continue;
}
$("#catdivdesc"+i).show();
$("#catdesc"+i).html(categories[i+(<?php echo ($MAXCATEG - 2); ?> * pagecategories)]['label']);
<?php
if (getDolGlobalString('TAKEPOS_SHOW_CATEGORY_DESCRIPTION') == 1) { ?>
$("#catdesc"+i).html(categories[i+(<?php echo ($MAXCATEG - 2); ?> * pagecategories)]['label'].bold() + ' - ' + categories[i+(<?php echo ($MAXCATEG - 2); ?> * pagecategories)]['description']);
<?php } else { ?>
$("#catdesc"+i).text(categories[i+(<?php echo ($MAXCATEG - 2); ?> * pagecategories)]['label']);
<?php } ?>
$("#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 +305,13 @@ function LoadProducts(position, issubcat) {
jQuery.each(subcategories, function(i, val) {
if (currentcat==val.fk_parent) {
$("#prodivdesc"+ishow).show();
$("#prodesc"+ishow).html(val.label);
$("#probutton"+ishow).html(val.label);
<?php if (getDolGlobalString('TAKEPOS_SHOW_CATEGORY_DESCRIPTION') == 1) { ?>
$("#prodesc"+ishow).html(val.label.bold() + ' - ' + val.description);
$("#probutton"+ishow).html(val.label);
<?php } else { ?>
$("#prodesc"+ishow).text(val.label);
$("#probutton"+ishow).text(val.label);
<?php } ?>
$("#probutton"+ishow).show();
$("#proprice"+ishow).attr("class", "hidden");
$("#proprice"+ishow).html("");