mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: Lien sur le download des exports
This commit is contained in:
parent
93d834b917
commit
605cd43fb7
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -41,6 +41,7 @@ $modulepart = urldecode($_GET["modulepart"]);
|
|||
// Défini type et attachment
|
||||
$type = urldecode($_GET["type"]); $attachment = true;
|
||||
if (eregi('\.html',$original_file)) { $type='text/html'; $attachment = false; }
|
||||
if (eregi('\.csv',$original_file)) { $type='text/csv'; $attachment = true; }
|
||||
if (eregi('\.pdf',$original_file)) { $type='application/pdf'; $attachment = true; }
|
||||
|
||||
//Suppression de la chaine de caractère ../ dans $original_file
|
||||
|
|
@ -151,7 +152,7 @@ if ($modulepart)
|
|||
}
|
||||
|
||||
|
||||
// Wrapping pour la telephonie
|
||||
// Wrapping pour les actions
|
||||
if ($modulepart == 'actionscomm')
|
||||
{
|
||||
$user->getrights('commercial');
|
||||
|
|
@ -173,7 +174,7 @@ if ($modulepart)
|
|||
$original_file=$conf->produit->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour les factures
|
||||
// Wrapping pour les dons
|
||||
if ($modulepart == 'don')
|
||||
{
|
||||
$user->getrights('don');
|
||||
|
|
@ -184,6 +185,15 @@ if ($modulepart)
|
|||
$original_file=$conf->don->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour les exports
|
||||
if ($modulepart == 'export')
|
||||
{
|
||||
// Aucun test necessaire car on force le rep de doanwload sur
|
||||
// le rep export qui est propre à l'utilisateur
|
||||
$accessallowed=1;
|
||||
$original_file=$conf->export->dir_ouput.'/'.$user->id.'/'.$original_file;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Limite accès si droits non corrects
|
||||
|
|
|
|||
|
|
@ -466,8 +466,7 @@ if ($step == 4 && $datatoexport)
|
|||
|
||||
// Affiche liste des documents
|
||||
// NB: La fonction show_documents rescanne les modules qd genallowed=1
|
||||
$filename=$datatoexport;
|
||||
$htmlform->show_documents('export',$filename,$conf->export->dir_ouput.'/'.$user->id,$_SERVER["PHP_SELF"].'?step=4&datatoexport='.$datatoexport,$liste,1,'csv');
|
||||
$htmlform->show_documents('export','',$conf->export->dir_ouput.'/'.$user->id,$_SERVER["PHP_SELF"].'?step=4&datatoexport='.$datatoexport,$liste,1,'csv');
|
||||
|
||||
print '</td><td width="50%"> </td></tr>';
|
||||
print '</table>';
|
||||
|
|
|
|||
|
|
@ -1888,8 +1888,9 @@ class Form
|
|||
|
||||
// Défini chemin relatif par rapport au module pour lien download
|
||||
$relativepath=$filename."/".$file;
|
||||
if ($modulepart == 'expedition') { $relativepath = get_exdir("${filename}")."${file}"; }
|
||||
if ($modulepart == 'don') { $relativepath = get_exdir("${filename}")."${file}"; }
|
||||
if ($modulepart == 'expedition') { $relativepath = get_exdir($filename).$file; }
|
||||
if ($modulepart == 'don') { $relativepath = get_exdir($filename).$file; }
|
||||
if ($modulepart == 'export') { $relativepath = $file; }
|
||||
|
||||
// Défini le type MIME du document
|
||||
if (eregi('\.([^\.]+)$',$file,$reg)) $extension=$reg[1];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user