Fix: Si rep export compta existe pas on le cre
This commit is contained in:
parent
d040a3f7f8
commit
4ed0ff200d
@ -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 "</table>\n";
|
||||
|
||||
print '</td><td valign="top" width="70%">';
|
||||
|
||||
$dir = DOL_DATA_ROOT."/compta/export/";
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -125,16 +128,18 @@ print '<td>'.$langs->trans("File").'</td>';
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$handle=opendir($dir);
|
||||
|
||||
while (($file = readdir($handle))!==false)
|
||||
$handle=@opendir($dir);
|
||||
if ($handle)
|
||||
{
|
||||
if (is_readable($dir.$file) && is_file($dir.$file))
|
||||
{
|
||||
print '<tr><td><a href="'.DOL_URL_ROOT.'/document.php?modulepart=export_compta&file=export/'.$file.'&type=text/plain">'.$file.'</a><td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (is_readable($dir.$file) && is_file($dir.$file))
|
||||
{
|
||||
print '<tr><td><a href="'.DOL_URL_ROOT.'/document.php?modulepart=export_compta&file=export/'.$file.'&type=text/plain">'.$file.'</a><td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
@ -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<!-- debut table -->\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
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<!-- debut table -->\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print "<td>-</td></tr>\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 "<td>-</td></tr>\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 "<tr $bc[$var]>";
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print '<td>'.$obj->ref.'</td>';
|
||||
print '<td>'.strftime("%a %e %b %Y %H:%M:%S",$obj->date_export).'</td>';
|
||||
print '<td><a href="index.php?action=export&id='.$obj->rowid.'">Regénérer</a></td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
$db->free($result);
|
||||
print '<td>'.$obj->ref.'</td>';
|
||||
print '<td>'.dolibarr_print_date($obj->date_export,"%a %e %b %Y %H:%M:%S").'</td>';
|
||||
print '<td><a href="index.php?action=export&id='.$obj->rowid.'">'.$langs->trans("ReBuild").'</a></td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user