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 '
| Fournisseur | '; print 'Fichier | Date | '; print 'Taille | '; -print "\n"; $var=True; @@ -91,6 +111,7 @@ foreach ($files as $file) print ' | '.date("d F Y H:i:s", filemtime($dir.$file)).' | '; print ''.filesize($dir.$file).' octets | '; + print 'archiver | '; } print "