Fix: Detection auto des champs text/html.
Fix: Dans les PDF, il ne faut pas faire le nl2br standard de PHP lors de la conversion text en HTML car ce dernier ne remplace pas le \n mais ajoute le br hors le writeHTMLCell transforme aussi les \n en br.
This commit is contained in:
parent
75e490845b
commit
af274668a3
@ -162,7 +162,7 @@ class Adherent extends CommonObject
|
|||||||
$infos.= $langs->trans("Birthday").": $this->naiss\n";
|
$infos.= $langs->trans("Birthday").": $this->naiss\n";
|
||||||
$infos.= $langs->trans("Photo").": $this->photo\n";
|
$infos.= $langs->trans("Photo").": $this->photo\n";
|
||||||
$infos.= $langs->trans("Public").": ".yn($this->public)."\n";
|
$infos.= $langs->trans("Public").": ".yn($this->public)."\n";
|
||||||
if ($msgishtml) $infos = dol_htmlentities($infos);
|
if ($msgishtml) $infos = dol_htmlentitiesbr($infos);
|
||||||
|
|
||||||
// Substitutions
|
// Substitutions
|
||||||
$patterns = array (
|
$patterns = array (
|
||||||
|
|||||||
@ -118,7 +118,7 @@ if ($id)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="note" cols="80" rows="10">'.$adh->note.'</textarea>';
|
print '<textarea name="note" cols="80" rows="10">'.dol_htmlentitiesbr_decode($adh->note).'</textarea>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -224,7 +224,7 @@ if ($_GET["action"] == 'create')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea class="flat" name="mail_valid" rows="15" cols="90">';
|
print '<textarea class="flat" name="mail_valid" rows="15" cols="90">';
|
||||||
print $adht->mail_valid;
|
print dol_htmlentitiesbr_decode($adht->mail_valid);
|
||||||
print '</textarea>';
|
print '</textarea>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -361,7 +361,7 @@ if ($rowid > 0)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea class="flat" name="mail_valid" rows="15" cols="90">';
|
print '<textarea class="flat" name="mail_valid" rows="15" cols="90">';
|
||||||
print $adht->mail_valid;
|
print dol_htmlentitiesbr_decode($adht->mail_valid);
|
||||||
print '</textarea>';
|
print '</textarea>';
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|||||||
@ -208,7 +208,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="main_motd" cols="90" rows="'.ROWS_5.'">'.$conf->global->MAIN_MOTD.'</textarea>';
|
print '<textarea name="main_motd" cols="90" rows="'.ROWS_5.'">'.dol_htmlentitiesbr_decode($conf->global->MAIN_MOTD).'</textarea>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="main_home" cols="90" rows="'.ROWS_5.'">'.$conf->global->MAIN_HOME.'</textarea>';
|
print '<textarea name="main_home" cols="90" rows="'.ROWS_5.'">'.dol_htmlentitiesbr_decode($conf->global->MAIN_HOME).'</textarea>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -126,7 +126,7 @@ if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="description" rows="'.ROWS_6.'" cols="50">';
|
print '<textarea name="description" rows="'.ROWS_6.'" cols="50">';
|
||||||
print $categorie->description;
|
print dol_htmlentitiesbr_decode($categorie->description);
|
||||||
print '</textarea>';
|
print '</textarea>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -180,7 +180,7 @@ if ($user->rights->categorie->creer)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="description" rows="'.ROWS_6.'" cols="50">';
|
print '<textarea name="description" rows="'.ROWS_6.'" cols="50">';
|
||||||
print $categorie->description;
|
print dol_htmlentitiesbr_decode($categorie->description);
|
||||||
print '</textarea>';
|
print '</textarea>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -711,7 +711,7 @@ if ($_GET["id"])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="note" cols="90" rows="'.ROWS_8.'">'.$act->note.'</textarea>';
|
print '<textarea name="note" cols="90" rows="'.ROWS_8.'">'.dol_htmlentitiesbr_decode($act->note).'</textarea>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -794,7 +794,7 @@ if ($_GET["id"])
|
|||||||
|
|
||||||
// Note
|
// Note
|
||||||
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
|
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
|
||||||
print dol_htmlentities($act->note);
|
print dol_htmlentitiesbr($act->note);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -260,7 +260,7 @@ if ($resql)
|
|||||||
print $actionstatic->getNomUrl(1,4);
|
print $actionstatic->getNomUrl(1,4);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="left" nowrap="nowrap">';
|
print '<td align="center" nowrap="nowrap">';
|
||||||
print dolibarr_print_date($obj->dp,"day");
|
print dolibarr_print_date($obj->dp,"day");
|
||||||
$late=0;
|
$late=0;
|
||||||
if ($obj->percent == 0 && $obj->dp && date("U",$obj->dp) < time()) $late=1;
|
if ($obj->percent == 0 && $obj->dp && date("U",$obj->dp) < time()) $late=1;
|
||||||
@ -270,13 +270,13 @@ if ($resql)
|
|||||||
if ($late) print img_warning($langs->trans("Late"));
|
if ($late) print img_warning($langs->trans("Late"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="left" nowrap="nowrap">';
|
print '<td align="center" nowrap="nowrap">';
|
||||||
print dolibarr_print_date($obj->da2,"day");
|
print dolibarr_print_date($obj->da2,"day");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Titre
|
// Titre
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print dolibarr_trunc($obj->label,12);
|
print dolibarr_trunc($obj->label,10);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Société
|
// Société
|
||||||
@ -284,7 +284,7 @@ if ($resql)
|
|||||||
$societestatic->id=$obj->socid;
|
$societestatic->id=$obj->socid;
|
||||||
$societestatic->client=$obj->client;
|
$societestatic->client=$obj->client;
|
||||||
$societestatic->nom=$obj->societe;
|
$societestatic->nom=$obj->societe;
|
||||||
print $societestatic->getNomUrl(1,'',8);
|
print $societestatic->getNomUrl(1,'',6);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Contact
|
// Contact
|
||||||
@ -294,7 +294,7 @@ if ($resql)
|
|||||||
$contactstatic->name=$obj->name;
|
$contactstatic->name=$obj->name;
|
||||||
$contactstatic->firstname=$obj->firstname;
|
$contactstatic->firstname=$obj->firstname;
|
||||||
$contactstatic->id=$obj->fk_contact;
|
$contactstatic->id=$obj->fk_contact;
|
||||||
print $contactstatic->getNomUrl(1,'',8);
|
print $contactstatic->getNomUrl(1,'',6);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -661,7 +661,7 @@ else
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea class="flat" name="body" cols="70" rows="20">';
|
print '<textarea class="flat" name="body" cols="70" rows="20">';
|
||||||
print $mil->body.'</textarea>';
|
print dol_htmlentitiesbr_decode($mil->body).'</textarea>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -1133,12 +1133,12 @@ if ($_GET['propalid'] > 0)
|
|||||||
else $text.= img_object($langs->trans('ShowProduct'),'product');
|
else $text.= img_object($langs->trans('ShowProduct'),'product');
|
||||||
$text.= ' '.$objp->ref.'</a>';
|
$text.= ' '.$objp->ref.'</a>';
|
||||||
$text.= ' - '.$objp->product;
|
$text.= ' - '.$objp->product;
|
||||||
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':$objp->description);
|
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description));
|
||||||
print $html->textwithtooltip($text,$description,3,'','',$i);
|
print $html->textwithtooltip($text,$description,3,'','',$i);
|
||||||
print_date_range($objp->date_start,$objp->date_end);
|
print_date_range($objp->date_start,$objp->date_end);
|
||||||
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||||
{
|
{
|
||||||
print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):'';
|
print ($objp->description && $objp->description!=$objp->product)?'<br>'.dol_htmlentitiesbr($objp->description):'';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -1353,7 +1353,7 @@ if ($_GET['propalid'] > 0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="desc" cols="70" class="flat" rows="'.ROWS_2.'">'.$objp->description.'</textarea>';
|
print '<textarea name="desc" cols="70" class="flat" rows="'.ROWS_2.'">'.dol_htmlentitiesbr_decode($objp->description).'</textarea>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -1364,13 +1364,13 @@ else
|
|||||||
else $text.= img_object($langs->trans('ShowProduct'),'product');
|
else $text.= img_object($langs->trans('ShowProduct'),'product');
|
||||||
$text.= ' '.$objp->ref.'</a>';
|
$text.= ' '.$objp->ref.'</a>';
|
||||||
$text.= ' - '.$objp->product;
|
$text.= ' - '.$objp->product;
|
||||||
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':$objp->description);
|
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description));
|
||||||
print $html->textwithtooltip($text,$description,3,'','',$i);
|
print $html->textwithtooltip($text,$description,3,'','',$i);
|
||||||
// Todo: voir si on insert ou pas en option les dates de debut et de fin de service
|
// Todo: voir si on insert ou pas en option les dates de debut et de fin de service
|
||||||
//print_date_range($objp->date_start,$objp->date_end);
|
//print_date_range($objp->date_start,$objp->date_end);
|
||||||
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||||
{
|
{
|
||||||
print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):'';
|
print ($objp->description && $objp->description!=$objp->product)?'<br>'.dol_htmlentitiesbr($objp->description):'';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -1512,7 +1512,7 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="eldesc" class="flat" cols="70" rows="1">'.$objp->description.'</textarea>';
|
print '<textarea name="eldesc" class="flat" cols="70" rows="1">'.dol_htmlentitiesbr_decode($objp->description).'</textarea>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
|
|||||||
@ -225,7 +225,7 @@ if ($_GET["action"] == 'create')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea class="flat" name="account_comment" cols="70" rows="10">';
|
print '<textarea class="flat" name="account_comment" cols="70" rows="10">';
|
||||||
print $account->comment.'</textarea>';
|
print dol_htmlentitiesbr_decode($account->comment).'</textarea>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -464,7 +464,7 @@ else
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea class="flat" name="account_comment" cols="70" rows="10">';
|
print '<textarea class="flat" name="account_comment" cols="70" rows="10">';
|
||||||
print $account->comment.'</textarea>';
|
print dol_htmlentitiesbr_decode($account->comment).'</textarea>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -2363,13 +2363,13 @@ else
|
|||||||
else $text.= img_object($langs->trans('ShowProduct'),'product');
|
else $text.= img_object($langs->trans('ShowProduct'),'product');
|
||||||
$text.= ' '.$objp->ref.'</a>';
|
$text.= ' '.$objp->ref.'</a>';
|
||||||
$text.= ' - '.$objp->product;
|
$text.= ' - '.$objp->product;
|
||||||
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':$objp->description);
|
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description));
|
||||||
//print $description;
|
//print $description;
|
||||||
print $html->textwithtooltip($text,$description,3,'','',$i);
|
print $html->textwithtooltip($text,$description,3,'','',$i);
|
||||||
print_date_range($objp->date_start,$objp->date_end);
|
print_date_range($objp->date_start,$objp->date_end);
|
||||||
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||||
{
|
{
|
||||||
print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):'';
|
print ($objp->description && $objp->description!=$objp->product)?'<br>'.dol_htmlentitiesbr($objp->description):'';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -2505,7 +2505,10 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="desc" class="flat" cols="70" rows="'.ROWS_2.'">'.$objp->description.'</textarea>';
|
print '<textarea name="desc" class="flat" cols="70" rows="'.ROWS_2.'">';
|
||||||
|
//print $objp->description;
|
||||||
|
print dol_htmlentitiesbr_decode($objp->description);
|
||||||
|
print '</textarea>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
|
|||||||
@ -215,11 +215,11 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Description de la ligne produit
|
// Description de la ligne produit
|
||||||
$libelleproduitservice=dol_htmlentities($this->expe->lignes[$i]->description);
|
$libelleproduitservice=dol_htmlentitiesbr($this->expe->lignes[$i]->description,1);
|
||||||
if ($this->expe->lignes[$i]->description&&$this->expe->lignes[$i]->description!=$com->lignes[$i]->libelle)
|
if ($this->expe->lignes[$i]->description&&$this->expe->lignes[$i]->description!=$com->lignes[$i]->libelle)
|
||||||
{
|
{
|
||||||
if ($libelleproduitservice) $libelleproduitservice.="\n";
|
if ($libelleproduitservice) $libelleproduitservice.="<br>";
|
||||||
$libelleproduitservice.=dol_htmlentities($this->expe->lignes[$i]->description);
|
$libelleproduitservice.=dol_htmlentitiesbr($this->expe->lignes[$i]->description,1);
|
||||||
}
|
}
|
||||||
// Si ligne associée à un code produit
|
// Si ligne associée à un code produit
|
||||||
if ($this->expe->lignes[$i]->fk_product)
|
if ($this->expe->lignes[$i]->fk_product)
|
||||||
|
|||||||
@ -621,7 +621,7 @@ elseif ($_GET["id"] > 0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="description" wrap="soft" cols="70" rows="12">'.$fichinter->description.'</textarea>';
|
print '<textarea name="description" wrap="soft" cols="70" rows="12">'.dol_htmlentitiesbr_decode($fichinter->description).'</textarea>';
|
||||||
}
|
}
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -758,7 +758,7 @@ elseif ($_GET["id"] > 0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="desc" cols="70" class="flat" rows="'.ROWS_2.'">'.$objp->description.'</textarea>';
|
print '<textarea name="desc" cols="70" class="flat" rows="'.ROWS_2.'">'.dol_htmlentitiesbr_decode($objp->description).'</textarea>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -707,11 +707,11 @@ else
|
|||||||
$text.= ' '.$objp->ref_fourn.'</a>';
|
$text.= ' '.$objp->ref_fourn.'</a>';
|
||||||
$text.= ' ('.$objp->ref.')';
|
$text.= ' ('.$objp->ref.')';
|
||||||
$text.= ' - '.$objp->product;
|
$text.= ' - '.$objp->product;
|
||||||
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':$objp->description);
|
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description));
|
||||||
print $html->textwithtooltip($text,$description,3,'','',$i);
|
print $html->textwithtooltip($text,$description,3,'','',$i);
|
||||||
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||||
{
|
{
|
||||||
print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):'';
|
print ($objp->description && $objp->description!=$objp->product)?'<br>'.dol_htmlentitiesbr($objp->description):'';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -781,7 +781,7 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="eldesc" class="flat" cols="70" rows="1">'.$objp->description.'</textarea>';
|
print '<textarea name="eldesc" class="flat" cols="70" rows="1">'.dol_htmlentitiesbr_decode($objp->description).'</textarea>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
@ -239,11 +239,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
|
||||||
// Description de la ligne produit
|
// Description de la ligne produit
|
||||||
$libelleproduitservice=dol_htmlentities($com->lignes[$i]->libelle);
|
$libelleproduitservice=dol_htmlentitiesbr($com->lignes[$i]->libelle,1);
|
||||||
if ($com->lignes[$i]->desc&&$com->lignes[$i]->desc!=$com->lignes[$i]->libelle)
|
if ($com->lignes[$i]->desc&&$com->lignes[$i]->desc!=$com->lignes[$i]->libelle)
|
||||||
{
|
{
|
||||||
if ($libelleproduitservice) $libelleproduitservice.="\n";
|
if ($libelleproduitservice) $libelleproduitservice.="<br>";
|
||||||
$libelleproduitservice.=dol_htmlentities($com->lignes[$i]->desc);
|
$libelleproduitservice.=dol_htmlentitiesbr($com->lignes[$i]->desc,1);
|
||||||
}
|
}
|
||||||
// Si ligne associée à un code produit
|
// Si ligne associée à un code produit
|
||||||
if ($com->lignes[$i]->fk_product)
|
if ($com->lignes[$i]->fk_product)
|
||||||
@ -253,7 +253,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
if ($com->lignes[$i]->date_start && $com->lignes[$i]->date_end)
|
if ($com->lignes[$i]->date_start && $com->lignes[$i]->date_end)
|
||||||
{
|
{
|
||||||
// Affichage durée si il y en a une
|
// Affichage durée si il y en a une
|
||||||
$libelleproduitservice.=dol_htmlentities("\n(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($com->lignes[$i]->date_start)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($com->lignes[$i]->date_end).")");
|
$libelleproduitservice.="<br>".dol_htmlentitiesbr("(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($com->lignes[$i]->date_start)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($com->lignes[$i]->date_end).")",1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page
|
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page
|
||||||
|
|||||||
@ -63,59 +63,60 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Affiche un texte+picto avec tooltip sur texte ou sur picto
|
\brief Affiche un texte+picto avec tooltip sur texte ou sur picto
|
||||||
\param text Texte à afficher
|
\param text Texte à afficher
|
||||||
\param htmltext Contenu html du tooltip, codé en html
|
\param htmltext Contenu html du tooltip, codé en html
|
||||||
\param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2, 4=tooltip sur les 2 et forcé en Ajax
|
\param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2, 4=tooltip sur les 2 et forcé en Ajax
|
||||||
\param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est après
|
\param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est après
|
||||||
\param img Code img du picto
|
\param img Code img du picto
|
||||||
\return string Code html du texte,picto
|
\return string Code html du tooltip (texte+picto)
|
||||||
*/
|
*/
|
||||||
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$i=1,$width='200',$shiftX='10')
|
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$i=1,$width='200',$shiftX='10')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if (! $htmltext) return $text;
|
if (! $htmltext) return $text;
|
||||||
|
|
||||||
$paramfortooltiptext ='';
|
$paramfortooltiptext ='';
|
||||||
$paramfortooltippicto ='';
|
$paramfortooltippicto ='';
|
||||||
|
|
||||||
// Sanitize tooltip
|
// Sanitize tooltip
|
||||||
$htmltext=ereg_replace("'","\'",$htmltext);
|
$htmltext=ereg_replace("'","\'",$htmltext);
|
||||||
$htmltext=ereg_replace("'","\'",$htmltext);
|
$htmltext=ereg_replace("'","\'",$htmltext);
|
||||||
$htmltext=ereg_replace("\r","",$htmltext);
|
$htmltext=ereg_replace("\r","",$htmltext);
|
||||||
$htmltext=ereg_replace("\n","<br>",$htmltext);
|
$htmltext=ereg_replace("<br>\n","<br>",$htmltext);
|
||||||
|
$htmltext=ereg_replace("\n","",$htmltext);
|
||||||
if ($conf->use_javascript_ajax && $tooltipon == 4)
|
|
||||||
{
|
if ($conf->use_javascript_ajax && $tooltipon == 4)
|
||||||
$s = '<div id="tip'.$i.'">'."\n";
|
{
|
||||||
$s.= $text;
|
$s = '<div id="tip'.$i.'">'."\n";
|
||||||
$s.= '</div>'."\n";
|
$s.= $text;
|
||||||
$s.= '<div id="tooltip_content" style="display:none">'."\n";
|
$s.= '</div>'."\n";
|
||||||
$s.= $htmltext."\n";
|
$s.= '<div id="tooltip_content" style="display:none">'."\n";
|
||||||
$s.= '</div>'."\n";
|
$s.= $htmltext."\n";
|
||||||
$s.= '<script type=\'text/javascript\'>'."\n";
|
$s.= '</div>'."\n";
|
||||||
$s.= 'TooltipManager.init("","",{width:'.$width.', shiftX:'.$shiftX.'});'."\n";
|
$s.= '<script type=\'text/javascript\'>'."\n";
|
||||||
$s.= 'TooltipManager.addHTML("tip'.$i.'", "tooltip_content");'."\n";
|
$s.= 'TooltipManager.init("","",{width:'.$width.', shiftX:'.$shiftX.'});'."\n";
|
||||||
$s.= '</script>'."\n";
|
$s.= 'TooltipManager.addHTML("tip'.$i.'", "tooltip_content");'."\n";
|
||||||
}
|
$s.= '</script>'."\n";
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
if ($conf->use_javascript_ajax)
|
{
|
||||||
{
|
if ($conf->use_javascript_ajax)
|
||||||
$htmltext=eregi_replace('"',"\'",$htmltext);
|
{
|
||||||
if ($tooltipon==1 || $tooltipon==3)
|
$htmltext=eregi_replace('"',"\'",$htmltext);
|
||||||
{
|
if ($tooltipon==1 || $tooltipon==3)
|
||||||
$paramfortooltiptext.=' onmouseover="showtip(\''.$htmltext.'\')"';
|
{
|
||||||
$paramfortooltiptext.=' onMouseout="hidetip()"';
|
$paramfortooltiptext.=' onmouseover="showtip(\''.$htmltext.'\')"';
|
||||||
}
|
$paramfortooltiptext.=' onMouseout="hidetip()"';
|
||||||
if ($tooltipon==2 || $tooltipon==3)
|
}
|
||||||
{
|
if ($tooltipon==2 || $tooltipon==3)
|
||||||
$paramfortooltippicto.=' onmouseover="showtip(\''.$htmltext.'\')"';
|
{
|
||||||
$paramfortooltippicto.=' onMouseout="hidetip()"';
|
$paramfortooltippicto.=' onmouseover="showtip(\''.$htmltext.'\')"';
|
||||||
}
|
$paramfortooltippicto.=' onMouseout="hidetip()"';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$s="";
|
$s="";
|
||||||
$s.='<table class="nobordernopadding"><tr>';
|
$s.='<table class="nobordernopadding"><tr>';
|
||||||
|
|||||||
@ -231,19 +231,19 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
|
||||||
// Description de la ligne produit
|
// Description de la ligne produit
|
||||||
$libelleproduitservice=dol_htmlentities($com->lignes[$i]->libelle);
|
$libelleproduitservice=dol_htmlentitiesbr($com->lignes[$i]->libelle,1);
|
||||||
if ($com->lignes[$i]->desc && $com->lignes[$i]->desc!=$com->lignes[$i]->libelle)
|
if ($com->lignes[$i]->desc && $com->lignes[$i]->desc!=$com->lignes[$i]->libelle)
|
||||||
{
|
{
|
||||||
if ($libelleproduitservice) $libelleproduitservice.="\n";
|
if ($libelleproduitservice) $libelleproduitservice.="<br>";
|
||||||
if ($com->lignes[$i]->desc == '(CREDIT_NOTE)' && $com->lignes[$i]->fk_remise_except)
|
if ($com->lignes[$i]->desc == '(CREDIT_NOTE)' && $com->lignes[$i]->fk_remise_except)
|
||||||
{
|
{
|
||||||
$discount=new DiscountAbsolute($this->db);
|
$discount=new DiscountAbsolute($this->db);
|
||||||
$discount->fetch($com->lignes[$i]->fk_remise_except);
|
$discount->fetch($com->lignes[$i]->fk_remise_except);
|
||||||
$libelleproduitservice=$langs->trans("DiscountFromCreditNote",$discount->ref_facture_source);
|
$libelleproduitservice=dol_htmlentitiesbr($langs->trans("DiscountFromCreditNote",$discount->ref_facture_source),1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$libelleproduitservice.=dol_htmlentities($com->lignes[$i]->desc);
|
$libelleproduitservice.=dol_htmlentitiesbr($com->lignes[$i]->desc,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Si ligne associée à un code produit
|
// Si ligne associée à un code produit
|
||||||
@ -269,7 +269,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
if ($com->lignes[$i]->date_start && $com->lignes[$i]->date_end)
|
if ($com->lignes[$i]->date_start && $com->lignes[$i]->date_end)
|
||||||
{
|
{
|
||||||
// Affichage durée si il y en a une
|
// Affichage durée si il y en a une
|
||||||
$libelleproduitservice.=dol_htmlentities("\n(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($com->lignes[$i]->date_start)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($com->lignes[$i]->date_end).")");
|
$libelleproduitservice.="<br>".dol_htmlentitiesbr("(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($com->lignes[$i]->date_start)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($com->lignes[$i]->date_end).")",1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page
|
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@dolibarr.fr>
|
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -16,8 +16,6 @@
|
|||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
* or see http://www.gnu.org/
|
* or see http://www.gnu.org/
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,7 +23,7 @@
|
|||||||
\ingroup facture
|
\ingroup facture
|
||||||
\brief Fichier de la classe permettant de g<EFBFBD>n<EFBFBD>rer les factures au mod<EFBFBD>le Crabe
|
\brief Fichier de la classe permettant de g<EFBFBD>n<EFBFBD>rer les factures au mod<EFBFBD>le Crabe
|
||||||
\author Laurent Destailleur
|
\author Laurent Destailleur
|
||||||
\version $Revision$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/facture/modules_facture.php");
|
require_once(DOL_DOCUMENT_ROOT."/includes/modules/facture/modules_facture.php");
|
||||||
@ -206,7 +204,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
{
|
{
|
||||||
$tab_top = 88;
|
$tab_top = 88;
|
||||||
|
|
||||||
$pdf->SetFont('Arial','', 9); // Dans boucle pour g<EFBFBD>rer multi-page
|
$pdf->SetFont('Arial','', 9); // Dans boucle pour gerer multi-page
|
||||||
$pdf->SetXY ($this->posxdesc-1, $tab_top);
|
$pdf->SetXY ($this->posxdesc-1, $tab_top);
|
||||||
$pdf->MultiCell(190, 3, $fac->note_public, 0, 'J');
|
$pdf->MultiCell(190, 3, $fac->note_public, 0, 'J');
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
@ -234,31 +232,32 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
|
||||||
// Description de la ligne produit
|
// Description de la ligne produit
|
||||||
$libelleproduitservice=dol_htmlentities($fac->lignes[$i]->libelle);
|
$libelleproduitservice=dol_htmlentitiesbr($fac->lignes[$i]->libelle,1);
|
||||||
if ($fac->lignes[$i]->desc&&$fac->lignes[$i]->desc!=$fac->lignes[$i]->libelle)
|
if ($fac->lignes[$i]->desc&&$fac->lignes[$i]->desc!=$fac->lignes[$i]->libelle)
|
||||||
{
|
{
|
||||||
if ($libelleproduitservice) $libelleproduitservice.="\n";
|
if ($libelleproduitservice) $libelleproduitservice.="<br>";
|
||||||
|
|
||||||
if ($fac->lignes[$i]->desc == '(CREDIT_NOTE)' && $fac->lignes[$i]->fk_remise_except)
|
if ($fac->lignes[$i]->desc == '(CREDIT_NOTE)' && $fac->lignes[$i]->fk_remise_except)
|
||||||
{
|
{
|
||||||
$discount=new DiscountAbsolute($this->db);
|
$discount=new DiscountAbsolute($this->db);
|
||||||
$discount->fetch($fac->lignes[$i]->fk_remise_except);
|
$discount->fetch($fac->lignes[$i]->fk_remise_except);
|
||||||
$libelleproduitservice=$langs->trans("DiscountFromCreditNote",$discount->ref_facture_source);
|
$libelleproduitservice=dol_htmlentitiesbr($langs->trans("DiscountFromCreditNote",$discount->ref_facture_source),1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($fac->lignes[$i]->produit_id)
|
if ($fac->lignes[$i]->produit_id)
|
||||||
{
|
{
|
||||||
$libelleproduitservice.=dol_htmlentities($fac->lignes[$i]->desc);
|
$libelleproduitservice.=dol_htmlentitiesbr($fac->lignes[$i]->desc,1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// On v<EFBFBD>rifie si les lignes personnalis<69>es sont format<61>es avec fckeditor
|
// On verifie si les lignes personnalisees sont formatees avec fckeditor
|
||||||
$libelleproduitservice.=dol_htmlentities($fac->lignes[$i]->desc);
|
$libelleproduitservice.=dol_htmlentitiesbr($fac->lignes[$i]->desc,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Si ligne associ<63>e <20> un code produit
|
|
||||||
|
// Si ligne associee a un code produit
|
||||||
if ($fac->lignes[$i]->produit_id)
|
if ($fac->lignes[$i]->produit_id)
|
||||||
{
|
{
|
||||||
$prodser = new Product($this->db);
|
$prodser = new Product($this->db);
|
||||||
@ -284,8 +283,9 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end)
|
if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end)
|
||||||
{
|
{
|
||||||
// Affichage duree si il y en a une
|
// Affichage duree si il y en a une
|
||||||
$libelleproduitservice.=dol_htmlentities("\n(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end).")");
|
$libelleproduitservice.="<br>".dol_htmlentitiesbr("(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end).")",1);
|
||||||
}
|
}
|
||||||
|
//if ($i==0) { print $libelleproduitservice; exit; }
|
||||||
|
|
||||||
$pdf->SetFont('Arial','', 9); // Dans boucle pour gerer multi-page
|
$pdf->SetFont('Arial','', 9); // Dans boucle pour gerer multi-page
|
||||||
|
|
||||||
|
|||||||
@ -233,20 +233,20 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
|
||||||
// Description de la ligne produit
|
// Description de la ligne produit
|
||||||
$libelleproduitservice=dol_htmlentities($propale->lignes[$i]->libelle);
|
$libelleproduitservice=dol_htmlentitiesbr($propale->lignes[$i]->libelle,1);
|
||||||
if ($propale->lignes[$i]->desc && $propale->lignes[$i]->desc!=$propale->lignes[$i]->libelle)
|
if ($propale->lignes[$i]->desc && $propale->lignes[$i]->desc!=$propale->lignes[$i]->libelle)
|
||||||
{
|
{
|
||||||
if ($libelleproduitservice) $libelleproduitservice.="\n";
|
if ($libelleproduitservice) $libelleproduitservice.="<br>";
|
||||||
|
|
||||||
if ($propale->lignes[$i]->desc == '(CREDIT_NOTE)' && $propale->lignes[$i]->fk_remise_except)
|
if ($propale->lignes[$i]->desc == '(CREDIT_NOTE)' && $propale->lignes[$i]->fk_remise_except)
|
||||||
{
|
{
|
||||||
$discount=new DiscountAbsolute($this->db);
|
$discount=new DiscountAbsolute($this->db);
|
||||||
$discount->fetch($propale->lignes[$i]->fk_remise_except);
|
$discount->fetch($propale->lignes[$i]->fk_remise_except);
|
||||||
$libelleproduitservice=$langs->trans("DiscountFromCreditNote",$discount->ref_facture_source);
|
$libelleproduitservice=dol_htmlentitiesbr($langs->trans("DiscountFromCreditNote",$discount->ref_facture_source),1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$libelleproduitservice.=dol_htmlentities($propale->lignes[$i]->desc);
|
$libelleproduitservice.=dol_htmlentitiesbr($propale->lignes[$i]->desc,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Si ligne associée à un code produit
|
// Si ligne associée à un code produit
|
||||||
@ -271,7 +271,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
if ($propale->lignes[$i]->date_start && $propale->lignes[$i]->date_end)
|
if ($propale->lignes[$i]->date_start && $propale->lignes[$i]->date_end)
|
||||||
{
|
{
|
||||||
// Affichage durée si il y en a une
|
// Affichage durée si il y en a une
|
||||||
$libelleproduitservice.=dol_htmlentities("\n(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($propale->lignes[$i]->date_start)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($propale->lignes[$i]->date_end).")");
|
$libelleproduitservice.="<br>".dol_htmlentitiesbr("(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($propale->lignes[$i]->date_start)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($propale->lignes[$i]->date_end).")",1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page
|
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class DolEditor
|
|||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT."/includes/fckeditor/fckeditor.php");
|
require_once(DOL_DOCUMENT_ROOT."/includes/fckeditor/fckeditor.php");
|
||||||
|
|
||||||
$content=dol_htmlentities($content); // If content is not HTML, we convert to HTML.
|
$content=dol_htmlentitiesbr($content); // If content is not HTML, we convert to HTML.
|
||||||
|
|
||||||
$this->editor = new FCKeditor($htmlname);
|
$this->editor = new FCKeditor($htmlname);
|
||||||
$this->editor->BasePath = DOL_URL_ROOT.'/includes/fckeditor/' ;
|
$this->editor->BasePath = DOL_URL_ROOT.'/includes/fckeditor/' ;
|
||||||
|
|||||||
@ -1555,8 +1555,9 @@ function print_liste_field_titre($name, $file, $field, $begin="", $options="", $
|
|||||||
// If this is a sort field
|
// If this is a sort field
|
||||||
if ($field)
|
if ($field)
|
||||||
{
|
{
|
||||||
print " ";
|
//print " ";
|
||||||
if (! $sortorder)
|
print '<img width="2px" src="/theme/common/transparent.png">';
|
||||||
|
if (! $sortorder)
|
||||||
{
|
{
|
||||||
print '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'.img_down("A-Z",0).'</a>';
|
print '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'.img_down("A-Z",0).'</a>';
|
||||||
print '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'.img_up("Z-A",0).'</a>';
|
print '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'.img_up("Z-A",0).'</a>';
|
||||||
@ -2534,24 +2535,51 @@ function hexbin($hexa){
|
|||||||
return $bin;
|
return $bin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief Cette fonction est appelée pour coder ou non une chaine en html.
|
* \brief Replace CRLF in string with a HTML BR tag.
|
||||||
* \param stringtoencode String to encode
|
* \param string2encode String to encode
|
||||||
* \param htmlinfo 1=String IS already html, 0=String IS NOT html, -1=Unknown need autodetection
|
* \param nl2brmode 0=Adding br before \n, 1=Replacing \n by br
|
||||||
* \remarks Selon qu'on compte l'afficher dans le PDF avec:
|
* \return string String encoded
|
||||||
* writeHTMLCell -> a besoin d'etre encodé en HTML
|
|
||||||
* MultiCell -> ne doit pas etre encodé en HTML
|
|
||||||
*/
|
*/
|
||||||
function dol_htmlentities($stringtoencode,$htmlinfo=-1)
|
function dol_nl2br($stringtoencode,$nl2brmode=0)
|
||||||
{
|
{
|
||||||
if ($htmlinfo == 1) return $stringtoencode;
|
if (! $nl2brmode) return nl2br($stringtoencode);
|
||||||
if ($htmlinfo == 0) return nl2br(htmlentities($stringtoencode));
|
else
|
||||||
if ($htmlinfo == -1)
|
|
||||||
{
|
{
|
||||||
if (dol_textishtml($stringtoencode)) return $stringtoencode;
|
$ret=ereg_replace("\r","",$stringtoencode);
|
||||||
else return nl2br(htmlentities($stringtoencode));
|
$ret=ereg_replace("\n","<br>",$ret);
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
return $stringtoencode;
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief This function is called to encode a string into a HTML string
|
||||||
|
* \param stringtoencode String to encode
|
||||||
|
* \param nl2brmode 0=Adding br before \n, 1=Replacing \n by br
|
||||||
|
* \remarks For PDF usage, you can show text by 2 ways:
|
||||||
|
* - writeHTMLCell -> param must be encoded into HTML.
|
||||||
|
* - MultiCell -> param must not be encoded into HTML.
|
||||||
|
* Because writeHTMLCell convert also \n into <br>, if function
|
||||||
|
* is used to build PDF, nl2br must be 1.
|
||||||
|
*/
|
||||||
|
function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0)
|
||||||
|
{
|
||||||
|
if (dol_textishtml($stringtoencode)) return $stringtoencode;
|
||||||
|
else return dol_nl2br(htmlentities($stringtoencode),$nl2brmode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* \brief This function is called to decode a HTML string
|
||||||
|
* \param stringtodecode String to decode
|
||||||
|
*/
|
||||||
|
function dol_htmlentitiesbr_decode($stringtodecode)
|
||||||
|
{
|
||||||
|
$ret=html_entity_decode($stringtodecode);
|
||||||
|
$ret=eregi_replace("\r\n".'<br ?/?>',"<br>",$ret);
|
||||||
|
$ret=eregi_replace('<br ?/?>'."\r\n","\r\n",$ret);
|
||||||
|
$ret=eregi_replace('<br ?/?>'."\n","\n",$ret);
|
||||||
|
$ret=eregi_replace('<br ?/?>',"\n",$ret);
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -197,11 +197,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
|
||||||
// Description de la ligne produit
|
// Description de la ligne produit
|
||||||
$libelleproduitservice=dol_htmlentities($delivery->lignes[$i]->label);
|
$libelleproduitservice=dol_htmlentitiesbr($delivery->lignes[$i]->label,1);
|
||||||
if ($delivery->lignes[$i]->description&&$delivery->lignes[$i]->description!=$delivery->lignes[$i]->label)
|
if ($delivery->lignes[$i]->description && $delivery->lignes[$i]->description!=$delivery->lignes[$i]->label)
|
||||||
{
|
{
|
||||||
if ($libelleproduitservice) $libelleproduitservice.="\n";
|
if ($libelleproduitservice) $libelleproduitservice.="<br>";
|
||||||
$libelleproduitservice.=dol_htmlentities($delivery->lignes[$i]->description);
|
$libelleproduitservice.=dol_htmlentitiesbr($delivery->lignes[$i]->description,1);
|
||||||
}
|
}
|
||||||
// Si ligne associée à un code produit
|
// Si ligne associée à un code produit
|
||||||
if ($delivery->lignes[$i]->fk_product)
|
if ($delivery->lignes[$i]->fk_product)
|
||||||
@ -226,7 +226,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
if ($delivery->lignes[$i]->date_start && $delivery->lignes[$i]->date_end)
|
if ($delivery->lignes[$i]->date_start && $delivery->lignes[$i]->date_end)
|
||||||
{
|
{
|
||||||
// Affichage durée si il y en a une
|
// Affichage durée si il y en a une
|
||||||
$libelleproduitservice.="\n(".$langs->transnoentities("From")." ".dolibarr_print_date($delivery->lignes[$i]->date_start)." ".$langs->transnoentities("to")." ".dolibarr_print_date($delivery->lignes[$i]->date_end).")";
|
$libelleproduitservice.="<br>".dol_htmlentitiesbr("(".$langs->transnoentities("From")." ".dolibarr_print_date($delivery->lignes[$i]->date_start)." ".$langs->transnoentities("to")." ".dolibarr_print_date($delivery->lignes[$i]->date_end).")",1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page
|
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page
|
||||||
|
|||||||
@ -983,7 +983,7 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="desc" rows="4" cols="90">';
|
print '<textarea name="desc" rows="4" cols="90">';
|
||||||
print $product->description;
|
print dol_htmlentitiesbr_decode($product->description);
|
||||||
print "</textarea>";
|
print "</textarea>";
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
@ -1029,7 +1029,7 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="note" rows="8" cols="70">';
|
print '<textarea name="note" rows="8" cols="70">';
|
||||||
print $product->note;
|
print dol_htmlentitiesbr_decode($product->note);
|
||||||
print "</textarea>";
|
print "</textarea>";
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|||||||
@ -161,7 +161,7 @@ if ($_GET["action"] == 'create')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="desc" cols="70" rows="5">'.$entrepot->description.'</textarea>';
|
print '<textarea name="desc" cols="70" rows="5">'.dol_htmlentitiesbr_decode($entrepot->description).'</textarea>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -414,7 +414,7 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="desc" cols="70" rows="5">'.$entrepot->description.'</textarea>';
|
print '<textarea name="desc" cols="70" rows="5">'.dol_htmlentitiesbr_decode($entrepot->description).'</textarea>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -168,7 +168,7 @@ if ($_GET["action"] == 'edit')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="desc-'.$key.'" rows="3" cols="80">'.$product->multilangs[$key]["description"].'</textarea>';
|
print '<textarea name="desc-'.$key.'" rows="3" cols="80">'.dol_htmlentitiesbr_decode($product->multilangs[$key]["description"]).'</textarea>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td valign="top" width="15%">'.$langs->trans('Note').'</td><td>';
|
print '<tr><td valign="top" width="15%">'.$langs->trans('Note').'</td><td>';
|
||||||
@ -180,7 +180,7 @@ if ($_GET["action"] == 'edit')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="note-'.$key.'" rows="3" cols="80">'.$product->multilangs[$key]["note"].'</textarea>';
|
print '<textarea name="note-'.$key.'" rows="3" cols="80">'.dol_htmlentitiesbr_decode($product->multilangs[$key]["note"]).'</textarea>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -106,7 +106,7 @@ if ($socid > 0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="note" cols="70" rows="10">'.$societe->note.'</textarea>';
|
print '<textarea name="note" cols="70" rows="10">'.dol_htmlentitiesbr_decode($societe->note).'</textarea>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -411,7 +411,7 @@ else
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea class="flat" name="note" rows="'.ROWS_8.'" cols="90">';
|
print '<textarea class="flat" name="note" rows="'.ROWS_8.'" cols="90">';
|
||||||
print $group->note;
|
print dol_htmlentitiesbr_decode($group->note);
|
||||||
print '</textarea>';
|
print '</textarea>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -122,7 +122,7 @@ if ($id)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<textarea name="note" cols="80" rows="10">'.$fuser->note.'</textarea>';
|
print '<textarea name="note" cols="80" rows="10">'.dol_htmlentitiesbr_decode($fuser->note).'</textarea>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user