Fix: Uniformisation du code. Sur le noms de fichiers PDF gnrs, on garde les parenthses partout. Ceci afin d'eviter conflit entre un nom temporaire et un nom du module de numrotation.
This commit is contained in:
parent
c42825f0f3
commit
b5bdf7ce8c
@ -174,8 +174,6 @@ class Commande
|
||||
{
|
||||
// On efface le répertoire de pdf provisoire
|
||||
$comref = sanitize_string($this->ref);
|
||||
$comref = str_replace("(","",$comref);
|
||||
$comref = str_replace(")","",$comref);
|
||||
if ($conf->commande->dir_output)
|
||||
{
|
||||
$dir = $conf->commande->dir_output . "/" . $comref ;
|
||||
|
||||
@ -1439,8 +1439,6 @@ else
|
||||
*
|
||||
*/
|
||||
$comref = sanitize_string($commande->ref);
|
||||
$comref = str_replace("(","",$comref);
|
||||
$comref = str_replace(")","",$comref);
|
||||
$file = $conf->commande->dir_output . '/' . $comref . '/' . $comref . '.pdf';
|
||||
$relativepath = $comref.'/'.$comref.'.pdf';
|
||||
$filedir = $conf->commande->dir_output . '/' . $comref;
|
||||
|
||||
@ -353,8 +353,6 @@ class Expedition
|
||||
|
||||
// On efface le répertoire de pdf provisoire
|
||||
$expeditionref = sanitize_string($provref);
|
||||
$expeditionref = str_replace("(","",$expeditionref);
|
||||
$expeditionref = str_replace(")","",$expeditionref);
|
||||
if ($conf->expedition->dir_output)
|
||||
{
|
||||
$dir = $conf->expedition->dir_output . "/" . $expeditionref;
|
||||
|
||||
@ -532,8 +532,6 @@ else
|
||||
*/
|
||||
|
||||
$expeditionref = sanitize_string($expedition->ref);
|
||||
$expeditionref = str_replace("(","",$expeditionref);
|
||||
$expeditionref = str_replace(")","",$expeditionref);
|
||||
$filedir = $conf->expedition->dir_output . "/" .$expeditionref;
|
||||
|
||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$expedition->id;
|
||||
|
||||
@ -124,8 +124,6 @@ function expedition_pdf_create($db, $id, $modele='', $outputlangs='')
|
||||
$result=$expedition->fetch($id);
|
||||
|
||||
$expeditionref = sanitize_string($expedition->ref);
|
||||
$expeditionref = str_replace("(","",$expeditionref);
|
||||
$expeditionref = str_replace(")","",$expeditionref);
|
||||
$dir = $conf->expedition->dir_output . "/" . $expeditionref;
|
||||
$file = $dir . "/" . $expeditionref . ".pdf";
|
||||
if ($obj->generate($expedition, $file))
|
||||
|
||||
@ -83,8 +83,6 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
if ($conf->expedition->dir_output)
|
||||
{
|
||||
$expeditionref = sanitize_string($this->expe->ref);
|
||||
$expeditionref = str_replace("(","",$expeditionref);
|
||||
$expeditionref = str_replace(")","",$expeditionref);
|
||||
$dir = $conf->expedition->dir_output . "/" . $expeditionref;
|
||||
$file = $dir . "/" . $expeditionref . ".pdf";
|
||||
//Si le dossier n existe pas
|
||||
|
||||
@ -583,8 +583,6 @@ if ($_GET["id"] > 0)
|
||||
*
|
||||
*/
|
||||
$comfournref = sanitize_string($commande->ref);
|
||||
$comfournref = str_replace("(","",$comfournref);
|
||||
$comfournref = str_replace(")","",$comfournref);
|
||||
$file = $conf->fournisseur->commande->dir_output . '/' . $comfournref . '/' . $comfournref . '.pdf';
|
||||
$relativepath = $comfournref.'/'.$comfournref.'.pdf';
|
||||
$filedir = $conf->fournisseur->commande->dir_output . '/' . $comfournref;
|
||||
|
||||
@ -144,8 +144,6 @@ class pdf_muscadet extends ModelePDFCommandesSuppliers
|
||||
$nblignes = sizeof($com->lignes);
|
||||
|
||||
$comref = sanitize_string($com->ref);
|
||||
$comref = str_replace("(","",$comref);
|
||||
$comref = str_replace(")","",$comref);
|
||||
$dir = $conf->fournisseur->commande->dir_output . "/" . $comref;
|
||||
$file = $dir . "/" . $comref . ".pdf";
|
||||
|
||||
|
||||
@ -80,8 +80,6 @@ class pdf_edison extends ModelePDFCommandes
|
||||
if ($com->fetch($id))
|
||||
{
|
||||
$comref = sanitize_string($com->ref);
|
||||
$comref = str_replace("(","",$comref);
|
||||
$comref = str_replace(")","",$comref);
|
||||
if ($conf->commande->dir_output)
|
||||
{
|
||||
|
||||
|
||||
@ -142,8 +142,6 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$nblignes = sizeof($com->lignes);
|
||||
|
||||
$comref = sanitize_string($com->ref);
|
||||
$comref = str_replace("(","",$comref);
|
||||
$comref = str_replace(")","",$comref);
|
||||
$dir = $conf->commande->dir_output . "/" . $comref;
|
||||
$file = $dir . "/" . $comref . ".pdf";
|
||||
|
||||
|
||||
@ -178,6 +178,7 @@ if (! isset($_GET["action"]) || $_GET["action"] == "upgrade")
|
||||
'DB_ERROR_RECORD_ALREADY_EXISTS',
|
||||
'DB_ERROR_NOSUCHTABLE',
|
||||
'DB_ERROR_NOSUCHFIELD',
|
||||
'DB_ERROR_NO_FOREIGN_KEY_TO_DROP',
|
||||
'DB_ERROR_CANNOT_CREATE' // Qd contrainte deja existante
|
||||
);
|
||||
if (in_array($errno,$okerror))
|
||||
|
||||
@ -143,8 +143,10 @@ function unaccent($str)
|
||||
*/
|
||||
function sanitize_string($str)
|
||||
{
|
||||
$forbidden_chars=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
return str_replace($forbidden_chars,"_",$str);
|
||||
$forbidden_chars_to_underscore=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
|
||||
//$forbidden_chars_to_remove=array("(",")");
|
||||
$forbidden_chars_to_remove=array();
|
||||
return str_replace($forbidden_chars_to_underscore,"_",str_replace($forbidden_chars_to_remove,"",$str));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -550,8 +550,6 @@ else
|
||||
*/
|
||||
|
||||
$livraisonref = sanitize_string($livraison->ref);
|
||||
$livraisonref = str_replace("(","",$livraisonref);
|
||||
$livraisonref = str_replace(")","",$livraisonref);
|
||||
$filedir = $conf->livraison->dir_output . '/' . $livraisonref;
|
||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$livraison->id;
|
||||
|
||||
|
||||
@ -345,8 +345,6 @@ class Livraison
|
||||
|
||||
// On efface le répertoire de pdf provisoire
|
||||
$livraisonref = sanitize_string($this->ref);
|
||||
$livraisonref = str_replace("(","",$livraisonref);
|
||||
$livraisonref = str_replace(")","",$livraisonref);
|
||||
if ($conf->expedition->dir_output)
|
||||
{
|
||||
$dir = $conf->livraison->dir_output . "/" . $livraisonref ;
|
||||
|
||||
@ -81,8 +81,6 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
if ($delivery->fetch($id))
|
||||
{
|
||||
$deliveryref = sanitize_string($delivery->ref);
|
||||
$deliveryref = str_replace("(","",$deliveryref);
|
||||
$deliveryref = str_replace(")","",$deliveryref);
|
||||
if ($conf->livraison->dir_output)
|
||||
{
|
||||
|
||||
|
||||
@ -145,8 +145,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$nblignes = sizeof($lignesdelivery);
|
||||
|
||||
$deliveryref = sanitize_string($delivery->ref);
|
||||
$deliveryref = str_replace("(","",$deliveryref);
|
||||
$deliveryref = str_replace(")","",$deliveryref);
|
||||
$dir = $conf->livraison->dir_output . "/" . $deliveryref;
|
||||
$file = $dir . "/" . $deliveryref . ".pdf";
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user