FIX Link to files on bank account tab broken with multicompany
FIX Link to preview on thirdparty broken with multicompany
This commit is contained in:
parent
823e5b48e3
commit
5a96ae54b9
@ -680,7 +680,7 @@ class FormFile
|
||||
$out.= ' target="_blank">';
|
||||
$out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength);
|
||||
$out.= '</a>'."\n";
|
||||
$out.= $this->showPreview($file,$modulepart,$relativepath);
|
||||
$out.= $this->showPreview($file,$modulepart,$relativepath,0,$param);
|
||||
$out.= '</td>';
|
||||
|
||||
// Show file size
|
||||
@ -1498,16 +1498,17 @@ class FormFile
|
||||
* @param string $modulepart propal, facture, facture_fourn, ...
|
||||
* @param string $relativepath Relative path of docs
|
||||
* @param string $ruleforpicto Rule for picto: 0=Preview picto, 1=Use picto of mime type of file)
|
||||
* @param string $param More param on http links
|
||||
* @return string $out Output string with HTML
|
||||
*/
|
||||
public function showPreview($file, $modulepart, $relativepath, $ruleforpicto=0)
|
||||
public function showPreview($file, $modulepart, $relativepath, $ruleforpicto=0, $param='')
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
$out='';
|
||||
if ($conf->browser->layout != 'phone')
|
||||
{
|
||||
$urladvancedpreview=getAdvancedPreviewUrl($modulepart, $relativepath); // Return if a file is qualified for preview
|
||||
$urladvancedpreview=getAdvancedPreviewUrl($modulepart, $relativepath, $param); // Return if a file is qualified for preview
|
||||
if ($urladvancedpreview)
|
||||
{
|
||||
$out.= '<a data-ajax="false" class="pictopreview" href="'.$urladvancedpreview.'">';
|
||||
|
||||
@ -5839,9 +5839,10 @@ function getImageFileNameForSize($file, $extName, $extImgTarget='')
|
||||
*
|
||||
* @param string $modulepart propal, facture, facture_fourn, ...
|
||||
* @param string $relativepath Relative path of docs
|
||||
* @param string $param More param on http links
|
||||
* @return string Output string with HTML
|
||||
*/
|
||||
function getAdvancedPreviewUrl($modulepart, $relativepath)
|
||||
function getAdvancedPreviewUrl($modulepart, $relativepath, $param='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -5852,7 +5853,7 @@ function getAdvancedPreviewUrl($modulepart, $relativepath)
|
||||
//$mime_preview[]='archive';
|
||||
$num_mime = array_search(dol_mimetype($relativepath, '', 1), $mime_preview);
|
||||
|
||||
if ($num_mime !== false) return 'javascript:document_preview(\''.dol_escape_js(DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.$relativepath).'\', \''.dol_mimetype($relativepath).'\', \''.dol_escape_js('Preview').'\')';
|
||||
if ($num_mime !== false) return 'javascript:document_preview(\''.dol_escape_js(DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.$relativepath.($param?'&'.$param:'')).'\', \''.dol_mimetype($relativepath).'\', \''.dol_escape_js('Preview').'\')';
|
||||
else return '';
|
||||
}
|
||||
|
||||
|
||||
@ -657,7 +657,7 @@ if ($socid && $action != 'edit' && $action != "create")
|
||||
|
||||
$var=true;
|
||||
|
||||
print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 0, 0, 0, 28, 0, '', 0, '', $object->default_lang);
|
||||
print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user