diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 820db4f308f..f4b8bfc610c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2060,7 +2060,7 @@ class Form if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { - if (!empty($conf->global->SUPPLIERORDER_WITH_NOPRICEDEFINED)) + if (!empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) { print ''; } @@ -2071,7 +2071,7 @@ class Form } else { - if (!empty($conf->global->SUPPLIERORDER_WITH_NOPRICEDEFINED)) + if (!empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) { print ''; print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c4e6b3b7fea..0634d4c6746 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4285,6 +4285,29 @@ function dol_string_nohtmltag($StringHtml,$removelinefeed=1,$pagecodeto='UTF-8') } +/** + * Return first line of text. Cut will depends if content is HTML or not. + * + * @param string $text Input text + * @return string Output text + * @see dol_nboflines_bis + */ +function dolGetFirstLineOfText($text) +{ + if (dol_textishtml($text)) + { + $firstline=preg_replace('/]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters + $firstline=preg_replace('/]*>.*$/s','',$firstline); // The s pattern modifier means the . can match newline characters + + } + else + { + $firstline=preg_replace('/[\n\r].*/','',$text); + } + return $firstline.((strlen($firstline) != strlen($text))?'...':''); +} + + /** * Replace CRLF in string with a HTML BR tag * @@ -4292,6 +4315,7 @@ function dol_string_nohtmltag($StringHtml,$removelinefeed=1,$pagecodeto='UTF-8') * @param int $nl2brmode 0=Adding br before \n, 1=Replacing \n by br * @param bool $forxml false=Use
, true=Use
* @return string String encoded + * @see dol_nboflines, dolGetFirstLineOfText */ function dol_nl2br($stringtoencode,$nl2brmode=0,$forxml=false) { @@ -4429,7 +4453,7 @@ function dol_string_is_good_iso($s) * @param string $s String to check * @param int $maxchar Not yet used * @return int Number of lines - * @see dol_nboflines_bis + * @see dol_nboflines_bis, dolGetFirstLineOfText */ function dol_nboflines($s,$maxchar=0) { diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index e9ec126e328..5de04c6718e 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -30,26 +30,6 @@ // Enable this line to trace path when function is called. //print xdebug_print_function_stack('Functions2.lib was called');exit; -/** - * Return first line of text. Cut will depends if content is HTML or not. - * - * @param string $text Input text - * @return string Output text - * @see dol_nboflines_bis - */ -function dolGetFirstLineOfText($text) -{ - if (dol_textishtml($text)) - { - $firstline=preg_replace('/]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters - } - else - { - $firstline=preg_replace('/[\n\r].*/','',$text); - } - return $firstline.((strlen($firstline) != strlen($text))?'...':''); -} - /** * Same function than javascript unescape() function but in PHP. * diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 51cb77ea1a4..6e4c77fe1d2 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -358,7 +358,7 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali } elseif ($thirdparty instanceof Contact) { $socname = $thirdparty->socname; } else { - throw new InvalidArgumentException(); + throw new InvalidArgumentException('Parameter 1=$thirdparty is not a Societe nor Contact'); } return $outputlangs->convToOutputCharset($socname); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 08c08474981..f95608fee05 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -615,12 +615,12 @@ class pdf_soleil extends ModelePDFFicheinter if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { $thirdparty = $object->contact; } else { - $thirdparty = $object->client; + $thirdparty = $object->thirdparty; } - $carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs); + $carac_client_name=pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target',$object); + $carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact)?$object->contact:''), $usecontact, 'target',$object); // Show recipient $widthrecbox=100; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index d86c2b86274..88224a487cf 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -227,10 +227,11 @@ if ($result) $companystatic->client=$objp->client; print $companystatic->getNomUrl(1,'',44); print ''; - print ''.dol_htmlentitiesbr(dol_trunc($objp->description,20)).''; + print ''.dol_trunc(dolGetFirstLineOfText($objp->description),48).''; if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { - print ''.dol_htmlentitiesbr(dol_trunc($objp->descriptiondetail,20)).''; + //print ''.dol_trunc(dol_escape_htmltag(dolGetFirstLineOfText($objp->descriptiondetail)),48).''; + print ''.dolGetFirstLineOfText($objp->descriptiondetail).''; print ''.dol_print_date($db->jdate($objp->dp),'dayhour')."\n"; print ''.convertSecondToTime($objp->duree).''; } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 509b4ca0437..8b9c6267b18 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -346,7 +346,7 @@ if (empty($reshook)) { $productsupplier = new ProductFournisseur($db); - if (empty($conf->global->SUPPLIERORDER_WITH_NOPRICEDEFINED)) + if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) { $idprod=0; if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 2d3a1d5a4a3..cf93bd3d2b1 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -52,7 +52,7 @@ ArcticNumRefModelDesc1=Generic number model ArcticNumRefModelError=Failed to activate PacificNumRefModelDesc1=Return numero with format %syymm-nnnn where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 PacificNumRefModelError=An intervention card starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module. -PrintProductsOnFichinter=Print products on intervention card +PrintProductsOnFichinter=Print also lines of type "product" (not only services) on intervention card PrintProductsOnFichinterDetails=interventions generated from orders InterventionStatistics=Statistics of interventions NbOfinterventions=Nb of intervention cards