mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Warehouse list display mode (#31013)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
5c43f600ef
commit
fdb885f0a3
|
|
@ -235,7 +235,10 @@ class FormProduct
|
|||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Return full path to current warehouse in $tab (recursive function)
|
||||
*
|
||||
* Set Hidden conf MAIN_WAREHOUSE_LIST_DISPLAY_MODE at 0 || 1 || 2 to unlock display
|
||||
* 0 : Default behavior, display parents of warehouse
|
||||
* 1 : Display only current warehouse label only
|
||||
* 2 : Display last parent warehouse label
|
||||
* @param array $tab warehouse data in $this->cache_warehouses line
|
||||
* @param string $final_label full label with all parents, separated by ' >> ' (completed on each call)
|
||||
* @return string full label with all parents, separated by ' >> '
|
||||
|
|
@ -247,11 +250,14 @@ class FormProduct
|
|||
$final_label = $tab['label'];
|
||||
}
|
||||
|
||||
if (empty($tab['parent_id'])) {
|
||||
if (empty($tab['parent_id']) || getDolGlobalInt('MAIN_WAREHOUSE_LIST_DISPLAY_MODE') === 1) {
|
||||
return $final_label;
|
||||
} else {
|
||||
if (!empty($this->cache_warehouses[$tab['parent_id']])) {
|
||||
$final_label = $this->cache_warehouses[$tab['parent_id']]['label'].' >> '.$final_label;
|
||||
if (getDolGlobalInt('MAIN_WAREHOUSE_LIST_DISPLAY_MODE') !== 2 || (getDolGlobalInt('MAIN_WAREHOUSE_LIST_DISPLAY_MODE') === 2 && empty($this->cache_warehouses[$tab['parent_id']]['parent_id']))) {
|
||||
$final_label = $this->cache_warehouses[$tab['parent_id']]['label'] . ' >> ' . $final_label;
|
||||
}
|
||||
|
||||
return $this->get_parent_path($this->cache_warehouses[$tab['parent_id']], $final_label);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user