Skip to content

Commit

Permalink
Fix: Generated doc in wrong dir
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 7, 2011
1 parent f07557f commit 5741b19
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions htdocs/fourn/facture/document.php
Expand Up @@ -70,7 +70,7 @@
if ($facture->fetch($facid))
{
$ref=dol_sanitizeFileName($facture->ref);
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.$ref;
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($facture->id,2).$ref;

if (create_exdir($upload_dir) >= 0)
{
Expand Down Expand Up @@ -108,7 +108,7 @@
if ($facture->fetch($facid))
{
$ref=dol_sanitizeFileName($facture->ref);
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.$ref;
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($facture->id,2).$ref;

$file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
dol_delete_file($file);
Expand All @@ -133,7 +133,7 @@
$facture->fetch_thirdparty();

$ref=dol_sanitizeFileName($facture->ref);
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.$ref;
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($facture->id,2).$ref;

$head = facturefourn_prepare_head($facture);
dol_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'), 0, 'bill');
Expand Down
4 changes: 2 additions & 2 deletions htdocs/fourn/facture/fiche.php
Expand Up @@ -1795,8 +1795,8 @@
*/

$ref=dol_sanitizeFileName($fac->ref);
$subdir = $ref;
$filedir = $conf->fournisseur->facture->dir_output.'/'.$ref;
$subdir = get_exdir($fac->id,2).$ref;
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($fac->id,2).$ref;
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$fac->id;
$genallowed=$user->rights->fournisseur->facture->creer;
$delallowed=$user->rights->fournisseur->facture->supprimer;
Expand Down
Expand Up @@ -133,7 +133,7 @@ function write_file($object,$outputlangs='')
else
{
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->fournisseur->facture->dir_output.'/'.$objectref;
$dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$objectref;
$file = $dir . "/" . $objectref . ".pdf";
}

Expand Down

0 comments on commit 5741b19

Please sign in to comment.