Fix: Generated doc in wrong dir
This commit is contained in:
parent
5b4434d6a6
commit
961366d2b2
@ -128,7 +128,7 @@ class FormFile
|
|||||||
/**
|
/**
|
||||||
* Show the box with list of available documents for object
|
* Show the box with list of available documents for object
|
||||||
* @param modulepart propal, facture, facture_fourn, ...
|
* @param modulepart propal, facture, facture_fourn, ...
|
||||||
* @param filename Sub dir to scan (Example: '9/9', 'FA9999'). Use '' if filedir already complete)
|
* @param filename Sub dir to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if filedir already complete)
|
||||||
* @param filedir Dir to scan
|
* @param filedir Dir to scan
|
||||||
* @param urlsource Url of origin page (for return)
|
* @param urlsource Url of origin page (for return)
|
||||||
* @param genallowed Generation is allowed (1/0 or array of formats)
|
* @param genallowed Generation is allowed (1/0 or array of formats)
|
||||||
@ -161,7 +161,7 @@ class FormFile
|
|||||||
$forcenomultilang=0;
|
$forcenomultilang=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$filename = dol_sanitizeFileName($filename);
|
//$filename = dol_sanitizeFileName($filename); //Must be sanitized before calling show_documents
|
||||||
$headershown=0;
|
$headershown=0;
|
||||||
$showempty=0;
|
$showempty=0;
|
||||||
$i=0;
|
$i=0;
|
||||||
@ -405,8 +405,8 @@ class FormFile
|
|||||||
$relativepath=$file["name"]; // Cas general
|
$relativepath=$file["name"]; // Cas general
|
||||||
if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture...
|
if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture...
|
||||||
// Autre cas
|
// Autre cas
|
||||||
if ($modulepart == 'donation') { $relativepath = get_exdir($filename,2).$file["name"]; }
|
if ($modulepart == 'donation') { $relativepath = get_exdir($filename,2).$file["name"]; }
|
||||||
if ($modulepart == 'export') { $relativepath = $file["name"]; }
|
if ($modulepart == 'export') { $relativepath = $file["name"]; }
|
||||||
|
|
||||||
if (!$iconPDF) print "<tr ".$bc[$var].">";
|
if (!$iconPDF) print "<tr ".$bc[$var].">";
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.fr>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.fr>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
@ -1827,16 +1827,15 @@ else
|
|||||||
* Documents generes
|
* Documents generes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$facfournref=dol_sanitizeFileName($fac->ref);
|
$ref=dol_sanitizeFileName($fac->ref);
|
||||||
$file=$conf->fournisseur->dir_output.'/facture/'. $facfournref . '/' . $facfournref . '.pdf';
|
$subdir = get_exdir($fac->id,2).$ref;
|
||||||
$relativepath = $facfournref.'/'.$facfournref.'.pdf';
|
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($fac->id,2).$ref;
|
||||||
$filedir = $conf->fournisseur->dir_output . '/facture/' . $facfournref;
|
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$fac->id;
|
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$fac->id;
|
||||||
$genallowed=$user->rights->fournisseur->facture->creer;
|
$genallowed=$user->rights->fournisseur->facture->creer;
|
||||||
$delallowed=$user->rights->fournisseur->facture->supprimer;
|
$delallowed=$user->rights->fournisseur->facture->supprimer;
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$somethingshown=$formfile->show_documents('facture_fournisseur',$facfournref,$filedir,$urlsource,$genallowed,$delallowed,$fac->modelpdf);
|
$somethingshown=$formfile->show_documents('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$fac->modelpdf);
|
||||||
|
|
||||||
$object=$fac;
|
$object=$fac;
|
||||||
|
|
||||||
@ -1873,7 +1872,7 @@ else
|
|||||||
if ($_GET['action'] == 'presend')
|
if ($_GET['action'] == 'presend')
|
||||||
{
|
{
|
||||||
$ref = dol_sanitizeFileName($fac->ref);
|
$ref = dol_sanitizeFileName($fac->ref);
|
||||||
$file = $conf->fournisseur->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
$file = $conf->fournisseur->facture->dir_output.'/'.get_exdir($fac->id,2).$ref.'.pdf';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print_titre($langs->trans('SendBillByMail'));
|
print_titre($langs->trans('SendBillByMail'));
|
||||||
|
|||||||
@ -133,7 +133,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$objectref = dol_sanitizeFileName($object->ref);
|
$objectref = dol_sanitizeFileName($object->ref);
|
||||||
$dir = $conf->fournisseur->dir_output . "/facture/" . $objectref;
|
$dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$objectref;
|
||||||
$file = $dir . "/" . $objectref . ".pdf";
|
$file = $dir . "/" . $objectref . ".pdf";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user