From 79c08714975fc69f0cacd55761f2ad90e08a7501 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Jun 2005 22:13:53 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Pb=20creation=20r=E9pertoire.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/facture/pdf_adytek.modules.php | 15 ++-- .../modules/facture/pdf_bernique.modules.php | 15 ++-- .../modules/facture/pdf_bigorneau.modules.php | 15 ++-- .../modules/facture/pdf_bulot.modules.php | 15 ++-- .../modules/facture/pdf_crabe.modules.php | 85 +++++++++---------- .../modules/facture/pdf_oursin.modules.php | 15 ++-- .../modules/facture/pdf_tourteau.modules.php | 15 ++-- htdocs/product/stats/fiche.php | 2 +- 8 files changed, 85 insertions(+), 92 deletions(-) diff --git a/htdocs/includes/modules/facture/pdf_adytek.modules.php b/htdocs/includes/modules/facture/pdf_adytek.modules.php index e6db1028584..0840894e39a 100644 --- a/htdocs/includes/modules/facture/pdf_adytek.modules.php +++ b/htdocs/includes/modules/facture/pdf_adytek.modules.php @@ -66,14 +66,13 @@ class pdf_adytek extends ModelePDFFactures { $file = $dir . "/" . $facref . ".pdf"; if (! file_exists($dir)) - { - umask(0); - if (! mkdir($dir, 0755)) - { - $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); - return 0; - } - } + { + if (create_exdir($dir) < 0) + { + $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); + return 0; + } + } if (file_exists($dir)) { diff --git a/htdocs/includes/modules/facture/pdf_bernique.modules.php b/htdocs/includes/modules/facture/pdf_bernique.modules.php index 1ed76480efb..55cfefbdcbf 100644 --- a/htdocs/includes/modules/facture/pdf_bernique.modules.php +++ b/htdocs/includes/modules/facture/pdf_bernique.modules.php @@ -63,14 +63,13 @@ class pdf_bernique extends ModelePDFFactures { $file = $dir . $facref . ".pdf"; if (! file_exists($dir)) - { - umask(0); - if (! mkdir($dir, 0755)) - { - $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); - return 0; - } - } + { + if (create_exdir($dir) < 0) + { + $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); + return 0; + } + } if (file_exists($dir)) { diff --git a/htdocs/includes/modules/facture/pdf_bigorneau.modules.php b/htdocs/includes/modules/facture/pdf_bigorneau.modules.php index dfd054f7603..bca1aa700fa 100644 --- a/htdocs/includes/modules/facture/pdf_bigorneau.modules.php +++ b/htdocs/includes/modules/facture/pdf_bigorneau.modules.php @@ -61,14 +61,13 @@ class pdf_bigorneau extends ModelePDFFactures { $file = $dir . $facref . ".pdf"; if (! file_exists($dir)) - { - umask(0); - if (! mkdir($dir, 0755)) - { - $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); - return 0; - } - } + { + if (create_exdir($dir) < 0) + { + $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); + return 0; + } + } if (file_exists($dir)) { diff --git a/htdocs/includes/modules/facture/pdf_bulot.modules.php b/htdocs/includes/modules/facture/pdf_bulot.modules.php index 99aa2686305..3f6109b50fb 100644 --- a/htdocs/includes/modules/facture/pdf_bulot.modules.php +++ b/htdocs/includes/modules/facture/pdf_bulot.modules.php @@ -65,14 +65,13 @@ class pdf_bulot extends ModelePDFFactures { $file = $dir . "/" . $facref . ".pdf"; if (! file_exists($dir)) - { - umask(0); - if (! mkdir($dir, 0755)) - { - $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); - return 0; - } - } + { + if (create_exdir($dir) < 0) + { + $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); + return 0; + } + } if (file_exists($dir)) { diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index 3ffaaf95f49..b7d524183e8 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -112,8 +112,7 @@ class pdf_crabe extends ModelePDFFactures if (! file_exists($dir)) { - umask(0); - if (! mkdir($dir, 0755)) + if (create_exdir($dir) < 0) { $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); return 0; @@ -263,42 +262,42 @@ class pdf_crabe extends ModelePDFFactures $this->marges['g']=10; - $cury=242; - $pdf->SetXY ($this->marges['g'], $cury); - $pdf->SetFont('Arial','B',8); - $pdf->MultiCell(90, 3, "Règlement par virement sur le compte bancaire suivant:", 0, 'L', 0); - $cury+=4; - $pdf->SetFont('Arial','B',6); - $pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 ); - $pdf->SetXY ($this->marges['g'], $cury); - $pdf->MultiCell(18, 3, "Code banque", 0, 'C', 0); - $pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 ); - $pdf->SetXY ($this->marges['g']+18, $cury); - $pdf->MultiCell(18, 3, "Code guichet", 0, 'C', 0); - $pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 ); - $pdf->SetXY ($this->marges['g']+36, $cury); - $pdf->MultiCell(24, 3, "Numéro compte", 0, 'C', 0); - $pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 ); - $pdf->SetXY ($this->marges['g']+60, $cury); - $pdf->MultiCell(13, 3, "Clé RIB", 0, 'C', 0); - $pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 ); - - $pdf->SetFont('Arial','',8); - $pdf->SetXY ($this->marges['g'], $cury+5); - $pdf->MultiCell(18, 3, $account->code_banque, 0, 'C', 0); - $pdf->SetXY ($this->marges['g']+18, $cury+5); - $pdf->MultiCell(18, 3, $account->code_guichet, 0, 'C', 0); - $pdf->SetXY ($this->marges['g']+36, $cury+5); - $pdf->MultiCell(24, 3, $account->number, 0, 'C', 0); - $pdf->SetXY ($this->marges['g']+60, $cury+5); - $pdf->MultiCell(13, 3, $account->cle_rib, 0, 'C', 0); - - $pdf->SetXY ($this->marges['g'], $cury+12); - $pdf->MultiCell(90, 3, "Domiciliation : " . $account->domiciliation, 0, 'L', 0); - $pdf->SetXY ($this->marges['g'], $cury+22); - $pdf->MultiCell(90, 3, "Prefix IBAN : " . $account->iban_prefix, 0, 'L', 0); - $pdf->SetXY ($this->marges['g'], $cury+25); - $pdf->MultiCell(90, 3, "BIC : " . $account->bic, 0, 'L', 0); + $cury=242; + $pdf->SetXY ($this->marges['g'], $cury); + $pdf->SetFont('Arial','B',8); + $pdf->MultiCell(90, 3, "Règlement par virement sur le compte bancaire suivant:", 0, 'L', 0); + $cury+=4; + $pdf->SetFont('Arial','B',6); + $pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 ); + $pdf->SetXY ($this->marges['g'], $cury); + $pdf->MultiCell(18, 3, "Code banque", 0, 'C', 0); + $pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 ); + $pdf->SetXY ($this->marges['g']+18, $cury); + $pdf->MultiCell(18, 3, "Code guichet", 0, 'C', 0); + $pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 ); + $pdf->SetXY ($this->marges['g']+36, $cury); + $pdf->MultiCell(24, 3, "Numéro compte", 0, 'C', 0); + $pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 ); + $pdf->SetXY ($this->marges['g']+60, $cury); + $pdf->MultiCell(13, 3, "Clé RIB", 0, 'C', 0); + $pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 ); + + $pdf->SetFont('Arial','',8); + $pdf->SetXY ($this->marges['g'], $cury+5); + $pdf->MultiCell(18, 3, $account->code_banque, 0, 'C', 0); + $pdf->SetXY ($this->marges['g']+18, $cury+5); + $pdf->MultiCell(18, 3, $account->code_guichet, 0, 'C', 0); + $pdf->SetXY ($this->marges['g']+36, $cury+5); + $pdf->MultiCell(24, 3, $account->number, 0, 'C', 0); + $pdf->SetXY ($this->marges['g']+60, $cury+5); + $pdf->MultiCell(13, 3, $account->cle_rib, 0, 'C', 0); + + $pdf->SetXY ($this->marges['g'], $cury+12); + $pdf->MultiCell(90, 3, "Domiciliation : " . $account->domiciliation, 0, 'L', 0); + $pdf->SetXY ($this->marges['g'], $cury+22); + $pdf->MultiCell(90, 3, "Prefix IBAN : " . $account->iban_prefix, 0, 'L', 0); + $pdf->SetXY ($this->marges['g'], $cury+25); + $pdf->MultiCell(90, 3, "BIC : " . $account->bic, 0, 'L', 0); } } @@ -494,12 +493,12 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * ($index+1)); $pdf->SetTextColor(0,0,60); - $pdf->SetFont('Arial','B', 9); + $pdf->SetFont('Arial','B', 9); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalTTC"), 0, 'L', 1); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * ($index+1)); $pdf->MultiCell(26, $tab2_hl, price($fac->total_ttc), 0, 'R', 1); - $pdf->SetFont('Arial','', 9); + $pdf->SetFont('Arial','', 9); $pdf->SetTextColor(0,0,0); if ($deja_regle > 0) @@ -511,13 +510,13 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell(26, $tab2_hl, price($deja_regle), 0, 'R', 0); $pdf->SetTextColor(0,0,60); - $pdf->SetFont('Arial','B', 9); + $pdf->SetFont('Arial','B', 9); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * ($index+3)); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("RemainderToPay"), 0, 'L', 1); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * ($index+3)); $pdf->MultiCell(26, $tab2_hl, price($fac->total_ttc - $deja_regle), 0, 'R', 1); - $pdf->SetFont('Arial','', 9); + $pdf->SetFont('Arial','', 9); $pdf->SetTextColor(0,0,0); } } @@ -579,7 +578,7 @@ class pdf_crabe extends ModelePDFFactures if (defined("FAC_PDF_LOGO") && FAC_PDF_LOGO) { if (file_exists(FAC_PDF_LOGO)) { - $pdf->Image(FAC_PDF_LOGO, 10, 5, 0, 24, 'PNG'); + $pdf->Image(FAC_PDF_LOGO, 10, 5, 0, 24); } else { $pdf->SetTextColor(200,0,0); diff --git a/htdocs/includes/modules/facture/pdf_oursin.modules.php b/htdocs/includes/modules/facture/pdf_oursin.modules.php index 4153987732d..9a80fe76934 100644 --- a/htdocs/includes/modules/facture/pdf_oursin.modules.php +++ b/htdocs/includes/modules/facture/pdf_oursin.modules.php @@ -112,14 +112,13 @@ class pdf_oursin extends ModelePDFFactures $file = $dir . "/" . $facref . ".pdf"; if (! file_exists($dir)) - { - umask(0); - if (! mkdir($dir, 0755)) - { - $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); - return 0; - } - } + { + if (create_exdir($dir) < 0) + { + $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); + return 0; + } + } if (file_exists($dir)) { diff --git a/htdocs/includes/modules/facture/pdf_tourteau.modules.php b/htdocs/includes/modules/facture/pdf_tourteau.modules.php index 13abc26f238..63e076e56b1 100644 --- a/htdocs/includes/modules/facture/pdf_tourteau.modules.php +++ b/htdocs/includes/modules/facture/pdf_tourteau.modules.php @@ -61,14 +61,13 @@ class pdf_tourteau extends ModelePDFFactures { $file = $dir . $facref . ".pdf"; if (! file_exists($dir)) - { - umask(0); - if (! mkdir($dir, 0755)) - { - $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); - return 0; - } - } + { + if (create_exdir($dir) < 0) + { + $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); + return 0; + } + } if (file_exists($dir)) { diff --git a/htdocs/product/stats/fiche.php b/htdocs/product/stats/fiche.php index d503024affd..61a487b8c61 100644 --- a/htdocs/product/stats/fiche.php +++ b/htdocs/product/stats/fiche.php @@ -75,7 +75,7 @@ if ($_GET["id"]) if (! file_exists($dir)) { - if (! create_exdir($dir)) + if (create_exdir($dir) < 0) { $mesg = $langs->trans("ErrorCanNotCreateDir",$dir); }