Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-09-12 10:57:09 +02:00
commit 8fd384373a
4 changed files with 8 additions and 7 deletions

View File

@ -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> &nbsp; '; 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> &nbsp; ';
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 '&nbsp;'; else print '&nbsp;';
print "</td>"; print "</td>";
print "</tr>\n"; print "</tr>\n";

View File

@ -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)
{ {

View File

@ -3457,7 +3457,7 @@ function complete_substitutions_array(&$substitutionarray,$outputlangs,$object='
dol_syslog("Library functions_".$substitfile['name']." found into ".$dir); dol_syslog("Library functions_".$substitfile['name']." found into ".$dir);
require_once $dir.$substitfile['name']; require_once $dir.$substitfile['name'];
$function_name=$module."_".$callfunc; $function_name=$module."_".$callfunc;
$function_name($substitutionarray,$outputlangs,$object,$parameters); if (function_exists($function_name)) $function_name($substitutionarray,$outputlangs,$object,$parameters);
} }
} }
} }

View File

@ -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