Skip to content
Snippets Groups Projects
Commit 605cd43f authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Lien sur le download des exports

parent 93d834b9
Branches
Tags
No related merge requests found
<?php <?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* 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> * Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -41,6 +41,7 @@ $modulepart = urldecode($_GET["modulepart"]); ...@@ -41,6 +41,7 @@ $modulepart = urldecode($_GET["modulepart"]);
// Dfini type et attachment // Dfini type et attachment
$type = urldecode($_GET["type"]); $attachment = true; $type = urldecode($_GET["type"]); $attachment = true;
if (eregi('\.html',$original_file)) { $type='text/html'; $attachment = false; } 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; } if (eregi('\.pdf',$original_file)) { $type='application/pdf'; $attachment = true; }
//Suppression de la chaine de caractre ../ dans $original_file //Suppression de la chaine de caractre ../ dans $original_file
...@@ -151,7 +152,7 @@ if ($modulepart) ...@@ -151,7 +152,7 @@ if ($modulepart)
} }
// Wrapping pour la telephonie // Wrapping pour les actions
if ($modulepart == 'actionscomm') if ($modulepart == 'actionscomm')
{ {
$user->getrights('commercial'); $user->getrights('commercial');
...@@ -173,7 +174,7 @@ if ($modulepart) ...@@ -173,7 +174,7 @@ if ($modulepart)
$original_file=$conf->produit->dir_output.'/'.$original_file; $original_file=$conf->produit->dir_output.'/'.$original_file;
} }
// Wrapping pour les factures // Wrapping pour les dons
if ($modulepart == 'don') if ($modulepart == 'don')
{ {
$user->getrights('don'); $user->getrights('don');
...@@ -184,6 +185,15 @@ if ($modulepart) ...@@ -184,6 +185,15 @@ if ($modulepart)
$original_file=$conf->don->dir_output.'/'.$original_file; $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 accs si droits non corrects // Limite accs si droits non corrects
......
...@@ -466,8 +466,7 @@ if ($step == 4 && $datatoexport) ...@@ -466,8 +466,7 @@ if ($step == 4 && $datatoexport)
// Affiche liste des documents // Affiche liste des documents
// NB: La fonction show_documents rescanne les modules qd genallowed=1 // NB: La fonction show_documents rescanne les modules qd genallowed=1
$filename=$datatoexport; $htmlform->show_documents('export','',$conf->export->dir_ouput.'/'.$user->id,$_SERVER["PHP_SELF"].'?step=4&amp;datatoexport='.$datatoexport,$liste,1,'csv');
$htmlform->show_documents('export',$filename,$conf->export->dir_ouput.'/'.$user->id,$_SERVER["PHP_SELF"].'?step=4&amp;datatoexport='.$datatoexport,$liste,1,'csv');
print '</td><td width="50%">&nbsp;</td></tr>'; print '</td><td width="50%">&nbsp;</td></tr>';
print '</table>'; print '</table>';
......
...@@ -1888,8 +1888,9 @@ class Form ...@@ -1888,8 +1888,9 @@ class Form
// Défini chemin relatif par rapport au module pour lien download // Défini chemin relatif par rapport au module pour lien download
$relativepath=$filename."/".$file; $relativepath=$filename."/".$file;
if ($modulepart == 'expedition') { $relativepath = get_exdir("${filename}")."${file}"; } if ($modulepart == 'expedition') { $relativepath = get_exdir($filename).$file; }
if ($modulepart == 'don') { $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 // Défini le type MIME du document
if (eregi('\.([^\.]+)$',$file,$reg)) $extension=$reg[1]; if (eregi('\.([^\.]+)$',$file,$reg)) $extension=$reg[1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment