2
0
forked from Wavyzz/dolibarr

Work on inventory module

This commit is contained in:
Laurent Destailleur
2019-10-12 12:31:35 +02:00
parent dccfdad9dd
commit 9ba992b8b6
8 changed files with 93 additions and 44 deletions

View File

@@ -1820,69 +1820,76 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
$subelement = $regs[2];
}
// Generic case for $classpath
$classpath = $element.'/class';
// To work with non standard path
// Special cases, to work with non standard path
if ($objecttype == 'facture' || $objecttype == 'invoice') {
$classpath = 'compta/facture/class';
$module='facture';
$subelement='facture';
}
if ($objecttype == 'commande' || $objecttype == 'order') {
elseif ($objecttype == 'commande' || $objecttype == 'order') {
$classpath = 'commande/class';
$module='commande';
$subelement='commande';
}
if ($objecttype == 'propal') {
elseif ($objecttype == 'propal') {
$classpath = 'comm/propal/class';
}
if ($objecttype == 'supplier_proposal') {
elseif ($objecttype == 'supplier_proposal') {
$classpath = 'supplier_proposal/class';
}
if ($objecttype == 'shipping') {
elseif ($objecttype == 'shipping') {
$classpath = 'expedition/class';
$subelement = 'expedition';
$module = 'expedition_bon';
}
if ($objecttype == 'delivery') {
elseif ($objecttype == 'delivery') {
$classpath = 'livraison/class';
$subelement = 'livraison';
$module = 'livraison_bon';
}
if ($objecttype == 'contract') {
elseif ($objecttype == 'contract') {
$classpath = 'contrat/class';
$module='contrat';
$subelement='contrat';
}
if ($objecttype == 'member') {
elseif ($objecttype == 'member') {
$classpath = 'adherents/class';
$module='adherent';
$subelement='adherent';
}
if ($objecttype == 'cabinetmed_cons') {
elseif ($objecttype == 'cabinetmed_cons') {
$classpath = 'cabinetmed/class';
$module='cabinetmed';
$subelement='cabinetmedcons';
}
if ($objecttype == 'fichinter') {
elseif ($objecttype == 'fichinter') {
$classpath = 'fichinter/class';
$module='ficheinter';
$subelement='fichinter';
}
if ($objecttype == 'task') {
elseif ($objecttype == 'task') {
$classpath = 'projet/class';
$module='projet';
$subelement='task';
}
if ($objecttype == 'stock') {
elseif ($objecttype == 'stock') {
$classpath = 'product/stock/class';
$module='stock';
$subelement='stock';
}
elseif ($objecttype == 'inventory') {
$classpath = 'product/inventory/class';
$module='stock';
$subelement='inventory';
}
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement;
// Generic case for $classfile and $classname
$classfile = strtolower($subelement); $classname = ucfirst($subelement);
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement." classfile=".$classfile." classname=".$classname;
if ($objecttype == 'invoice_supplier') {
$classfile = 'fournisseur.facture';
$classname='FactureFournisseur';