Generalize fix: file with a specific mask not found, again
Conflicts: htdocs/comm/propal.php htdocs/commande/fiche.php htdocs/compta/facture.php htdocs/expedition/fiche.php htdocs/fichinter/fiche.php
This commit is contained in:
parent
1e3b26a104
commit
e0baa0fe46
@ -1851,7 +1851,7 @@ if ($action == 'presend')
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
@ -1904,4 +1904,4 @@ if ($action == 'presend')
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
?>
|
||||
@ -2359,7 +2359,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
||||
{
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
|
||||
// Build document if it not exists
|
||||
@ -2382,7 +2382,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
|
||||
@ -3373,7 +3373,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ function dol_basename($pathfile)
|
||||
* @param string $path Starting path from which to search
|
||||
* @param string $types Can be "directories", "files", or "all"
|
||||
* @param int $recursive Determines whether subdirectories are searched
|
||||
* @param string $filter Regex for include filter
|
||||
* @param string $filter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
|
||||
* @param string $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.'))
|
||||
* @param string $sortcriteria Sort criteria ("","fullname","name","date","size")
|
||||
* @param string $sortorder Sort order (SORT_ASC, SORT_DESC)
|
||||
@ -1237,8 +1237,8 @@ function dol_uncompress($inputfile,$outputdir)
|
||||
* Return most recent file
|
||||
*
|
||||
* @param string $dir Directory to scan
|
||||
* @param string $regexfilter Regexfilter
|
||||
* @param string $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.'))
|
||||
* @param string $regexfilter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
|
||||
* @param string $excludefilter Array of Regex for exclude filter (example: array('\.meta$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function
|
||||
* @return strnig Full path to most recent file
|
||||
*/
|
||||
function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('\.meta$','^\.'))
|
||||
|
||||
@ -1407,7 +1407,7 @@ else
|
||||
{
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
|
||||
// Build document if it not exists
|
||||
@ -1430,7 +1430,7 @@ else
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
@ -1491,4 +1491,4 @@ else
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
?>
|
||||
|
||||
@ -1451,7 +1451,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
|
||||
// Build document if it not exists
|
||||
@ -1474,7 +1474,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
|
||||
@ -1785,7 +1785,7 @@ if (! empty($object->id))
|
||||
{
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
|
||||
// Build document if it not exists
|
||||
@ -1808,7 +1808,7 @@ if (! empty($object->id))
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
|
||||
@ -2039,7 +2039,7 @@ else
|
||||
{
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
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, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
|
||||
// Build document if it not exists
|
||||
@ -2062,7 +2062,7 @@ else
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user