Fix: Use wrong value of constant if multientity is used.

This commit is contained in:
Laurent Destailleur 2009-12-09 20:06:48 +00:00
parent f7c9d6be62
commit 4e5eb408a3
5 changed files with 15 additions and 12 deletions

View File

@ -66,7 +66,7 @@ if (! $user->rights->adherent->cotisation->lire)
// Insertion de la cotisation dans le compte banquaire
if ($allowinsertbankafter && $_POST["action"] == '2bank' && $_POST["rowid"] !='')
{
if (defined("ADHERENT_BANK_USE") && $conf->global->ADHERENT_BANK_USE)
if ($conf->global->ADHERENT_BANK_USE)
{
if (! $_POST["accountid"])
{

View File

@ -29,9 +29,9 @@
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT.'/propal.class.php');
require_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php');
if (defined("PROPALE_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php"))
if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
{
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php");
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php");
}
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php');

View File

@ -265,7 +265,7 @@ if ($socid > 0)
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>';
}
if ($conf->propal->enabled && defined("MAIN_MODULE_PROPALE") && MAIN_MODULE_PROPALE && $user->rights->propale->creer)
if ($conf->propal->enabled && $user->rights->propale->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$societe->id.'&amp;action=create">'.$langs->trans("AddProp").'</a>';
}

View File

@ -36,9 +36,9 @@ if ($conf->projet->enabled)
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
}
if (defined("FICHEINTER_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/fichinter/mod_".FICHEINTER_ADDON.".php"))
if (! empty($conf->global->FICHEINTER_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/fichinter/mod_".$conf->global->FICHEINTER_ADDON.".php"))
{
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/fichinter/mod_".FICHEINTER_ADDON.".php");
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/fichinter/mod_".$conf->global->FICHEINTER_ADDON.".php");
}
$langs->load("companies");

View File

@ -726,10 +726,13 @@ class Propal extends CommonObject
$object->id=0;
$object->statut=0;
if (defined("PROPALE_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php"))
if (empty($conf->global->PROPALE_ADDON) || ! is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
{
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php");
$this->error='ErrorSetupNotComplete';
return -1;
}
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php");
$obj = $conf->global->PROPALE_ADDON;
$modPropale = new $obj;
$numpr = $modPropale->getNextValue($soc,$object);
@ -2009,17 +2012,17 @@ class Propal extends CommonObject
*/
function getNextNumRef($soc)
{
global $db, $langs;
global $conf, $db, $langs;
$langs->load("propal");
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/propale/";
if (defined("PROPALE_ADDON") && PROPALE_ADDON)
if (! empty($conf->global->PROPALE_ADDON))
{
$file = PROPALE_ADDON.".php";
$file = $conf->global->PROPALE_ADDON.".php";
// Chargement de la classe de numerotation
$classname = PROPALE_ADDON;
$classname = $conf->global->PROPALE_ADDON;
require_once($dir.$file);
$obj = new $classname();