forked from Wavyzz/dolibarr
Fix : bad usage of this
This commit is contained in:
committed by
jfefe
parent
a76fef5f35
commit
b3f7e9f99b
@@ -1755,20 +1755,21 @@ function getElementProperties($element_type)
|
|||||||
* Fetch an object with element_type and its id
|
* Fetch an object with element_type and its id
|
||||||
* Inclusion classes is automatic
|
* Inclusion classes is automatic
|
||||||
*
|
*
|
||||||
* @param int $element_id
|
* @param int $element_id Element id
|
||||||
* @param string $element_type
|
* @param string $element_type Element type
|
||||||
* @return object || 0 || -1 if error
|
* @return object || 0 || -1 if error
|
||||||
*/
|
*/
|
||||||
function fetchObjectByElement($element_id,$element_type) {
|
function fetchObjectByElement($element_id,$element_type) {
|
||||||
|
|
||||||
global $conf;
|
global $conf;
|
||||||
|
global $db,$conf;
|
||||||
|
|
||||||
$element_prop = getElementProperties($element_type);
|
$element_prop = getElementProperties($element_type);
|
||||||
if (is_array($element_prop) && $conf->$element_prop['module']->enabled)
|
if (is_array($element_prop) && $conf->$element_prop['module']->enabled)
|
||||||
{
|
{
|
||||||
dol_include_once('/'.$element_prop['classpath'].'/'.$element_prop['classfile'].'.class.php');
|
dol_include_once('/'.$element_prop['classpath'].'/'.$element_prop['classfile'].'.class.php');
|
||||||
|
|
||||||
$objectstat = new $element_prop['classname']($this->db);
|
$objectstat = new $element_prop['classname']($db);
|
||||||
$ret = $objectstat->fetch($element_id);
|
$ret = $objectstat->fetch($element_id);
|
||||||
if ($ret >= 0)
|
if ($ret >= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user