';
print '';
diff --git a/htdocs/core/admin_extrafields.inc.php b/htdocs/core/admin_extrafields.inc.php
index 5384c3c4490..35492db4fdc 100644
--- a/htdocs/core/admin_extrafields.inc.php
+++ b/htdocs/core/admin_extrafields.inc.php
@@ -25,9 +25,9 @@ $maxsizestring=255;
$maxsizeint=10;
$extrasize=GETPOST('size');
-if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8';
-if (GETPOST('type')=='date') $extrasize='';
-if (GETPOST('type')=='datetime') $extrasize='';
+if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8';
+if (GETPOST('type')=='date') $extrasize='';
+if (GETPOST('type')=='datetime') $extrasize='';
// Add attribute
@@ -38,10 +38,10 @@ if ($action == 'add')
// Check values
if (! GETPOST('type'))
{
- $error++;
- $langs->load("errors");
- $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
- $action = 'create';
+ $error++;
+ $langs->load("errors");
+ $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
+ $action = 'create';
}
if (GETPOST('type')=='varchar' && $extrasize > $maxsizestring)
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index d2eb3c0f4af..299df8afdf1 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -369,8 +369,8 @@ class Form
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
$s="";
if (empty($notabs)) $s.='
';
- if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''.$tag.'>';
- if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''.$tag.'>';
+ if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''.$tag.'>';
+ if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''.$tag.'>';
if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''.$tag.'>';
if (empty($notabs)) $s.='
';
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index edef760ec00..b7f3bb0e6b4 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -199,9 +199,9 @@ class FormFile
global $langs,$bc,$conf;
- // For backward compatibility
- if (! empty($iconPDF)) {
- return $this->getDocumentsLink($modulepart, $filename, $filedir);
+ // For backward compatibility
+ if (! empty($iconPDF)) {
+ return $this->getDocumentsLink($modulepart, $filename, $filedir);
}
$forname='builddoc';
@@ -470,15 +470,15 @@ class FormFile
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
$out.= '>';
$out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength);
- $out.= ''."\n";
+ $out.= ''."\n";
$out.= '';
-
+
// Show file size
- $size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"]));
+ $size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"]));
$out.= '
'.dol_print_size($size).'
';
-
+
// Show file date
- $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"]));
+ $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"]));
$out.= '
'.dol_print_date($date, 'dayhour').'
';
if ($delallowed)
@@ -526,35 +526,39 @@ class FormFile
}
$out='';
-
+
+ $this->numoffiles=0;
+
$file_list=dol_dir_list($filedir, 'files', 0, $filename.'.pdf', '\.meta$|\.png$');
- // For ajax treatment
+ // For ajax treatment
$out.= '
'.img_picto('', 'refresh').'
'."\n";
if (! empty($file_list))
{
- // Loop on each file found
- foreach($file_list as $file)
- {
- // Define relative path for download link (depends on module)
- $relativepath=$file["name"]; // Cas general
- if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture...
- // Autre cas
- if ($modulepart == 'donation') {
- $relativepath = get_exdir($filename,2).$file["name"];
- }
- if ($modulepart == 'export') {
- $relativepath = $file["name"];
- }
-
- // Show file name with link to download
- $out.= '';
- $out.= img_pdf($file["name"],2);
- $out.= ''."\n";
+ // Loop on each file found
+ foreach($file_list as $file)
+ {
+ // Define relative path for download link (depends on module)
+ $relativepath=$file["name"]; // Cas general
+ if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture...
+ // Autre cas
+ if ($modulepart == 'donation') {
+ $relativepath = get_exdir($filename,2).$file["name"];
+ }
+ if ($modulepart == 'export') {
+ $relativepath = $file["name"];
+ }
+
+ // Show file name with link to download
+ $out.= '';
+ $out.= img_pdf($file["name"],2);
+ $out.= ''."\n";
+
+ $this->numoffiles++;
}
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 160970b3aae..73b8541ac2a 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -739,12 +739,12 @@ function dol_format_address($object)
}
else if (in_array($object->country_code,array('GB'))) // UK: title firstname name \n address lines \n town state \n zip \n country
{
- $ret .= ($ret ? "\n" : '' ).$object->town;
- if ($object->state && in_array($object->country_code,$countriesusingstate))
- {
- $ret.=", ".$object->departement;
- }
- if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip;
+ $ret .= ($ret ? "\n" : '' ).$object->town;
+ if ($object->state && in_array($object->country_code,$countriesusingstate))
+ {
+ $ret.=", ".$object->departement;
+ }
+ if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip;
}
else // Other: title firstname name \n address lines \n zip town \n country
{
diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php
index 189e02b2cd0..78a357cd71b 100644
--- a/htdocs/core/lib/price.lib.php
+++ b/htdocs/core/lib/price.lib.php
@@ -56,16 +56,16 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1
$result=array();
// TODO Remove this code. Added for backward compatibility. To remove once localtaxX_type is provided by caller.
- if ($localtax1_type == '?')
- {
- if ($mysoc->country_code=='ES') $localtax1_type='1';
- else $localtax1_type='0';
- }
- if ($localtax2_type == '?')
- {
- if ($mysoc->country_code=='ES') $localtax2_type='1';
- else $localtax2_type='0';
- }
+ if ($localtax1_type == '?')
+ {
+ if ($mysoc->country_code=='ES') $localtax1_type='1';
+ else $localtax1_type='0';
+ }
+ if ($localtax2_type == '?')
+ {
+ if ($mysoc->country_code=='ES') $localtax2_type='1';
+ else $localtax2_type='0';
+ }
// initialize total (may be HT or TTC depending on price_base_type)
$tot_sans_remise = $pu * $qty;
@@ -166,10 +166,10 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1
$apply_tax = false;
//If price is 'TTC' we need to have the totals without VAT for a correct calculation
- if ($price_base_type=='TTC')
- {
- $tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU');
- $tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU');
+ if ($price_base_type=='TTC')
+ {
+ $tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU');
+ $tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU');
}
switch($localtax1_type) {
diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php
index bd09ce8cd17..906a1a74e37 100644
--- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php
@@ -162,7 +162,7 @@ class pdf_expedition_merou extends ModelePdfExpedition
$pagenb=0;
$pdf->SetDrawColor(128,128,128);
- $pdf->AliasNbPages();
+ $pdf->AliasNbPages();
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("Sending"));
@@ -182,9 +182,9 @@ class pdf_expedition_merou extends ModelePdfExpedition
$pdf->SetTextColor(0,0,0);
$tab_top = 52;
- $tab_top_newpage = 10;
+ $tab_top_newpage = 10;
$tab_height = $this->page_hauteur - $tab_top - $heightforfooter;
- $tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter;
+ $tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter;
$pdf->SetFillColor(240,240,240);
$pdf->SetTextColor(0,0,0);
@@ -219,13 +219,13 @@ class pdf_expedition_merou extends ModelePdfExpedition
$pdf->SetFont('','', $default_font_size - 3);
- //Creation des cases a cocher
- $pdf->Rect(10+3, $curY, 3, 3);
- $pdf->Rect(20+3, $curY, 3, 3);
- //Insertion de la reference du produit
- $pdf->SetXY(30, $curY);
- $pdf->SetFont('','B', $default_font_size - 3);
- $pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0);
+ //Creation des cases a cocher
+ $pdf->Rect(10+3, $curY, 3, 3);
+ $pdf->Rect(20+3, $curY, 3, 3);
+ //Insertion de la reference du produit
+ $pdf->SetXY(30, $curY);
+ $pdf->SetFont('','B', $default_font_size - 3);
+ $pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0);
$pdf->SetXY(140, $curY);
$pdf->MultiCell(30, 3, $object->lines[$i]->qty_asked, 0, 'C', 0);
@@ -269,16 +269,16 @@ class pdf_expedition_merou extends ModelePdfExpedition
}
}
- // Show square
- if ($pagenb == 1)
- {
- $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 0);
- $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
- }
- else
- {
- $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 0);
- $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
+ // Show square
+ if ($pagenb == 1)
+ {
+ $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 0);
+ $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
+ }
+ else
+ {
+ $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 0);
+ $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
}
// Pied de page
diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php
index cd4af15d121..f30b676cfc0 100644
--- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php
@@ -240,10 +240,10 @@ class pdf_expedition_rouget extends ModelePdfExpedition
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
- // We suppose that a too long description is moved completely on next page
- if ($pageposafter > $pageposbefore) {
- $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
- }
+ // We suppose that a too long description is moved completely on next page
+ if ($pageposafter > $pageposbefore) {
+ $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
+ }
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
index e71db402c7a..653ec0d4344 100644
--- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
+++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
@@ -243,8 +243,8 @@ class pdf_soleil extends ModelePDFFicheinter
{
$curY = $nexY;
- $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
- $pageposbefore=$pdf->getPage();
+ $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
+ $pageposbefore=$pdf->getPage();
$pdf->SetFont('','B', $default_font_size - 1);
$pdf->SetXY($this->marge_gauche, $curY);
@@ -273,16 +273,16 @@ class pdf_soleil extends ModelePDFFicheinter
$nexY+=2; // Passe espace entre les lignes
- $pageposafter=$pdf->getPage();
- $pdf->setPage($pageposbefore);
- $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
+ $pageposafter=$pdf->getPage();
+ $pdf->setPage($pageposbefore);
+ $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
- // We suppose that a too long description is moved completely on next page
- if ($pageposafter > $pageposbefore) {
- $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
+ // We suppose that a too long description is moved completely on next page
+ if ($pageposafter > $pageposbefore) {
+ $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
}
- $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
+ $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
// Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter)
diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
index 7f5a25550a4..eebe473fd1e 100644
--- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
+++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
@@ -254,9 +254,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
- // We suppose that a too long description is moved completely on next page
- if ($pageposafter > $pageposbefore) {
- $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
+ // We suppose that a too long description is moved completely on next page
+ if ($pageposafter > $pageposbefore) {
+ $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
}
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index 7cd7d972796..6213ed5fd3a 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -36,21 +36,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
*/
class pdf_azur extends ModelePDFPropales
{
- var $db;
- var $name;
- var $description;
- var $type;
-
- var $phpmin = array(4,3,0); // Minimum version of PHP required by module
- var $version = 'dolibarr';
-
- var $page_largeur;
- var $page_hauteur;
- var $format;
- var $marge_gauche;
- var $marge_droite;
- var $marge_haute;
- var $marge_basse;
+ var $db;
+ var $name;
+ var $description;
+ var $type;
+
+ var $phpmin = array(4,3,0); // Minimum version of PHP required by module
+ var $version = 'dolibarr';
+
+ var $page_largeur;
+ var $page_hauteur;
+ var $format;
+ var $marge_gauche;
+ var $marge_droite;
+ var $marge_haute;
+ var $marge_basse;
var $emetteur; // Objet societe qui emet
@@ -279,7 +279,7 @@ class pdf_azur extends ModelePDFPropales
// We suppose that a too long description is moved completely on next page
if ($pageposafter > $pageposbefore) {
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
- }
+ }
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
@@ -1057,7 +1057,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetXY($posx,$posy);
$pdf->SetFillColor(230,230,230);
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
- $pdf->SetTextColor(0,0,60);
+ $pdf->SetTextColor(0,0,60);
// Show sender name
$pdf->SetXY($posx+2,$posy+3);
diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
index 756d94726e5..652082cc57a 100755
--- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
+++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
@@ -273,10 +273,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->setPage($pageposbefore);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
-// We suppose that a too long description is moved completely on next page
-if ($pageposafter > $pageposbefore) {
- $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
-}
+// We suppose that a too long description is moved completely on next page
+if ($pageposafter > $pageposbefore) {
+ $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
+}
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php
index 5d31d8317d7..a8281927c2b 100755
--- a/htdocs/fourn/commande/index.php
+++ b/htdocs/fourn/commande/index.php
@@ -348,7 +348,7 @@ if ($resql)
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
- $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
+ print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
print '';
print '';
@@ -416,7 +416,7 @@ print '