From 94461389519165b93d4f3ceda2674517f775194f Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 3 Mar 2020 11:49:17 +0100 Subject: [PATCH] FIX ecm_files didnt match cause document ref contained "/" --- htdocs/bom/class/bom.class.php | 2 +- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/commande/class/commande.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/contrat/class/contrat.class.php | 2 +- htdocs/expedition/class/expedition.class.php | 2 +- htdocs/expensereport/class/expensereport.class.php | 2 +- htdocs/fichinter/class/fichinter.class.php | 2 +- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/holiday/class/holiday.class.php | 2 +- htdocs/livraison/class/livraison.class.php | 2 +- htdocs/reception/class/reception.class.php | 2 +- htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 7ad86b59ae8..8847b6e0ef3 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -549,7 +549,7 @@ class BOM extends CommonObject { $num = $this->ref; } - $this->newref = $num; + $this->newref = dol_sanitizeFileName($num); // Validate $sql = "UPDATE ".MAIN_DB_PREFIX."bom_bom"; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a2d1e934d35..46d4f440441 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1777,7 +1777,7 @@ class Propal extends CommonObject { $num = $this->ref; } - $this->newref = $num; + $this->newref = dol_sanitizeFileName($num); $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; $sql.= " SET ref = '".$num."',"; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 7d8e2680977..e4d24e88556 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -361,7 +361,7 @@ class Commande extends CommonOrder { $num = $this->ref; } - $this->newref = $num; + $this->newref = dol_sanitizeFileName($num); // Validate $sql = "UPDATE ".MAIN_DB_PREFIX."commande"; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 05661fb01cc..c324e59d5f0 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2350,7 +2350,7 @@ class Facture extends CommonInvoice { $num = $this->ref; } - $this->newref = $num; + $this->newref = dol_sanitizeFileName($num); if ($num) { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index e81febde6df..eb3d27c3753 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -453,7 +453,7 @@ class Contrat extends CommonObject { $num = $this->ref; } - $this->newref = $num; + $this->newref = dol_sanitizeFileName($num); if ($num) { diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 905819dabc5..b1731f1542d 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -693,7 +693,7 @@ class Expedition extends CommonObject { $numref = "EXP".$this->id; } - $this->newref = $numref; + $this->newref = dol_sanitizeFileName($numref); $now=dol_now(); diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 03247161ff4..695cbda95be 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1117,7 +1117,7 @@ class ExpenseReport extends CommonObject } if (empty($num) || $num < 0) return -1; - $this->newref = $num; + $this->newref = dol_sanitizeFileName($num); $this->db->begin(); diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 4ce2aa954b2..31a013493b5 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -540,7 +540,7 @@ class Fichinter extends CommonObject { $num = $this->ref; } - $this->newref = $num; + $this->newref = dol_sanitizeFileName($num); $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter"; $sql.= " SET fk_statut = 1"; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 29d56a3aabf..faf16956edd 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -519,7 +519,7 @@ class CommandeFournisseur extends CommonOrder { $num = $this->ref; } - $this->newref = $num; + $this->newref = dol_sanitizeFileName($num); $sql = 'UPDATE '.MAIN_DB_PREFIX."commande_fournisseur"; $sql.= " SET ref='".$this->db->escape($num)."',"; @@ -912,7 +912,7 @@ class CommandeFournisseur extends CommonOrder { $num = $this->ref; } - $this->newref = $num; + $this->newref = dol_sanitizeFileName($num); // Do we have to change status now ? (If double approval is required and first approval, we keep status to 1 = validated) $movetoapprovestatus=true; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index b62190686b3..79fada4bb2e 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1369,7 +1369,7 @@ class FactureFournisseur extends CommonInvoice { $num = $this->ref; } - $this->newref = $num; + $this->newref = dol_sanitizeFileName($num); $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn"; $sql.= " SET ref='".$num."', fk_statut = 1, fk_user_valid = ".$user->id.", date_valid = '".$this->db->idate($now)."'"; diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 25f1d9675bb..2429c55b9b7 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -688,7 +688,7 @@ class Holiday extends CommonObject { $num = $this->ref; } - $this->newref = $num; + $this->newref = dol_sanitizeFileName($num); // Update status $sql = "UPDATE ".MAIN_DB_PREFIX."holiday SET"; diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index a8eee72df33..797ed105b1d 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -391,7 +391,7 @@ class Livraison extends CommonObject { $numref = $this->ref; } - $this->newref = $numref; + $this->newref = dol_sanitizeFileName($numref); // Test if is not already in valid status. If so, we stop to avoid decrementing the stock twice. $sql = "SELECT ref"; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 3e2776675a1..c1bfa0c79e5 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -529,7 +529,7 @@ class Reception extends CommonObject $numref = $this->ref; } - $this->newref = $numref; + $this->newref = dol_sanitizeFileName($numref); $now=dol_now(); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index e528b5ae5e7..eeef3ef1197 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1453,7 +1453,7 @@ class SupplierProposal extends CommonObject { $num = $this->ref; } - $this->newref = $num; + $this->newref = dol_sanitizeFileName($num); $sql = "UPDATE ".MAIN_DB_PREFIX."supplier_proposal"; $sql.= " SET ref = '".$this->db->escape($num)."',";