Change to uniformize code of PDF generators
This commit is contained in:
parent
5de23dcc59
commit
ce6f8a1c81
@ -785,7 +785,7 @@ class Commande extends CommonObject
|
|||||||
$this->lines[] = $line;
|
$this->lines[] = $line;
|
||||||
|
|
||||||
/** POUR AJOUTER AUTOMATIQUEMENT LES SOUSPRODUITS a LA COMMANDE
|
/** POUR AJOUTER AUTOMATIQUEMENT LES SOUSPRODUITS a LA COMMANDE
|
||||||
if($conf->global->PRODUIT_SOUSPRODUITS == 1)
|
if (! empty($conf->global->PRODUIT_SOUSPRODUITS))
|
||||||
{
|
{
|
||||||
$prod = new Product($this->db, $idproduct);
|
$prod = new Product($this->db, $idproduct);
|
||||||
$prod -> get_sousproduits_arbo ();
|
$prod -> get_sousproduits_arbo ();
|
||||||
@ -990,9 +990,9 @@ class Commande extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Reinitialise le tableau lignes
|
* \brief Reinitialize array lignes
|
||||||
* \param only_product Ne renvoie que ligne liees a des produits physiques predefinis
|
* \param only_product Return only physical products
|
||||||
* \return array Tableau de CommandeLigne
|
* \return array Array of CommandeLigne
|
||||||
*/
|
*/
|
||||||
function fetch_lines($only_product=0)
|
function fetch_lines($only_product=0)
|
||||||
{
|
{
|
||||||
@ -1008,7 +1008,7 @@ class Commande extends CommonObject
|
|||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)';
|
||||||
$sql.= ' WHERE l.fk_commande = '.$this->id;
|
$sql.= ' WHERE l.fk_commande = '.$this->id;
|
||||||
if ($only_product==1) $sql .= ' AND p.fk_product_type = 0';
|
if ($only_product) $sql .= ' AND p.fk_product_type = 0';
|
||||||
$sql .= ' ORDER BY l.rang';
|
$sql .= ' ORDER BY l.rang';
|
||||||
|
|
||||||
dolibarr_syslog("Commande::fetch_lines sql=".$sql,LOG_DEBUG);
|
dolibarr_syslog("Commande::fetch_lines sql=".$sql,LOG_DEBUG);
|
||||||
@ -1023,8 +1023,8 @@ class Commande extends CommonObject
|
|||||||
$objp = $this->db->fetch_object($result);
|
$objp = $this->db->fetch_object($result);
|
||||||
|
|
||||||
$ligne = new CommandeLigne($this->db);
|
$ligne = new CommandeLigne($this->db);
|
||||||
$ligne->rowid = $objp->rowid;
|
$ligne->rowid = $objp->rowid; // \deprecated
|
||||||
$ligne->id = $objp->rowid; // \deprecated
|
$ligne->id = $objp->rowid;
|
||||||
$ligne->fk_commande = $objp->fk_commande;
|
$ligne->fk_commande = $objp->fk_commande;
|
||||||
$ligne->commande_id = $objp->fk_commande; // \deprecated
|
$ligne->commande_id = $objp->fk_commande; // \deprecated
|
||||||
$ligne->desc = $objp->description; // Description ligne
|
$ligne->desc = $objp->description; // Description ligne
|
||||||
@ -1057,6 +1057,7 @@ class Commande extends CommonObject
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -232,8 +232,8 @@ class Expedition extends CommonObject
|
|||||||
if ($conf->livraison_bon->enabled) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON e.rowid = l.fk_expedition";
|
if ($conf->livraison_bon->enabled) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON e.rowid = l.fk_expedition";
|
||||||
$sql.= " WHERE e.rowid = ".$id;
|
$sql.= " WHERE e.rowid = ".$id;
|
||||||
|
|
||||||
|
dolibarr_syslog("Expedition::fetch sql=".$sql);
|
||||||
$result = $this->db->query($sql) ;
|
$result = $this->db->query($sql) ;
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
if ($this->db->num_rows($result))
|
if ($this->db->num_rows($result))
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
@ -474,7 +474,7 @@ if ($_GET["action"] == 'create')
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Show subproducts of product
|
// Show subproducts of product
|
||||||
if ($ligne->fk_product > 0)
|
if (! empty($conf->global->PRODUIT_SOUSPRODUITS) && $ligne->fk_product > 0)
|
||||||
{
|
{
|
||||||
$product->get_sousproduits_arbo ();
|
$product->get_sousproduits_arbo ();
|
||||||
$prods_arbo = $product->get_arbo_each_prod($qtyProdCom);
|
$prods_arbo = $product->get_arbo_each_prod($qtyProdCom);
|
||||||
@ -783,10 +783,17 @@ else
|
|||||||
|
|
||||||
if (! eregi('^(valid|delete)',$_REQUEST["action"]))
|
if (! eregi('^(valid|delete)',$_REQUEST["action"]))
|
||||||
{
|
{
|
||||||
if ($expedition->statut == 0 && $user->rights->expedition->valider && $num_prod > 0)
|
if ($expedition->statut == 0 && $num_prod > 0)
|
||||||
|
{
|
||||||
|
if ($user->rights->expedition->valider)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="fiche.php?id='.$expedition->id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
print '<a class="butAction" href="fiche.php?id='.$expedition->id.'&action=valid">'.$langs->trans("Validate").'</a>';
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Validate").'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($conf->livraison_bon->enabled && $expedition->statut == 1 && $user->rights->expedition->livraison->creer && !$expedition->livraison_id)
|
if ($conf->livraison_bon->enabled && $expedition->statut == 1 && $user->rights->expedition->livraison->creer && !$expedition->livraison_id)
|
||||||
{
|
{
|
||||||
@ -816,7 +823,7 @@ else
|
|||||||
|
|
||||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$expedition->id;
|
$urlsource = $_SERVER["PHP_SELF"]."?id=".$expedition->id;
|
||||||
|
|
||||||
$genallowed=$user->rights->expedition->lire && ($expedition->statut > 0);
|
$genallowed=$user->rights->expedition->lire;
|
||||||
$delallowed=$user->rights->expedition->supprimer;
|
$delallowed=$user->rights->expedition->supprimer;
|
||||||
//$genallowed=1;
|
//$genallowed=1;
|
||||||
//$delallowed=0;
|
//$delallowed=0;
|
||||||
|
|||||||
@ -195,37 +195,37 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||||
|
|
||||||
//Recuperation des produits de la commande.
|
//Recuperation des produits de la commande.
|
||||||
if ($this->expe->ref != 'SPECIMEN') $this->expe->commande->fetch_lines(1);
|
|
||||||
|
|
||||||
$Produits = $this->expe->commande->lignes;
|
$Produits = $this->expe->commande->lignes;
|
||||||
$nblignes = sizeof($Produits);
|
$nblignes = sizeof($Produits);
|
||||||
|
|
||||||
for ($i = 0 ; $i < $nblignes ; $i++){
|
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||||
//Generation du produit
|
{
|
||||||
$Prod = new Product($this->db);
|
// Description de la ligne produit
|
||||||
$Prod->fetch($Produits[$i]->fk_product);
|
$libelleproduitservice=pdf_getlinedesc($this->expe->commande->lignes[$i],$outputlangs);
|
||||||
|
//if ($i==1) { print $this->expe->commande->lignes[$i]->libelle.' - '.$libelleproduitservice; exit; }
|
||||||
|
|
||||||
//Creation des cases a cocher
|
//Creation des cases a cocher
|
||||||
$pdf->rect(10+3, $curY+1, 3, 3);
|
$pdf->rect(10+3, $curY+1, 3, 3);
|
||||||
$pdf->rect(20+3, $curY+1, 3, 3);
|
$pdf->rect(20+3, $curY+1, 3, 3);
|
||||||
//Insertion de la reference du produit
|
//Insertion de la reference du produit
|
||||||
$pdf->SetXY (30, $curY );
|
$pdf->SetXY (30, $curY+1 );
|
||||||
$pdf->SetFont('Arial','B', 7);
|
$pdf->SetFont('Arial','B', 7);
|
||||||
$pdf->MultiCell(24, 5, $outputlangs->convToOutputCharset($Prod->ref), 0, 'L', 0);
|
$pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($this->expe->commande->lignes[$i]->ref), 0, 'L', 0);
|
||||||
//Insertion du libelle
|
//Insertion du libelle
|
||||||
$pdf->SetFont('Arial','', 7);
|
$pdf->SetFont('Arial','', 7);
|
||||||
$pdf->SetXY (50, $curY );
|
$pdf->SetXY (50, $curY+1 );
|
||||||
$pdf->MultiCell(90, 5, $outputlangs->convToOutputCharset($Prod->libelle), 0, 'L', 0);
|
$pdf->writeHTMLCell(90, 3, 50, $curY+1, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 'L', 0);
|
||||||
//Insertion de la quantite commandee
|
//Insertion de la quantite commandee
|
||||||
$pdf->SetFont('Arial','', 7);
|
$pdf->SetFont('Arial','', 7);
|
||||||
$pdf->SetXY (140, $curY );
|
$pdf->SetXY (140, $curY+1 );
|
||||||
$pdf->MultiCell(30, 5, $this->expe->lignes[$i]->qty_asked, 0, 'C', 0);
|
$pdf->MultiCell(30, 3, $this->expe->lignes[$i]->qty_asked, 0, 'C', 0);
|
||||||
//Insertion de la quantite a envoyer
|
//Insertion de la quantite a envoyer
|
||||||
$pdf->SetFont('Arial','', 7);
|
$pdf->SetFont('Arial','', 7);
|
||||||
$pdf->SetXY (170, $curY );
|
$pdf->SetXY (170, $curY+1 );
|
||||||
$pdf->MultiCell(30, 5, $this->expe->lignes[$i]->qty_shipped, 0, 'C', 0);
|
$pdf->MultiCell(30, 3, $this->expe->lignes[$i]->qty_shipped, 0, 'C', 0);
|
||||||
|
|
||||||
//Generation de la page 2
|
//Generation de la page 2
|
||||||
$curY += 4;
|
$curY += (dol_nboflines_bis($libelleproduitservice)*3+1);
|
||||||
$nexY = $curY;
|
$nexY = $curY;
|
||||||
if ($nexY > ($tab_top+$tab_height-10) && $i < $nblignes - 1)
|
if ($nexY > ($tab_top+$tab_height-10) && $i < $nblignes - 1)
|
||||||
{
|
{
|
||||||
@ -233,7 +233,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$this->_pagefoot($pdf, $outputlangs);
|
$this->_pagefoot($pdf, $outputlangs);
|
||||||
$pdf->AliasNbPages();
|
$pdf->AliasNbPages();
|
||||||
|
|
||||||
$nexY = $iniY;
|
$curY = $iniY;
|
||||||
|
|
||||||
// New page
|
// New page
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
@ -348,24 +348,24 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$pdf->MultiCell(100, 3, $langs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
|
$pdf->MultiCell(100, 3, $langs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($this->emetteur->nom), 0, 'L');
|
else $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->nom), 0, 'L');
|
||||||
|
|
||||||
//*********************Entete****************************
|
//*********************Entete****************************
|
||||||
//Nom du Document
|
//Nom du Document
|
||||||
$Xoff = 94;
|
$Xoff = 90;
|
||||||
$Yoff = 0;
|
$Yoff = 0;
|
||||||
$pdf->SetXY($Xoff,7);
|
$pdf->SetXY($Xoff,7);
|
||||||
$pdf->SetFont('Arial','B',12);
|
$pdf->SetFont('Arial','B',12);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->MultiCell(0, 8, $outputlangs->transnoentities("SendingSheet"), '' , 'L'); // Bordereau expedition
|
$pdf->MultiCell(0, 3, $outputlangs->transnoentities("SendingSheet"), '' , 'L'); // Bordereau expedition
|
||||||
//Num Expedition
|
//Num Expedition
|
||||||
$Yoff = $Yoff+7;
|
$Yoff = $Yoff+7;
|
||||||
$Xoff = 160;
|
$Xoff = 154;
|
||||||
// $pdf->rect($Xoff, $Yoff, 85, 8);
|
// $pdf->rect($Xoff, $Yoff, 85, 8);
|
||||||
$pdf->SetXY($Xoff,$Yoff);
|
$pdf->SetXY($Xoff,$Yoff);
|
||||||
$pdf->SetFont('Arial','',8);
|
$pdf->SetFont('Arial','',8);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->MultiCell(0, 8, $outputlangs->transnoentities("RefSending").': '.$outputlangs->convToOutputCharset($exp->ref), '' , 'L');
|
$pdf->MultiCell(0, 3, $outputlangs->transnoentities("RefSending").': '.$outputlangs->convToOutputCharset($exp->ref), '' , 'L');
|
||||||
//$this->Code39($Xoff+43, $Yoff+1, $this->expe->ref,$ext = true, $cks = false, $w = 0.4, $h = 4, $wide = true);
|
//$this->Code39($Xoff+43, $Yoff+1, $this->expe->ref,$ext = true, $cks = false, $w = 0.4, $h = 4, $wide = true);
|
||||||
//Num Commande
|
//Num Commande
|
||||||
$Yoff = $Yoff+4;
|
$Yoff = $Yoff+4;
|
||||||
@ -373,7 +373,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$pdf->SetXY($Xoff,$Yoff);
|
$pdf->SetXY($Xoff,$Yoff);
|
||||||
$pdf->SetFont('Arial','',8);
|
$pdf->SetFont('Arial','',8);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->MultiCell(0, 8, $outputlangs->transnoentities("RefOrder").': '.$outputlangs->convToOutputCharset($exp->commande->ref), '' , 'L');
|
$pdf->MultiCell(0, 3, $outputlangs->transnoentities("RefOrder").': '.$outputlangs->convToOutputCharset($exp->commande->ref), '' , 'L');
|
||||||
|
|
||||||
//$this->Code39($Xoff+43, $Yoff+1, $exp->commande->ref,$ext = true, $cks = false, $w = 0.4, $h = 4, $wide = true);
|
//$this->Code39($Xoff+43, $Yoff+1, $exp->commande->ref,$ext = true, $cks = false, $w = 0.4, $h = 4, $wide = true);
|
||||||
//Definition Emplacement du bloc Societe
|
//Definition Emplacement du bloc Societe
|
||||||
|
|||||||
@ -216,8 +216,6 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
$curY = $this->tableau_top + 4;
|
$curY = $this->tableau_top + 4;
|
||||||
$pdf->writeHTMLCell(30, 3, 170, $curY, $outputlangs->trans("QtyToShip"), 0, 0);
|
$pdf->writeHTMLCell(30, 3, 170, $curY, $outputlangs->trans("QtyToShip"), 0, 0);
|
||||||
|
|
||||||
if ($this->expe->ref != 'SPECIMEN') $this->expe->fetch_lines();
|
|
||||||
|
|
||||||
for ($i = 0 ; $i < sizeof($this->expe->lignes) ; $i++)
|
for ($i = 0 ; $i < sizeof($this->expe->lignes) ; $i++)
|
||||||
{
|
{
|
||||||
$curY = $this->tableau_top + 14 + ($i * 7);
|
$curY = $this->tableau_top + 14 + ($i * 7);
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
# Dolibarr language file - en_US - errors
|
# Dolibarr language file - en_US - errors
|
||||||
CHARSET=UTF-8
|
CHARSET=UTF-8
|
||||||
|
MenuManager=Menu manager
|
||||||
ErrorLoginAlreadyExists=Login %s already exists.
|
ErrorLoginAlreadyExists=Login %s already exists.
|
||||||
ErrorGroupAlreadyExists=Group %s already exists.
|
ErrorGroupAlreadyExists=Group %s already exists.
|
||||||
ErrorDuplicateTrigger=A trigger file with class nam '<b>%s</b>' is present sevaral times. Remove duplicate trigger file in directory '<b>%s</b>'.
|
ErrorDuplicateTrigger=A trigger file with class nam '<b>%s</b>' is present sevaral times. Remove duplicate trigger file in directory '<b>%s</b>'.
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
# Dolibarr language file - fr_FR - errors
|
# Dolibarr language file - fr_FR - errors
|
||||||
CHARSET=UTF-8
|
CHARSET=UTF-8
|
||||||
|
MenuManager=Gestionnaire de menu
|
||||||
ErrorLoginAlreadyExists=Le login %s existe déjà.
|
ErrorLoginAlreadyExists=Le login %s existe déjà.
|
||||||
ErrorGroupAlreadyExists=Le groupe %s existe déjà.
|
ErrorGroupAlreadyExists=Le groupe %s existe déjà.
|
||||||
ErrorDuplicateTrigger=Un fichier trigger de classe '<b>%s</b>' est present plusieurs fois. Supprimer le doublon du répertoire '<b>%s</b>'.
|
ErrorDuplicateTrigger=Un fichier trigger de classe '<b>%s</b>' est present plusieurs fois. Supprimer le doublon du répertoire '<b>%s</b>'.
|
||||||
|
|||||||
@ -1576,7 +1576,7 @@ function dol_print_error($db='',$error='')
|
|||||||
print $langs->trans("DolibarrHasDetectedError").".<br>\n";
|
print $langs->trans("DolibarrHasDetectedError").".<br>\n";
|
||||||
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||||
print "You use an experimental level of features, so please do NOT report any bugs, anywhere, until going back to MAIN_FEATURES_LEVEL = 0.<br>\n";
|
print "You use an experimental level of features, so please do NOT report any bugs, anywhere, until going back to MAIN_FEATURES_LEVEL = 0.<br>\n";
|
||||||
print $langs->trans("InformationToHelpDiagnose").":<br><br>\n";
|
print $langs->trans("InformationToHelpDiagnose").":<br>\n";
|
||||||
|
|
||||||
print "<b>".$langs->trans("Dolibarr").":</b> ".DOL_VERSION."<br>\n";;
|
print "<b>".$langs->trans("Dolibarr").":</b> ".DOL_VERSION."<br>\n";;
|
||||||
print "<b>".$langs->trans("Date").":</b> ".dolibarr_print_date(time(),'dayhourlog')."<br>\n";;
|
print "<b>".$langs->trans("Date").":</b> ".dolibarr_print_date(time(),'dayhourlog')."<br>\n";;
|
||||||
@ -1585,6 +1585,7 @@ function dol_print_error($db='',$error='')
|
|||||||
print "<b>".$langs->trans("RequestedUrl").":</b> ".$_SERVER["REQUEST_URI"]."<br>\n";;
|
print "<b>".$langs->trans("RequestedUrl").":</b> ".$_SERVER["REQUEST_URI"]."<br>\n";;
|
||||||
print "<b>".$langs->trans("Referer").":</b> ".$_SERVER["HTTP_REFERER"]."<br>\n";;
|
print "<b>".$langs->trans("Referer").":</b> ".$_SERVER["HTTP_REFERER"]."<br>\n";;
|
||||||
print "<b>".$langs->trans("MenuManager").":</b> ".$conf->left_menu.'/'.$conf->top_menu."<br>\n";
|
print "<b>".$langs->trans("MenuManager").":</b> ".$conf->left_menu.'/'.$conf->top_menu."<br>\n";
|
||||||
|
print "<br>\n";
|
||||||
$syslog.="url=".$_SERVER["REQUEST_URI"];
|
$syslog.="url=".$_SERVER["REQUEST_URI"];
|
||||||
$syslog.=", query_string=".$_SERVER["QUERY_STRING"];
|
$syslog.=", query_string=".$_SERVER["QUERY_STRING"];
|
||||||
}
|
}
|
||||||
@ -2457,6 +2458,7 @@ function dol_nl2br($stringtoencode,$nl2brmode=0)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief This function is called to encode a string into a HTML string. All entities except <> are converted.
|
* \brief This function is called to encode a string into a HTML string. All entities except <> are converted.
|
||||||
|
* This function also remove last CR/BR.
|
||||||
* \param stringtoencode String to encode
|
* \param stringtoencode String to encode
|
||||||
* \param nl2brmode 0=Adding br before \n, 1=Replacing \n by br (for use with FPDF writeHTMLCell function for example)
|
* \param nl2brmode 0=Adding br before \n, 1=Replacing \n by br (for use with FPDF writeHTMLCell function for example)
|
||||||
* \remarks For PDF usage, you can show text by 2 ways:
|
* \remarks For PDF usage, you can show text by 2 ways:
|
||||||
@ -2470,9 +2472,10 @@ function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0,$pagecodefrom='UTF-8')
|
|||||||
if (dol_textishtml($stringtoencode))
|
if (dol_textishtml($stringtoencode))
|
||||||
{
|
{
|
||||||
//$trans = get_html_translation_table(HTML_ENTITIES, ENT_COMPAT); var_dump($trans);
|
//$trans = get_html_translation_table(HTML_ENTITIES, ENT_COMPAT); var_dump($trans);
|
||||||
$newstring=strtr($stringtoencode,array('<'=>'__lt__','>'=>'__gt__'));
|
$newstring=eregi_replace('<br( [ a-zA-Z_="]*)?/?>','<br>',$stringtoencode); // Replace "<br type="_moz" />" by "<br>". It's same and avoid pb with FPDF.
|
||||||
|
$newstring=eregi_replace('<br>$','',$newstring); // Replace "<br type="_moz" />" by "<br>". It's same and avoid pb with FPDF.
|
||||||
|
$newstring=strtr($newstring,array('<'=>'__lt__','>'=>'__gt__'));
|
||||||
$newstring=@htmlentities($newstring,ENT_COMPAT,$pagecodefrom); // Make entity encoding
|
$newstring=@htmlentities($newstring,ENT_COMPAT,$pagecodefrom); // Make entity encoding
|
||||||
$newstring=eregi_replace('<br( [ a-zA-Z_="]*)?/?>','<br>',$newstring); // Replace "<br type="_moz" />" by "<br>". It's same and avoid pb with FPDF.
|
|
||||||
$newstring=strtr($newstring,array('__lt__'=>'<','__gt__'=>'>'));
|
$newstring=strtr($newstring,array('__lt__'=>'<','__gt__'=>'>'));
|
||||||
// If already HTML, CR should be <br> so we don't change \n
|
// If already HTML, CR should be <br> so we don't change \n
|
||||||
}
|
}
|
||||||
@ -2572,7 +2575,7 @@ function dol_nboflines_bis($texte,$maxlinesize=0)
|
|||||||
$texte = strtr($texte, $repTable);
|
$texte = strtr($texte, $repTable);
|
||||||
$pattern = '/(<[^>]+>)/Uu';
|
$pattern = '/(<[^>]+>)/Uu';
|
||||||
$a = preg_split($pattern, $texte, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
|
$a = preg_split($pattern, $texte, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
|
||||||
$nblines = ((count($a)+1)/2);
|
$nblines = floor((count($a)+1)/2);
|
||||||
// count possible auto line breaks
|
// count possible auto line breaks
|
||||||
if($maxlinesize)
|
if($maxlinesize)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1993,13 +1993,14 @@ class Product extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function get_sousproduits_arbo ()
|
function get_sousproduits_arbo ()
|
||||||
{
|
{
|
||||||
|
|
||||||
$peres = $this -> get_pere();
|
$peres = $this -> get_pere();
|
||||||
foreach($peres as $k=>$v)
|
foreach($peres as $k=>$v)
|
||||||
{
|
{
|
||||||
foreach($this -> get_fils_arbo($v[0]) as $kf=>$vf)
|
foreach($this -> get_fils_arbo($v[0]) as $kf=>$vf)
|
||||||
|
{
|
||||||
$peres[$k][$kf] = $vf;
|
$peres[$k][$kf] = $vf;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// on concat<61>ne tout <20>a
|
// on concat<61>ne tout <20>a
|
||||||
foreach($peres as $k=>$v)
|
foreach($peres as $k=>$v)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -145,8 +145,6 @@ dolibarr_fiche_head($head, 'subproduct', $titre);
|
|||||||
*/
|
*/
|
||||||
if ($id || $ref)
|
if ($id || $ref)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if ( $result )
|
if ( $result )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user