mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 02:11:27 +01:00
Fix phpunit
This commit is contained in:
@@ -7494,12 +7494,14 @@ function dolGetFirstLineOfText($text, $nboflines = 1, $charset = 'UTF-8')
|
|||||||
$i = 0; $countline = 0; $lastaddediscontent = 1;
|
$i = 0; $countline = 0; $lastaddediscontent = 1;
|
||||||
while ($countline < $nboflines && isset($a[$i])) {
|
while ($countline < $nboflines && isset($a[$i])) {
|
||||||
if (preg_match('/<br[^>]*>/', $a[$i])) {
|
if (preg_match('/<br[^>]*>/', $a[$i])) {
|
||||||
$firstline .= ($ishtml ? "<br>\n" : "\n");
|
if (array_key_exists($i+1, $a) && !empty($a[$i+1])) {
|
||||||
// Is it a br for a new line of after a printed line ?
|
$firstline .= ($ishtml ? "<br>\n" : "\n");
|
||||||
if (!$lastaddediscontent) {
|
// Is it a br for a new line of after a printed line ?
|
||||||
$countline++;
|
if (!$lastaddediscontent) {
|
||||||
|
$countline++;
|
||||||
|
}
|
||||||
|
$lastaddediscontent = 0;
|
||||||
}
|
}
|
||||||
$lastaddediscontent = 0;
|
|
||||||
} else {
|
} else {
|
||||||
$firstline .= $a[$i];
|
$firstline .= $a[$i];
|
||||||
$lastaddediscontent = 1;
|
$lastaddediscontent = 1;
|
||||||
@@ -7507,9 +7509,12 @@ function dolGetFirstLineOfText($text, $nboflines = 1, $charset = 'UTF-8')
|
|||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$adddots = isset($a[$i]);
|
|
||||||
unset($a);
|
$adddots = (isset($a[$i]) && (!preg_match('/<br[^>]*>/', $a[$i]) || (array_key_exists($i+1, $a) && !empty($a[$i+1]))));
|
||||||
return $firstline.($adddots ? '...' : '');
|
//unset($a);
|
||||||
|
$ret = $firstline.($adddots ? '...' : '');
|
||||||
|
//exit;
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/product/class/product.class.php
|
* \file htdocs/product/class/product.class.php
|
||||||
* \ingroup produit
|
* \ingroup produit
|
||||||
* \brief File of class to manage predefined products or services
|
* \brief File of class to manage the predefined products or services
|
||||||
*/
|
*/
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||||
@@ -5571,7 +5571,7 @@ class Product extends CommonObject
|
|||||||
* @param int $origin_id Origin id of element
|
* @param int $origin_id Origin id of element
|
||||||
* @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (usefull only if product is a subproduct)
|
* @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (usefull only if product is a subproduct)
|
||||||
* @param Extrafields $extrafields Array of extrafields
|
* @param Extrafields $extrafields Array of extrafields
|
||||||
* @param boolean $force_update_batch Force update batch
|
* @param boolean $force_update_batch Force update batch
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $dlc = '', $dluo = '', $lot = '', $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null, $force_update_batch = false)
|
public function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $dlc = '', $dluo = '', $lot = '', $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null, $force_update_batch = false)
|
||||||
|
|||||||
Reference in New Issue
Block a user