diff --git a/htdocs/compta/export/index.php b/htdocs/compta/export/index.php index 1dbbc49069c..eddd0f13a9b 100644 --- a/htdocs/compta/export/index.php +++ b/htdocs/compta/export/index.php @@ -33,6 +33,8 @@ require_once("./ComptaJournalVente.class.php"); $langs->load("compta"); +$dir = $conf->compta->dir_output."/export/"; + /* * Actions @@ -43,6 +45,8 @@ if ($_GET["action"] == 'export') $modulename='Poivre'; include_once DOL_DOCUMENT_ROOT.'/compta/export/modules/compta.export.class.php'; + + create_exdir($dir); $exc = new ComptaExport($db, $user, $modulename); @@ -117,7 +121,6 @@ print "\n"; print ''; -$dir = DOL_DATA_ROOT."/compta/export/"; print ''; print ''; @@ -125,16 +128,18 @@ print ''; print ''; print "\n"; -$handle=opendir($dir); - -while (($file = readdir($handle))!==false) +$handle=@opendir($dir); +if ($handle) { - if (is_readable($dir.$file) && is_file($dir.$file)) - { - print ''; - } + while (($file = readdir($handle))!==false) + { + if (is_readable($dir.$file) && is_file($dir.$file)) + { + print ''; + } + } } print "
'.$langs->trans("File").' 
'.$file.''; - - print '
'.$file.''; + + print '
"; diff --git a/htdocs/compta/export/liste.php b/htdocs/compta/export/liste.php index 2a7bd0d33b5..e75a13f6b59 100644 --- a/htdocs/compta/export/liste.php +++ b/htdocs/compta/export/liste.php @@ -19,10 +19,19 @@ * $Source$ */ +/** + \file htdocs/compta/export/liste.php + \ingroup compta + \brief Page export ventilations + \version $Revision$ +*/ + require("./pre.inc.php"); $langs->load("compta"); +$dir = $conf->compta->dir_output."/export/"; + // Sécurité accés client if ($user->societe_id > 0) @@ -31,14 +40,6 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } - -llxHeader('','Compta - Export'); - -/* - * - * - */ - $page = $_GET["page"]; $sortorder = $_GET["sortorder"]; $sortfield = $_GET["sortfield"]; @@ -47,11 +48,15 @@ $offset = $conf->liste_limit * $page ; if ($sortorder == "") $sortorder="DESC"; if ($sortfield == "") $sortfield="ec.date_export"; + /* * Mode Liste * */ +llxHeader('','Compta - Export'); + + $sql = "SELECT ec.rowid,".$db->pdate("ec.date_export")." as date_export, ec.ref"; $sql .= " FROM ".MAIN_DB_PREFIX."export_compta as ec"; @@ -60,43 +65,41 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $ $result = $db->query($sql); if ($result) { - $num = $db->num_rows($result); - $i = 0; - - print_barre_liste($langs->trans("Exports"), $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num); + $num = $db->num_rows($result); + $i = 0; - print"\n\n"; - print ''; - print ''; + print_barre_liste($langs->trans("Exports"), $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num); - print_liste_field_titre($langs->trans("Ref"),"liste.php","ec.ref"); - print_liste_field_titre($langs->trans("Date"),"liste.php","ec.date_export"); + print"\n\n"; + print '
'; + print ''; - print "\n"; + print_liste_field_titre($langs->trans("Ref"),"liste.php","ec.ref"); + print_liste_field_titre($langs->trans("Date"),"liste.php","ec.date_export"); - $var=True; + print "\n"; - $dir = DOL_DATA_ROOT."/compta/export/"; + $var=True; - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object($result); - $var=!$var; + while ($i < min($num,$conf->liste_limit)) + { + $obj = $db->fetch_object($result); + $var=!$var; - print ""; + print ""; - print ''; - print ''; - print ''; - print "\n"; - $i++; - } - print "
-
-
'.$obj->ref.''.strftime("%a %e %b %Y %H:%M:%S",$obj->date_export).'Regénérer
"; - $db->free($result); + print ''.$obj->ref.''; + print ''.dolibarr_print_date($obj->date_export,"%a %e %b %Y %H:%M:%S").''; + print ''.$langs->trans("ReBuild").''; + print "\n"; + $i++; + } + print ""; + $db->free($result); } -else +else { - dolibarr_print_error($db); + dolibarr_print_error($db); } $db->close();