From 5b727e25ebf414b1498a5cfbb45108faa86764da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Jun 2005 22:38:58 +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 --- .../propale/pdf_propale_adytek.modules.php | 10 +-- .../propale/pdf_propale_azur.modules.php | 83 +++++++++---------- .../propale/pdf_propale_bleu.modules.php | 10 +-- .../propale/pdf_propale_jaune.modules.php | 11 ++- .../propale/pdf_propale_rouge.modules.php | 6 +- .../propale/pdf_propale_vert.modules.php | 11 ++- 6 files changed, 64 insertions(+), 67 deletions(-) diff --git a/htdocs/includes/modules/propale/pdf_propale_adytek.modules.php b/htdocs/includes/modules/propale/pdf_propale_adytek.modules.php index b0c5de7fe24..b036a45b1d7 100644 --- a/htdocs/includes/modules/propale/pdf_propale_adytek.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_adytek.modules.php @@ -75,15 +75,15 @@ class pdf_propale_adytek extends ModelePDFPropales $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","="); $propref = str_replace($forbidden_chars,"_",$propale->ref); $dir = $conf->propal->dir_output . "/" . $propref ; - if (! file_exists($dir)) - { - umask(0); - if (! mkdir($dir, 0755)) + + if (! file_exists($dir)) + { + if (create_exdir($dir) < 0) { $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); return 0; } - } + } } else { diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index 1556a8b5b4f..33fdd50b8be 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -122,8 +122,7 @@ class pdf_propale_azur extends ModelePDFPropales if (! file_exists($dir)) { - umask(0); - if (! mkdir($dir, 0755)) + if (create_exdir($dir) < 0) { $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); return 0; @@ -270,42 +269,42 @@ class pdf_propale_azur extends ModelePDFPropales $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); } } @@ -413,12 +412,12 @@ class pdf_propale_azur extends ModelePDFPropales $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($prop->total_ttc), 0, 'R', 1); - $pdf->SetFont('Arial','', 9); + $pdf->SetFont('Arial','', 9); $pdf->SetTextColor(0,0,0); if ($deja_regle > 0) @@ -430,13 +429,13 @@ class pdf_propale_azur extends ModelePDFPropales $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($prop->total_ttc - $deja_regle), 0, 'R', 1); - $pdf->SetFont('Arial','', 9); + $pdf->SetFont('Arial','', 9); $pdf->SetTextColor(0,0,0); } } diff --git a/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php b/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php index a2c0e806371..e2712c929df 100644 --- a/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php @@ -75,15 +75,15 @@ class pdf_propale_bleu extends ModelePDFPropales $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","="); $propref = str_replace($forbidden_chars,"_",$propale->ref); $dir = $conf->propal->dir_output . "/" . $propref ; - if (! file_exists($dir)) - { - umask(0); - if (! mkdir($dir, 0755)) + + if (! file_exists($dir)) + { + if (create_exdir($dir) < 0) { $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); return 0; } - } + } } else { diff --git a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php index d50d593a18c..dbf6408837a 100644 --- a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php @@ -75,15 +75,14 @@ class pdf_propale_jaune extends ModelePDFPropales $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","="); $propref = str_replace($forbidden_chars,"_",$propale->ref); $dir = $conf->propal->dir_output . "/" . $propref ; - if (! file_exists($dir)) - { - umask(0); - if (! mkdir($dir, 0755)) - { + if (! file_exists($dir)) + { + if (create_exdir($dir) < 0) + { $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); return 0; } - } + } } else { diff --git a/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php b/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php index 1c47af66dcd..2f93d0921e8 100644 --- a/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php @@ -77,10 +77,10 @@ class pdf_propale_rouge extends ModelePDFPropales $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","="); $propref = str_replace($forbidden_chars,"_",$propale->ref); $dir = $conf->propal->dir_output . "/" . $propref ; - if (! file_exists($dir)) + + if (! file_exists($dir)) { - umask(0); - if (! mkdir($dir, 0755)) + if (create_exdir($dir) < 0) { $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); return 0; diff --git a/htdocs/includes/modules/propale/pdf_propale_vert.modules.php b/htdocs/includes/modules/propale/pdf_propale_vert.modules.php index 27849f1729a..e48f682ea1e 100644 --- a/htdocs/includes/modules/propale/pdf_propale_vert.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_vert.modules.php @@ -75,15 +75,14 @@ class pdf_propale_vert extends ModelePDFPropales $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","="); $propref = str_replace($forbidden_chars,"_",$propale->ref); $dir = $conf->propal->dir_output . "/" . $propref ; - if (! file_exists($dir)) - { - umask(0); - if (! mkdir($dir, 0755)) - { + if (! file_exists($dir)) + { + if (create_exdir($dir) < 0) + { $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); return 0; } - } + } } else {