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 = $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
|
// Add dimensions into product description
|
||||||
/*if (empty($conf->global->MAIN_PRODUCT_DISABLE_AUTOADD_DIM))
|
/*if (empty($conf->global->MAIN_PRODUCT_DISABLE_AUTOADD_DIM))
|
||||||
|
|||||||
@@ -866,7 +866,7 @@ if (empty($reshook))
|
|||||||
$desc = $prod->description;
|
$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
|
// Add custom code and origin country into description
|
||||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
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);
|
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
|
||||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft);
|
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@@ -1916,7 +1915,7 @@ if (empty($reshook))
|
|||||||
$desc = $prod->description;
|
$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
|
// Add custom code and origin country into description
|
||||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
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=$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;
|
$fk_unit = $prod->fk_unit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -5729,22 +5729,31 @@ function dol_textishtml($msg,$option=0)
|
|||||||
* text1 txt + text2 html => dol_nl2br(text1) + '<br>' + text2
|
* text1 txt + text2 html => dol_nl2br(text1) + '<br>' + text2
|
||||||
* text1 txt + text2 txt => text1 + '\n' + text2
|
* text1 txt + text2 txt => text1 + '\n' + text2
|
||||||
*
|
*
|
||||||
* @param string $text1 Text 1
|
* @param string $text1 Text 1
|
||||||
* @param string $text2 Text 2
|
* @param string $text2 Text 2
|
||||||
* @param bool $forxml false=Use <br>, true=Use <br />
|
* @param bool $forxml false=Use <br>, true=Use <br />
|
||||||
* @return string Text 1 + new line + Text2
|
* @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
|
* @see dol_textishtml
|
||||||
*/
|
*/
|
||||||
function dol_concatdesc($text1,$text2,$forxml=false)
|
function dol_concatdesc($text1,$text2,$forxml=false, $invert=false)
|
||||||
{
|
{
|
||||||
$ret='';
|
if (!empty($invert))
|
||||||
$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") : "";
|
$tmp = $text1;
|
||||||
$ret.= (dol_textishtml($text1) && ! dol_textishtml($text2))?dol_nl2br($text2, 0, $forxml):$text2;
|
$text1 = $text2;
|
||||||
return $ret;
|
$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") : "";
|
||||||
|
$ret.= (dol_textishtml($text1) && ! dol_textishtml($text2))?dol_nl2br($text2, 0, $forxml):$text2;
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return array of possible common substitutions. This includes several families like: 'system', 'mycompany', 'object', 'objectamount', 'date', 'user'
|
* 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;
|
$desc = $productsupplier->desc_supplier;
|
||||||
} else $desc = $productsupplier->description;
|
} 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;
|
$type = $productsupplier->type;
|
||||||
$price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT');
|
$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;
|
$desc = $productsupplier->desc_supplier;
|
||||||
} else $desc = $productsupplier->description;
|
} 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;
|
$type = $productsupplier->type;
|
||||||
$price_base_type = ($productsupplier->fourn_price_base_type?$productsupplier->fourn_price_base_type:'HT');
|
$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;
|
$desc = $productsupplier->desc_supplier;
|
||||||
} else $desc = $productsupplier->description;
|
} 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;
|
$pu_ht = $productsupplier->fourn_pu;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user