Fix: duplicate parameters
This commit is contained in:
parent
b39c9c514a
commit
71d5191ff7
@ -551,7 +551,7 @@ class FormFile
|
|||||||
* @param string $url Full url to use for click links ('' = autodetect)
|
* @param string $url Full url to use for click links ('' = autodetect)
|
||||||
* @return int <0 if KO, nb of files shown if OK
|
* @return int <0 if KO, nb of files shown if OK
|
||||||
*/
|
*/
|
||||||
function list_of_documents($filearray,$object,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='')
|
function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='')
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs;
|
global $user, $conf, $langs;
|
||||||
global $bc, $hookmanager;
|
global $bc, $hookmanager;
|
||||||
@ -588,6 +588,8 @@ class FormFile
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$param = (isset($object->id)?'&id='.$object->id:'').$param;
|
||||||
|
|
||||||
// Show list of existing files
|
// Show list of existing files
|
||||||
if (empty($useinecm)) print_titre($title?$title:$langs->trans("AttachedFiles"));
|
if (empty($useinecm)) print_titre($title?$title:$langs->trans("AttachedFiles"));
|
||||||
if (empty($url)) $url=$_SERVER["PHP_SELF"];
|
if (empty($url)) $url=$_SERVER["PHP_SELF"];
|
||||||
@ -642,7 +644,7 @@ class FormFile
|
|||||||
// Delete or view link
|
// Delete or view link
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($useinecm) print '<a href="'.DOL_URL_ROOT.'/ecm/docfile.php?urlfile='.urlencode($file['name']).$param.'" class="editfilelink" rel="'.urlencode($file['name']).'">'.img_view().'</a> ';
|
if ($useinecm) print '<a href="'.DOL_URL_ROOT.'/ecm/docfile.php?urlfile='.urlencode($file['name']).$param.'" class="editfilelink" rel="'.urlencode($file['name']).'">'.img_view().'</a> ';
|
||||||
if ($permtodelete) print '<a href="'.(($useinecm && ! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':$url.'?action=delete'.(isset($object->id)?'&id='.$object->id:'').'&urlfile='.urlencode($file['name']).$param).'" class="deletefilelink" rel="'.urlencode($file['name']).'">'.img_delete().'</a>';
|
if ($permtodelete) print '<a href="'.(($useinecm && ! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':$url.'?action=delete&urlfile='.urlencode($file['name']).$param).'" class="deletefilelink" rel="'.urlencode($file['name']).'">'.img_delete().'</a>';
|
||||||
else print ' ';
|
else print ' ';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -716,7 +716,7 @@ function dolMoveUploadedFile($src_file, $dest_file, $allowoverwrite, $notrigger=
|
|||||||
{
|
{
|
||||||
if (file_exists($file_name_osencoded))
|
if (file_exists($file_name_osencoded))
|
||||||
{
|
{
|
||||||
dol_syslog("Files.lib::dol_move_uploaded_file File ".$file_name." already exists. Return 'ErrorFileAlreadyExists'", LOG_WARNING);
|
dol_syslog("Files.lib::dol_move_uploaded_file File ".$dest_file." already exists. Return 'ErrorFileAlreadyExists'", LOG_WARNING);
|
||||||
return 'ErrorFileAlreadyExists';
|
return 'ErrorFileAlreadyExists';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -726,7 +726,7 @@ function dolMoveUploadedFile($src_file, $dest_file, $allowoverwrite, $notrigger=
|
|||||||
if ($return)
|
if ($return)
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK));
|
if (! empty($conf->global->MAIN_UMASK)) @chmod($file_name_osencoded, octdec($conf->global->MAIN_UMASK));
|
||||||
dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG);
|
dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$dest_file." - Umask=".$conf->global->MAIN_UMASK, LOG_DEBUG);
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $notrigger)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -151,8 +151,7 @@ if ($object->id)
|
|||||||
|
|
||||||
|
|
||||||
// List of document
|
// List of document
|
||||||
$param='&id='.$object->id;
|
$formfile->list_of_documents($filearray,$object,'produit');
|
||||||
$formfile->list_of_documents($filearray,$object,'produit',$param);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user