Merge pull request #19555 from OPEN-DSI/fix-thirdparty-modify-tags-not-customer-prospect

FIX can modify tag in thirdparty card if const enabled
This commit is contained in:
Laurent Destailleur 2022-04-07 14:45:59 +02:00 committed by GitHub
commit f2f2ce7d7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1180,13 +1180,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
document.formsoc.private.value=1;
});
var canHaveCategoryIfNotCustomerProspectSupplier = ' . (empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER) ? '0' : '1') . ';
init_customer_categ();
$("#customerprospect").change(function() {
init_customer_categ();
});
function init_customer_categ() {
console.log("is customer or prospect = "+jQuery("#customerprospect").val());
if (jQuery("#customerprospect").val() == 0 && (jQuery("#fournisseur").val() == 0 || ' . (empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER) ? '1' : '0').'))
if (jQuery("#customerprospect").val() == 0 && (jQuery("#fournisseur").val() != 0 || !canHaveCategoryIfNotCustomerProspectSupplier))
{
jQuery(".visibleifcustomer").hide();
}
@ -1205,10 +1206,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (jQuery("#fournisseur").val() == 0)
{
jQuery(".visibleifsupplier").hide();
if (jQuery("#customerprospect").val() == 0 && canHaveCategoryIfNotCustomerProspectSupplier && jQuery(".visibleifcustomer").is(":hidden")) {
jQuery(".visibleifcustomer").show();
}
}
else
{
jQuery(".visibleifsupplier").show();
if (jQuery("#customerprospect").val() == 0 && jQuery(".visibleifcustomer").is(":visible")) {
jQuery(".visibleifcustomer").hide();
}
}
}
@ -1914,13 +1921,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
});
var canHaveCategoryIfNotCustomerProspectSupplier = ' . (empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER) ? '0' : '1') . ';
init_customer_categ();
$("#customerprospect").change(function() {
init_customer_categ();
});
function init_customer_categ() {
console.log("is customer or prospect = "+jQuery("#customerprospect").val());
if (jQuery("#customerprospect").val() == 0 && (jQuery("#fournisseur").val() == 0 || '.(empty($conf->global->THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER) ? '1' : '0').'))
if (jQuery("#customerprospect").val() == 0 && (jQuery("#fournisseur").val() != 0 || !canHaveCategoryIfNotCustomerProspectSupplier))
{
jQuery(".visibleifcustomer").hide();
}
@ -1939,10 +1947,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (jQuery("#fournisseur").val() == 0)
{
jQuery(".visibleifsupplier").hide();
if (jQuery("#customerprospect").val() == 0 && canHaveCategoryIfNotCustomerProspectSupplier && jQuery(".visibleifcustomer").is(":hidden")) {
jQuery(".visibleifcustomer").show();
}
}
else
{
jQuery(".visibleifsupplier").show();
if (jQuery("#customerprospect").val() == 0 && jQuery(".visibleifcustomer").is(":visible")) {
jQuery(".visibleifcustomer").hide();
}
}
};