forked from Wavyzz/dolibarr
NEW : conf to change concat desc order
This commit is contained in:
@@ -959,7 +959,7 @@ if (empty($reshook))
|
||||
$desc = $prod->description;
|
||||
}
|
||||
|
||||
$desc = dol_concatdesc($desc, $product_desc);
|
||||
$desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||
|
||||
// Add dimensions into product description
|
||||
/*if (empty($conf->global->MAIN_PRODUCT_DISABLE_AUTOADD_DIM))
|
||||
|
||||
@@ -866,7 +866,7 @@ if (empty($reshook))
|
||||
$desc = $prod->description;
|
||||
}
|
||||
|
||||
$desc = dol_concatdesc($desc, $product_desc);
|
||||
$desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||
|
||||
// Add custom code and origin country into description
|
||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
||||
|
||||
@@ -133,7 +133,6 @@ if ($user->societe_id) $socid = $user->societe_id;
|
||||
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
|
||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@@ -1916,7 +1915,7 @@ if (empty($reshook))
|
||||
$desc = $prod->description;
|
||||
}
|
||||
|
||||
$desc = dol_concatdesc($desc, $product_desc);
|
||||
$desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||
|
||||
// Add custom code and origin country into description
|
||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
||||
|
||||
@@ -540,7 +540,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
$desc=$prod->description;
|
||||
$desc=dol_concatdesc($desc,$product_desc);
|
||||
$desc=dol_concatdesc($desc,$product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||
$fk_unit = $prod->fk_unit;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -5732,11 +5732,19 @@ function dol_textishtml($msg,$option=0)
|
||||
* @param string $text1 Text 1
|
||||
* @param string $text2 Text 2
|
||||
* @param bool $forxml false=Use <br>, true=Use <br />
|
||||
* @param bool $invert invert order of description lines if CONF CHANGE_ORDER_CONCAT_DESCRIPTION is active
|
||||
* @return string Text 1 + new line + Text2
|
||||
* @see dol_textishtml
|
||||
*/
|
||||
function dol_concatdesc($text1,$text2,$forxml=false)
|
||||
function dol_concatdesc($text1,$text2,$forxml=false, $invert=false)
|
||||
{
|
||||
if (!empty($invert))
|
||||
{
|
||||
$tmp = $text1;
|
||||
$text1 = $text2;
|
||||
$text2 = $tmp;
|
||||
}
|
||||
|
||||
$ret='';
|
||||
$ret.= (! dol_textishtml($text1) && dol_textishtml($text2))?dol_nl2br($text1, 0, $forxml):$text1;
|
||||
$ret.= (! empty($text1) && ! empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2))?($forxml?"<br \>\n":"<br>\n") : "\n") : "";
|
||||
@@ -5745,6 +5753,7 @@ function dol_concatdesc($text1,$text2,$forxml=false)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return array of possible common substitutions. This includes several families like: 'system', 'mycompany', 'object', 'objectamount', 'date', 'user'
|
||||
*
|
||||
|
||||
@@ -404,7 +404,7 @@ if (empty($reshook))
|
||||
$desc = $productsupplier->desc_supplier;
|
||||
} else $desc = $productsupplier->description;
|
||||
|
||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc);
|
||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||
|
||||
$type = $productsupplier->type;
|
||||
$price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT');
|
||||
|
||||
@@ -1222,7 +1222,7 @@ if (empty($reshook))
|
||||
$desc = $productsupplier->desc_supplier;
|
||||
} else $desc = $productsupplier->description;
|
||||
|
||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc);
|
||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||
|
||||
$type = $productsupplier->type;
|
||||
$price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT');
|
||||
|
||||
@@ -630,7 +630,7 @@ if (empty($reshook))
|
||||
$desc = $productsupplier->desc_supplier;
|
||||
} else $desc = $productsupplier->description;
|
||||
|
||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc);
|
||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||
|
||||
$pu_ht = $productsupplier->fourn_pu;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user