Fix: [ bug #622 ] attaching wrong file when sending the invoice via
This commit is contained in:
parent
567cd00f5c
commit
091e469050
@ -1817,7 +1817,7 @@ if ($action == 'presend')
|
|||||||
{
|
{
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref);
|
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
|
|
||||||
// Build document if it not exists
|
// Build document if it not exists
|
||||||
@ -1840,7 +1840,7 @@ if ($action == 'presend')
|
|||||||
dol_print_error($db,$result);
|
dol_print_error($db,$result);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref);
|
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2347,7 +2347,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
|||||||
{
|
{
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref);
|
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
|
|
||||||
// Build document if it not exists
|
// Build document if it not exists
|
||||||
@ -2370,7 +2370,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
|||||||
dol_print_error($db,$result);
|
dol_print_error($db,$result);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref);
|
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3343,7 +3343,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref);
|
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
|
|
||||||
// Build document if it not exists
|
// Build document if it not exists
|
||||||
@ -3366,7 +3366,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
dol_print_error($db,$result);
|
dol_print_error($db,$result);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref);
|
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -140,7 +140,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
|
|||||||
if ($loaddate || $sortcriteria == 'date') $filedate=dol_filemtime($path."/".$file);
|
if ($loaddate || $sortcriteria == 'date') $filedate=dol_filemtime($path."/".$file);
|
||||||
if ($loadsize || $sortcriteria == 'size') $filesize=dol_filesize($path."/".$file);
|
if ($loadsize || $sortcriteria == 'size') $filesize=dol_filesize($path."/".$file);
|
||||||
|
|
||||||
if (! $filter || preg_match('/'.$filter.'/i',$path.'/'.$file))
|
if (! $filter || preg_match('/'.$filter.'/i',$file)) // We do not search key $filter into $path, only into $file
|
||||||
{
|
{
|
||||||
$file_list[] = array(
|
$file_list[] = array(
|
||||||
"name" => $file,
|
"name" => $file,
|
||||||
@ -164,7 +164,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
|
|||||||
if ($loaddate || $sortcriteria == 'date') $filedate=dol_filemtime($path."/".$file);
|
if ($loaddate || $sortcriteria == 'date') $filedate=dol_filemtime($path."/".$file);
|
||||||
if ($loadsize || $sortcriteria == 'size') $filesize=dol_filesize($path."/".$file);
|
if ($loadsize || $sortcriteria == 'size') $filesize=dol_filesize($path."/".$file);
|
||||||
|
|
||||||
if (! $filter || preg_match('/'.$filter.'/i',$path.'/'.$file))
|
if (! $filter || preg_match('/'.$filter.'/i',$file)) // We do not search key $filter into $path, only into $file
|
||||||
{
|
{
|
||||||
$file_list[] = array(
|
$file_list[] = array(
|
||||||
"name" => $file,
|
"name" => $file,
|
||||||
|
|||||||
@ -1407,7 +1407,7 @@ else
|
|||||||
{
|
{
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref);
|
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
|
|
||||||
// Build document if it not exists
|
// Build document if it not exists
|
||||||
@ -1430,7 +1430,7 @@ else
|
|||||||
dol_print_error($db,$result);
|
dol_print_error($db,$result);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref);
|
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1451,7 +1451,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref);
|
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
|
|
||||||
// Build document if it not exists
|
// Build document if it not exists
|
||||||
@ -1474,7 +1474,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
dol_print_error($db,$result);
|
dol_print_error($db,$result);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref);
|
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1783,7 +1783,7 @@ if (! empty($object->id))
|
|||||||
{
|
{
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref);
|
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
|
|
||||||
// Build document if it not exists
|
// Build document if it not exists
|
||||||
@ -1806,7 +1806,7 @@ if (! empty($object->id))
|
|||||||
dol_print_error($db,$result);
|
dol_print_error($db,$result);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref);
|
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2036,7 +2036,7 @@ else
|
|||||||
{
|
{
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref);
|
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
|
|
||||||
// Build document if it not exists
|
// Build document if it not exists
|
||||||
@ -2059,7 +2059,7 @@ else
|
|||||||
dol_print_error($db,$result);
|
dol_print_error($db,$result);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref);
|
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($object->ref,'/'));
|
||||||
$file=$fileparams['fullname'];
|
$file=$fileparams['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -239,7 +239,10 @@ input:-webkit-autofill {
|
|||||||
input.liste_titre {
|
input.liste_titre {
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
}
|
}
|
||||||
|
input.removedfile {
|
||||||
|
padding: 0px !important;
|
||||||
|
border: 0px !important;
|
||||||
|
}
|
||||||
textarea:disabled {
|
textarea:disabled {
|
||||||
background:#ddd;
|
background:#ddd;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user