From 1a3a881264e486f86295b1592e0b162762c50129 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 9 Jul 2007 10:23:59 +0000 Subject: [PATCH] Ajout archivage --- htdocs/telephonie/facturation/files.php | 29 +++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/htdocs/telephonie/facturation/files.php b/htdocs/telephonie/facturation/files.php index 198f36a8430..d6eea11b949 100644 --- a/htdocs/telephonie/facturation/files.php +++ b/htdocs/telephonie/facturation/files.php @@ -22,6 +22,29 @@ require("./pre.inc.php"); require_once DOL_DOCUMENT_ROOT.'/telephonie/fournisseurtel.class.php'; +if (!$user->rights->telephonie->facture->ecrire) accessforbidden(); + +if ($_GET["action"] == 'archive' && $user->rights->telephonie->facture->ecrire) +{ + $srcdir = $conf->telephonie->dir_output."/cdr/atraiter/" ; + + + $file = urldecode ($_GET["file"]); + + $destdir = $conf->telephonie->dir_output."/cdr/archive/".dirname($file).'/'; + + if (!is_dir($destdir)) + { + @mkdir($destdir); + } + + if (is_dir($destdir) && is_file($srcdir.$file)) + { + rename($srcdir.$file,$destdir.basename($file)); + } + +} + $dir = $conf->telephonie->dir_output."/cdr/atraiter/" ; $files = array(); @@ -48,9 +71,6 @@ foreach ($fourns as $id => $nom) } } - -if (!$user->rights->telephonie->facture->ecrire) accessforbidden(); - llxHeader(); /* @@ -72,7 +92,7 @@ print ''; print ''; print ''; print ''; -print "\n"; +print "\n"; $var=True; @@ -91,6 +111,7 @@ foreach ($files as $file) print ''; print ''; + print ''; } print "
FournisseurFichierDateTaille
 
'.date("d F Y H:i:s", filemtime($dir.$file)).''.filesize($dir.$file).' octetsarchiver
";