FIX The substitution variable array was not complete
This commit is contained in:
parent
2ad483413e
commit
0636682e91
@ -52,6 +52,8 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout
|
|||||||
$menuArbo = new Menubase($db, 'auguria');
|
$menuArbo = new Menubase($db, 'auguria');
|
||||||
$newTabMenu = $menuArbo->menuTopCharger('', '', $type_user, 'auguria', $tabMenu);
|
$newTabMenu = $menuArbo->menuTopCharger('', '', $type_user, 'auguria', $tabMenu);
|
||||||
|
|
||||||
|
$substitarray = getCommonSubstitutionArray($langs, 0, null, null);
|
||||||
|
|
||||||
if (empty($noout)) print_start_menu_array_auguria();
|
if (empty($noout)) print_start_menu_array_auguria();
|
||||||
|
|
||||||
global $usemenuhider;
|
global $usemenuhider;
|
||||||
@ -75,8 +77,6 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout
|
|||||||
$showmode=dol_auguria_showmenu($type_user, $newTabMenu[$i], $listofmodulesforexternal);
|
$showmode=dol_auguria_showmenu($type_user, $newTabMenu[$i], $listofmodulesforexternal);
|
||||||
if ($showmode == 1)
|
if ($showmode == 1)
|
||||||
{
|
{
|
||||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
|
||||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
|
||||||
$newTabMenu[$i]['url'] = make_substitutions($newTabMenu[$i]['url'], $substitarray);
|
$newTabMenu[$i]['url'] = make_substitutions($newTabMenu[$i]['url'], $substitarray);
|
||||||
|
|
||||||
$url = $shorturl = $newTabMenu[$i]['url'];
|
$url = $shorturl = $newTabMenu[$i]['url'];
|
||||||
@ -314,6 +314,8 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
|
|||||||
print "<!-- End Bookmarks -->\n";
|
print "<!-- End Bookmarks -->\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$substitarray = getCommonSubstitutionArray($langs, 0, null, null);
|
||||||
|
|
||||||
// We update newmenu with entries found into database
|
// We update newmenu with entries found into database
|
||||||
$menuArbo = new Menubase($db, 'auguria');
|
$menuArbo = new Menubase($db, 'auguria');
|
||||||
$newmenu = $menuArbo->menuLeftCharger($newmenu, $mainmenu, $leftmenu, ($user->socid?1:0), 'auguria', $tabMenu);
|
$newmenu = $menuArbo->menuLeftCharger($newmenu, $mainmenu, $leftmenu, ($user->socid?1:0), 'auguria', $tabMenu);
|
||||||
@ -512,8 +514,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
|
|||||||
}
|
}
|
||||||
|
|
||||||
// $menu_array[$i]['url'] can be a relative url, a full external url. We try substitution
|
// $menu_array[$i]['url'] can be a relative url, a full external url. We try substitution
|
||||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
|
||||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
|
||||||
$menu_array[$i]['url'] = make_substitutions($menu_array[$i]['url'], $substitarray);
|
$menu_array[$i]['url'] = make_substitutions($menu_array[$i]['url'], $substitarray);
|
||||||
|
|
||||||
$url = $shorturl = $shorturlwithoutparam = $menu_array[$i]['url'];
|
$url = $shorturl = $shorturlwithoutparam = $menu_array[$i]['url'];
|
||||||
|
|||||||
@ -52,6 +52,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
|||||||
$id = 'mainmenu';
|
$id = 'mainmenu';
|
||||||
$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
||||||
|
|
||||||
|
$substitarray = getCommonSubstitutionArray($langs, 0, null, null);
|
||||||
|
|
||||||
if (empty($noout)) print_start_menu_array();
|
if (empty($noout)) print_start_menu_array();
|
||||||
|
|
||||||
$usemenuhider = 1;
|
$usemenuhider = 1;
|
||||||
@ -448,8 +450,6 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
|||||||
$showmode = isVisibleToUserType($type_user, $newTabMenu[$i], $listofmodulesforexternal);
|
$showmode = isVisibleToUserType($type_user, $newTabMenu[$i], $listofmodulesforexternal);
|
||||||
if ($showmode == 1)
|
if ($showmode == 1)
|
||||||
{
|
{
|
||||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
|
||||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
|
||||||
$newTabMenu[$i]['url'] = make_substitutions($newTabMenu[$i]['url'], $substitarray);
|
$newTabMenu[$i]['url'] = make_substitutions($newTabMenu[$i]['url'], $substitarray);
|
||||||
|
|
||||||
// url = url from host, shorturl = relative path into dolibarr sources
|
// url = url from host, shorturl = relative path into dolibarr sources
|
||||||
@ -679,6 +679,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
print "<!-- End Bookmarks -->\n";
|
print "<!-- End Bookmarks -->\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$substitarray = getCommonSubstitutionArray($langs, 0, null, null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We update newmenu with entries found into database
|
* We update newmenu with entries found into database
|
||||||
* --------------------------------------------------
|
* --------------------------------------------------
|
||||||
@ -1982,8 +1984,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
}
|
}
|
||||||
|
|
||||||
// $menu_array[$i]['url'] can be a relative url, a full external url. We try substitution
|
// $menu_array[$i]['url'] can be a relative url, a full external url. We try substitution
|
||||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
|
||||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
|
||||||
$menu_array[$i]['url'] = make_substitutions($menu_array[$i]['url'], $substitarray);
|
$menu_array[$i]['url'] = make_substitutions($menu_array[$i]['url'], $substitarray);
|
||||||
|
|
||||||
$url = $shorturl = $shorturlwithoutparam = $menu_array[$i]['url'];
|
$url = $shorturl = $shorturlwithoutparam = $menu_array[$i]['url'];
|
||||||
|
|||||||
@ -146,6 +146,7 @@ class MenuManager
|
|||||||
|
|
||||||
$this->menu->add('/index.php', $langs->trans("Home"), 0, $showmode, $this->atarget, 'home', '', 10, $id, $idsel, $classname);
|
$this->menu->add('/index.php', $langs->trans("Home"), 0, $showmode, $this->atarget, 'home', '', 10, $id, $idsel, $classname);
|
||||||
|
|
||||||
|
$substitarray = getCommonSubstitutionArray($langs, 0, null, null);
|
||||||
|
|
||||||
// $this->menu->liste is top menu
|
// $this->menu->liste is top menu
|
||||||
//var_dump($this->menu->liste);exit;
|
//var_dump($this->menu->liste);exit;
|
||||||
@ -156,8 +157,6 @@ class MenuManager
|
|||||||
print '<ul class="ulmenu" data-inset="true">';
|
print '<ul class="ulmenu" data-inset="true">';
|
||||||
print '<li class="lilevel0">';
|
print '<li class="lilevel0">';
|
||||||
|
|
||||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
|
||||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
|
||||||
$val['url'] = make_substitutions($val['url'], $substitarray);
|
$val['url'] = make_substitutions($val['url'], $substitarray);
|
||||||
|
|
||||||
if ($val['enabled'] == 1)
|
if ($val['enabled'] == 1)
|
||||||
@ -257,8 +256,6 @@ class MenuManager
|
|||||||
|
|
||||||
if ($showmenu) // Visible (option to hide when not allowed is off or allowed)
|
if ($showmenu) // Visible (option to hide when not allowed is off or allowed)
|
||||||
{
|
{
|
||||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
|
||||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
|
||||||
$val2['url'] = make_substitutions($val2['url'], $substitarray);
|
$val2['url'] = make_substitutions($val2['url'], $substitarray);
|
||||||
|
|
||||||
$relurl2 = dol_buildpath($val2['url'], 1);
|
$relurl2 = dol_buildpath($val2['url'], 1);
|
||||||
@ -453,13 +450,13 @@ class MenuManager
|
|||||||
/*
|
/*
|
||||||
if ($mode == 'jmobile')
|
if ($mode == 'jmobile')
|
||||||
{
|
{
|
||||||
|
$substitarray = getCommonSubstitutionArray($langs, 0, null, null);
|
||||||
|
|
||||||
foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||||
{
|
{
|
||||||
print '<ul class="ulmenu" data-inset="true">';
|
print '<ul class="ulmenu" data-inset="true">';
|
||||||
print '<li class="lilevel0">';
|
print '<li class="lilevel0">';
|
||||||
|
|
||||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
|
||||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
|
||||||
$val['url'] = make_substitutions($val['url'], $substitarray);
|
$val['url'] = make_substitutions($val['url'], $substitarray);
|
||||||
|
|
||||||
if ($val['enabled'] == 1)
|
if ($val['enabled'] == 1)
|
||||||
@ -487,8 +484,6 @@ class MenuManager
|
|||||||
}
|
}
|
||||||
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||||
{
|
{
|
||||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
|
||||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
|
||||||
$val2['url'] = make_substitutions($val2['url'], $substitarray);
|
$val2['url'] = make_substitutions($val2['url'], $substitarray);
|
||||||
|
|
||||||
$relurl2=dol_buildpath($val2['url'],1);
|
$relurl2=dol_buildpath($val2['url'],1);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user