First changes to prepare cron module
This commit is contained in:
parent
8eb76f5a33
commit
8faa018266
@ -40,6 +40,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
|||||||
// Include Dolibarr environment
|
// Include Dolibarr environment
|
||||||
require_once($path."../../htdocs/master.inc.php");
|
require_once($path."../../htdocs/master.inc.php");
|
||||||
// After this $db is an opened handler to database. We close it at end of file.
|
// 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
|
// Load main language strings
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
@ -63,6 +65,12 @@ if (! isset($argv[1])) {
|
|||||||
print 'Argument 1='.$argv[1]."\n";
|
print 'Argument 1='.$argv[1]."\n";
|
||||||
print 'Argument 2='.$argv[2]."\n";
|
print 'Argument 2='.$argv[2]."\n";
|
||||||
|
|
||||||
|
print '--- start'."\n";
|
||||||
|
|
||||||
|
|
||||||
|
// Start of transaction
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
|
|
||||||
// Examples for manipulating class skeleton_class
|
// Examples for manipulating class skeleton_class
|
||||||
require_once(DOL_DOCUMENT_ROOT."/../dev/skeletons/skeleton_class.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/../dev/skeletons/skeleton_class.class.php");
|
||||||
@ -143,6 +151,17 @@ else
|
|||||||
|
|
||||||
// -------------------- END OF YOUR CODE --------------------
|
// -------------------- END OF YOUR CODE --------------------
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
print '--- end ok'."\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '--- end error code='.$error."\n";
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
return $error;
|
return $error;
|
||||||
|
|||||||
@ -196,6 +196,7 @@ class Conf
|
|||||||
$this->don->dir_temp =DOL_DATA_ROOT."/dons/temp";
|
$this->don->dir_temp =DOL_DATA_ROOT."/dons/temp";
|
||||||
// Module fournisseur
|
// Module fournisseur
|
||||||
$this->fournisseur->dir_output=DOL_DATA_ROOT."/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_output=DOL_DATA_ROOT."/fournisseur/commande";
|
||||||
$this->fournisseur->commande->dir_temp =DOL_DATA_ROOT."/fournisseur/commande/temp";
|
$this->fournisseur->commande->dir_temp =DOL_DATA_ROOT."/fournisseur/commande/temp";
|
||||||
$this->fournisseur->facture->dir_output =DOL_DATA_ROOT."/fournisseur/facture";
|
$this->fournisseur->facture->dir_output =DOL_DATA_ROOT."/fournisseur/facture";
|
||||||
|
|||||||
@ -82,7 +82,7 @@ if ( $societe->fetch($socid) )
|
|||||||
print '<tr><td valign="top" width="50%">';
|
print '<tr><td valign="top" width="50%">';
|
||||||
|
|
||||||
$file = get_exdir($societe->id, 3) . "ca_genere-".$societe->id.".png";
|
$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&file='.$file;
|
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_fourn&file='.$file;
|
||||||
print '<img src="'.$url.'" alt="CA genere">';
|
print '<img src="'.$url.'" alt="CA genere">';
|
||||||
@ -95,7 +95,7 @@ if ( $societe->fetch($socid) )
|
|||||||
print '</td><td valign="top" width="50%">';
|
print '</td><td valign="top" width="50%">';
|
||||||
|
|
||||||
$file = get_exdir($societe->id, 3) . "ca_achat-".$societe->id.".png";
|
$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&file='.$file;
|
$url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_fourn&file='.$file;
|
||||||
print '<img src="'.$url.'" alt="CA">';
|
print '<img src="'.$url.'" alt="CA">';
|
||||||
|
|||||||
@ -66,8 +66,7 @@ for ($i = 1 ; $i < sizeof($argv) ; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$dir = $conf->fournisseur->dir_temp;
|
||||||
$dir = DOL_DATA_ROOT."/fournisseur/temp";
|
|
||||||
$result=create_exdir($dir);
|
$result=create_exdir($dir);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user