a remplace le '/' par un '_' dans le nom de fichier.

Comme dolibarr fonctionne aussi sous windows, j'ai fait de mme pour tous
les caractres interdits par windows dans les noms de fichiers.
This commit is contained in:
opensides 2004-10-24 11:15:21 +00:00
parent f5fc8258e7
commit d63c1acb98
12 changed files with 47 additions and 22 deletions

View File

@ -324,7 +324,9 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance')
$fac = new Facture($db,"",$_POST["facid"]);
if ( $fac->fetch($_POST["facid"]) )
{
$file = FAC_OUTPUTDIR . "/" . $fac->ref . "/" . $fac->ref . ".pdf";
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$fac->ref);
$file = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . ".pdf";
if (is_readable($file))
{
@ -1168,8 +1170,10 @@ else
* Documents générés
*
*/
$file = FAC_OUTPUTDIR . "/" . $fac->ref . "/" . $fac->ref . ".pdf";
$filedetail = FAC_OUTPUTDIR . "/" . $fac->ref . "/" . $fac->ref . "-detail.pdf";
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$fac->ref);
$file = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . ".pdf";
$filedetail = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . "-detail.pdf";
print "<table width=\"100%\" cellspacing=2><tr><td width=\"50%\" valign=\"top\">";

View File

@ -130,8 +130,10 @@ if ($_GET["facid"] > 0)
*
*
*/
$file = FAC_OUTPUTDIR . "/" . $fac->ref . "/" . $fac->ref . ".pdf";
$filedetail = FAC_OUTPUTDIR . "/" . $fac->ref . "/" . $fac->ref . "-detail.pdf";
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$fac->ref);
$file = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . ".pdf";
$filedetail = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . "-detail.pdf";
if (file_exists($file))
{

View File

@ -312,7 +312,10 @@ class FactureRec
* Notify
*
*/
$filepdf = FAC_OUTPUTDIR . "/" . $this->ref . "/" . $this->ref . ".pdf";
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$this->ref);
$filepdf = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . ".pdf";
$mesg = "La facture ".$this->ref." a été validée.\n";

View File

@ -521,7 +521,9 @@ class Facture
* Notify
*
*/
$filepdf = FAC_OUTPUTDIR . "/" . $this->ref . "/" . $this->ref . ".pdf";
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$this->ref);
$filepdf = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . ".pdf";
$mesg = "La facture ".$this->ref." a été validée.\n";
@ -866,7 +868,9 @@ class Facture
{
$soc = new Societe($this->db, $this->socidp);
$file = FAC_OUTPUTDIR . "/" . $this->ref . "/" . $this->ref . ".pdf";
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$this->ref);
$file = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . ".pdf";
if (file_exists($file))
{

View File

@ -51,8 +51,10 @@ class pdf_adytek extends ModelePDFFactures {
if (defined("FAC_OUTPUTDIR"))
{
$dir = FAC_OUTPUTDIR . "/" . $fac->ref . "/" ;
$file = $dir . $fac->ref . ".pdf";
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$fac->ref);
$dir = FAC_OUTPUTDIR . "/" . $facref . "/" ;
$file = $dir . $facref . ".pdf";
if (! file_exists($dir))
{

View File

@ -51,8 +51,10 @@ class pdf_bernique extends ModelePDFFactures {
if (defined("FAC_OUTPUTDIR"))
{
$dir = FAC_OUTPUTDIR . "/" . $fac->ref . "/" ;
$file = $dir . $fac->ref . ".pdf";
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$fac->ref);
$dir = FAC_OUTPUTDIR . "/" . $facref . "/" ;
$file = $dir . $facref . ".pdf";
if (! file_exists($dir))
{

View File

@ -51,8 +51,10 @@ class pdf_bigorneau extends ModelePDFFactures {
if (defined("FAC_OUTPUTDIR"))
{
$dir = FAC_OUTPUTDIR . "/" . $fac->ref . "/" ;
$file = $dir . $fac->ref . ".pdf";
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$fac->ref);
$dir = FAC_OUTPUTDIR . "/" . $facref . "/" ;
$file = $dir . $facref . ".pdf";
if (! file_exists($dir))
{

View File

@ -52,8 +52,10 @@ class pdf_bulot extends ModelePDFFactures {
if (defined("FAC_OUTPUTDIR"))
{
$dir = FAC_OUTPUTDIR . "/" . $fac->ref . "/" ;
$file = $dir . $fac->ref . ".pdf";
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$fac->ref);
$dir = FAC_OUTPUTDIR . "/" . $facref . "/" ;
$file = $dir . $facref . ".pdf";
if (! file_exists($dir))
{

View File

@ -86,8 +86,10 @@ class pdf_crabe extends ModelePDFFactures
if (defined("FAC_OUTPUTDIR"))
{
$dir = FAC_OUTPUTDIR . "/" . $fac->ref . "/" ;
$file = $dir . $fac->ref . ".pdf";
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$fac->ref);
$dir = FAC_OUTPUTDIR . "/" . $facref . "/" ;
$file = $dir . $facref . ".pdf";
if (! file_exists($dir))
{

View File

@ -51,8 +51,10 @@ class pdf_tourteau extends ModelePDFFactures {
if (defined("FAC_OUTPUTDIR"))
{
$dir = FAC_OUTPUTDIR . "/" . $fac->ref . "/" ;
$file = $dir . $fac->ref . ".pdf";
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$fac->ref);
$dir = FAC_OUTPUTDIR . "/" . $facref . "/" ;
$file = $dir . $facref . ".pdf";
if (! file_exists($dir))
{

View File

@ -102,7 +102,7 @@ insert into llx_const (name, value, type, note, visible) values ('ADHERENT_MAIL_
--
-- Mail Mailing
--
insert into llx_const (name, value, type, note) values ('MAILING_EMAIL','mailing@societe.com','chaine','Champ From du mail pour mailing clients/prospects',0);
insert into llx_const (name, value, type, note) values ('MAILING_EMAIL','mailing@societe.com','chaine','Champ From du mail pour mailing clients/prospects');
--
-- Mailman

View File

@ -25,7 +25,7 @@
create table llx_actioncomm
(
id integer AUTO_INCREMENT PRIMARY KEY,
datea timestamp without time zone, -- action date
datea timestamp, -- action date
fk_action integer,
label varchar(50), -- libelle de l'action
fk_soc integer,