In some cases of improper use of the delete () function, the complete repertoire of propale objects, invoice or order was deleted.
Ex in agefodd module:
$obj_link=new Propal($db);
$obj_link->id=$agf->propalid;
$resultdel=$obj_link->delete($user);
To prevent misuse of the function, the reference is not considered given
This commit is contained in:
parent
c49aabe574
commit
895f5452b4
@ -2056,7 +2056,7 @@ class Propal extends CommonObject
|
|||||||
{
|
{
|
||||||
// We remove directory
|
// We remove directory
|
||||||
$ref = dol_sanitizeFileName($this->ref);
|
$ref = dol_sanitizeFileName($this->ref);
|
||||||
if ($conf->propal->dir_output)
|
if ($conf->propal->dir_output && !empty($this->ref))
|
||||||
{
|
{
|
||||||
$dir = $conf->propal->dir_output . "/" . $ref ;
|
$dir = $conf->propal->dir_output . "/" . $ref ;
|
||||||
$file = $dir . "/" . $ref . ".pdf";
|
$file = $dir . "/" . $ref . ".pdf";
|
||||||
|
|||||||
@ -2457,7 +2457,7 @@ class Commande extends CommonOrder
|
|||||||
|
|
||||||
// On efface le repertoire de pdf provisoire
|
// On efface le repertoire de pdf provisoire
|
||||||
$comref = dol_sanitizeFileName($this->ref);
|
$comref = dol_sanitizeFileName($this->ref);
|
||||||
if ($conf->commande->dir_output)
|
if ($conf->commande->dir_output && !empty($this->ref))
|
||||||
{
|
{
|
||||||
$dir = $conf->commande->dir_output . "/" . $comref ;
|
$dir = $conf->commande->dir_output . "/" . $comref ;
|
||||||
$file = $conf->commande->dir_output . "/" . $comref . "/" . $comref . ".pdf";
|
$file = $conf->commande->dir_output . "/" . $comref . "/" . $comref . ".pdf";
|
||||||
|
|||||||
@ -1323,7 +1323,7 @@ class Facture extends CommonInvoice
|
|||||||
{
|
{
|
||||||
// On efface le repertoire de pdf provisoire
|
// On efface le repertoire de pdf provisoire
|
||||||
$ref = dol_sanitizeFileName($this->ref);
|
$ref = dol_sanitizeFileName($this->ref);
|
||||||
if ($conf->facture->dir_output)
|
if ($conf->facture->dir_output && !empty($this->ref))
|
||||||
{
|
{
|
||||||
$dir = $conf->facture->dir_output . "/" . $ref;
|
$dir = $conf->facture->dir_output . "/" . $ref;
|
||||||
$file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf";
|
$file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user