Fix: add "set_include_path"

This commit is contained in:
Regis Houssin 2010-03-30 16:40:00 +00:00
parent 3239569860
commit 281805991a
4 changed files with 37 additions and 12 deletions

View File

@ -465,8 +465,14 @@ foreach ($orders as $key => $value)
}
else
{
//print '<a href="'.$page.'">'.$langs->trans("Setup").'</a>&nbsp;';
print '<a href="'.$urlpage.'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a>&nbsp;';
if (preg_match('/^([^@]+)@([^@]+)$/i',$urlpage,$regs))
{
print '<a href="'.DOL_URL_ROOT.'/'.$regs[2].'/admin/'.$regs[1].'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a>&nbsp;';
}
else
{
print '<a href="'.$urlpage.'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a>&nbsp;';
}
}
}
print "</td>\n";

View File

@ -53,12 +53,13 @@ class Conf
//! Used to store entity for multi-company (default 1)
var $entity=1;
var $css_modules=array();
var $tabs_modules=array();
var $need_smarty=array();
var $modules=array();
var $css_modules = array();
var $tabs_modules = array();
var $need_smarty = array();
var $modules = array();
var $include_path = array();
var $logbuffer=array();
var $logbuffer = array();
/**
* Constructor
@ -80,6 +81,11 @@ class Conf
function setValues($db)
{
dol_syslog("Conf::setValues");
// Add root path
$this->include_path[] = DOL_DOCUMENT_ROOT;
// Add library path
$this->include_path[] = DOL_DOCUMENT_ROOT."/lib/";
// Avoid warning if not defined
if (empty($this->db->dolibarr_main_db_encryption)) $this->db->dolibarr_main_db_encryption=0;
@ -159,12 +165,25 @@ class Conf
$this->$module->enabled=true;
// Add this module in list of enabled modules
$this->modules[]=$module;
// Add class path
if (file_exists(DOL_DOCUMENT_ROOT.'/'.$module.'/class/'))
{
$this->include_path[] = DOL_DOCUMENT_ROOT.'/'.$module.'/class/';
}
// Add library path
if (file_exists(DOL_DOCUMENT_ROOT.'/'.$module.'/lib/'))
{
$this->include_path[] = DOL_DOCUMENT_ROOT.'/'.$module.'/lib/';
}
}
}
$i++;
}
}
$db->free($result);
// Set include_path
set_include_path(implode(PATH_SEPARATOR, $this->include_path));
// Clean some variables
// conf->menu_top et conf->menu_left are defined in main.inc.php (according to user choice)

View File

@ -74,7 +74,7 @@ class modMultiCompany extends DolibarrModules
$this->style_sheet = '';
// Config pages. Put here list of php page names stored in admmin directory used to setup module.
$this->config_page_url = array("multicompany.php");
$this->config_page_url = array("multicompany.php@multicompany");
// Dependencies
$this->depends = array(); // List of modules id that must be enabled if this module is enabled

View File

@ -23,10 +23,10 @@
* \version $Id$
*/
require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT.'/multicompany/class/multicompany.class.php');
require("../../main.inc.php");
require_once("multicompany.class.php");
require_once("admin.lib.php");
require_once("company.lib.php");
$langs->load("admin");