diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index c77606d75bc..9290c9873bf 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -156,7 +156,7 @@ class FormFile * Show the box with list of available documents for object * * @param string $modulepart propal, facture, facture_fourn, ... - * @param string $filename Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if $filedir is already complete) + * @param string $modulesubdir Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. * @param string $filedir Directory to scan * @param string $urlsource Url of origin page (for return) * @param int $genallowed Generation is allowed (1/0 or array of formats) @@ -173,10 +173,10 @@ class FormFile * @param string $codelang Default language code to use on lang combo box if multilang is enabled * @return int <0 if KO, number of shown files if OK */ - function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') + function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') { $this->numoffiles=0; - print $this->showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$maxfilenamelength,$noform,$param,$title,$buttonlabel,$codelang); + print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$maxfilenamelength,$noform,$param,$title,$buttonlabel,$codelang); return $this->numoffiles; } @@ -185,7 +185,7 @@ class FormFile * This also set the property $this->numoffiles * * @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule_temp', ...) - * @param string $filename Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if $filedir is already complete) + * @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module. * @param string $filedir Directory to scan * @param string $urlsource Url of origin page (for return) * @param int $genallowed Generation is allowed (1/0 or array list of templates) @@ -203,7 +203,7 @@ class FormFile * @param string $morepicto Add more HTML content into cell with picto * @return string Output string with HTML array of documents (might be empty string) */ - function showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='') + function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='') { global $langs,$conf,$hookmanager; global $bc; @@ -213,7 +213,7 @@ class FormFile // For backward compatibility if (! empty($iconPDF)) { - return $this->getDocumentsLink($modulepart, $filename, $filedir); + return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir); } $printer = ($user->rights->printipp->read && $conf->printipp->enabled)?true:false; $hookmanager->initHooks(array('formfile')); @@ -486,9 +486,9 @@ class FormFile // Define relative path for download link (depends on module) $relativepath=$file["name"]; // Cas general - if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture... + if ($modulesubdir) $relativepath=$modulesubdir."/".$file["name"]; // Cas propal, facture... // Autre cas - if ($modulepart == 'donation') { $relativepath = get_exdir($filename,2).$file["name"]; } + if ($modulepart == 'donation') { $relativepath = get_exdir($modulesubdir,2).$file["name"]; } if ($modulepart == 'export') { $relativepath = $file["name"]; } $out.= "