First changes to prepare cron module

This commit is contained in:
Laurent Destailleur 2009-03-07 01:03:20 +00:00
parent 8eb76f5a33
commit 8faa018266
5 changed files with 23 additions and 4 deletions

View File

@ -40,6 +40,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Include Dolibarr environment
require_once($path."../../htdocs/master.inc.php");
// After this $db is an opened handler to database. We close it at end of file.
require_once(DOL_DOCUMENT_ROOT."/cron/functions_cron.lib.php");
// Load main language strings
$langs->load("main");
@ -63,6 +65,12 @@ if (! isset($argv[1])) {
print 'Argument 1='.$argv[1]."\n";
print 'Argument 2='.$argv[2]."\n";
print '--- start'."\n";
// Start of transaction
$db->begin();
// Examples for manipulating class skeleton_class
require_once(DOL_DOCUMENT_ROOT."/../dev/skeletons/skeleton_class.class.php");
@ -143,6 +151,17 @@ else
// -------------------- END OF YOUR CODE --------------------
if (! $error)
{
$db->commit();
print '--- end ok'."\n";
}
else
{
print '--- end error code='.$error."\n";
$db->rollback();
}
$db->close();
return $error;

View File

@ -196,6 +196,7 @@ class Conf
$this->don->dir_temp =DOL_DATA_ROOT."/dons/temp";
// Module fournisseur
$this->fournisseur->dir_output=DOL_DATA_ROOT."/fournisseur";
$this->fournisseur->dir_temp=DOL_DATA_ROOT."/fournisseur/temp";
$this->fournisseur->commande->dir_output=DOL_DATA_ROOT."/fournisseur/commande";
$this->fournisseur->commande->dir_temp =DOL_DATA_ROOT."/fournisseur/commande/temp";
$this->fournisseur->facture->dir_output =DOL_DATA_ROOT."/fournisseur/facture";

View File

@ -82,7 +82,7 @@ if ( $societe->fetch($socid) )
print '<tr><td valign="top" width="50%">';
$file = get_exdir($societe->id, 3) . "ca_genere-".$societe->id.".png";
if (file_exists($file))
if (file_exists($conf->fournisseur->dir_temp.'/'.$file))
{
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_fourn&amp;file='.$file;
print '<img src="'.$url.'" alt="CA genere">';
@ -95,7 +95,7 @@ if ( $societe->fetch($socid) )
print '</td><td valign="top" width="50%">';
$file = get_exdir($societe->id, 3) . "ca_achat-".$societe->id.".png";
if (file_exists($file))
if (file_exists($conf->fournisseur->dir_temp.'/'.$file))
{
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_fourn&amp;file='.$file;
print '<img src="'.$url.'" alt="CA">';

View File

@ -66,8 +66,7 @@ for ($i = 1 ; $i < sizeof($argv) ; $i++)
}
}
$dir = DOL_DATA_ROOT."/fournisseur/temp";
$dir = $conf->fournisseur->dir_temp;
$result=create_exdir($dir);
if ($result < 0)
{