mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-04 08:02:22 +01:00
Fix link to warehouses for events
This commit is contained in:
@@ -1830,6 +1830,11 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
|
||||
$module='projet';
|
||||
$subelement='task';
|
||||
}
|
||||
if ($objecttype == 'stock') {
|
||||
$classpath = 'product/stock/class';
|
||||
$module='stock';
|
||||
$subelement='stock';
|
||||
}
|
||||
|
||||
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement;
|
||||
|
||||
@@ -1840,22 +1845,30 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
|
||||
$classpath = 'fourn/class';
|
||||
$module='fournisseur';
|
||||
}
|
||||
if ($objecttype == 'order_supplier') {
|
||||
elseif ($objecttype == 'order_supplier') {
|
||||
$classfile = 'fournisseur.commande';
|
||||
$classname='CommandeFournisseur';
|
||||
$classpath = 'fourn/class';
|
||||
$module='fournisseur';
|
||||
}
|
||||
|
||||
elseif ($objecttype == 'stock') {
|
||||
$classpath = 'product/stock/class';
|
||||
$classfile='entrepot';
|
||||
$classname='Entrepot';
|
||||
}
|
||||
if (! empty($conf->$module->enabled))
|
||||
{
|
||||
$res=dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
|
||||
if ($res)
|
||||
{
|
||||
$object = new $classname($db);
|
||||
$res=$object->fetch($objectid);
|
||||
if ($res > 0) $ret=$object->getNomUrl($withpicto,$option);
|
||||
unset($object);
|
||||
if (class_exists($classname))
|
||||
{
|
||||
$object = new $classname($db);
|
||||
$res=$object->fetch($objectid);
|
||||
if ($res > 0) $ret=$object->getNomUrl($withpicto,$option);
|
||||
unset($object);
|
||||
}
|
||||
else dol_syslog("Class with classname ".$classname." is unknown even after the include", LOG_ERR);
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
|
||||
Reference in New Issue
Block a user