Enhancement in ecm module
This commit is contained in:
parent
d4fdb23618
commit
f67962a049
@ -486,13 +486,17 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
|
|||||||
// Show tree graph pictos
|
// Show tree graph pictos
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
|
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
|
||||||
tree_showpad($fulltree,$key);
|
$resarray=tree_showpad($fulltree,$key);
|
||||||
|
$a=$resarray[0];
|
||||||
|
$b=$resarray[1];
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Show picto
|
// Show picto
|
||||||
print '<td valign="top">';
|
print '<td valign="top">';
|
||||||
//print $val['fullpath']."(".$showline.")";
|
//print $val['fullpath']."(".$showline.")";
|
||||||
if (! in_array($val['id'],$expandedsectionarray)) $ref=img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/plustop2.gif','',1);
|
$n='2';
|
||||||
else $ref=img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/minustop2.gif','',1);
|
if ($b == 0 || ! in_array($val['id'],$expandedsectionarray)) $n='3';
|
||||||
|
if (! in_array($val['id'],$expandedsectionarray)) $ref=img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/plustop'.$n.'.gif','',1);
|
||||||
|
else $ref=img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/minustop'.$n.'.gif','',1);
|
||||||
$oldref=$ecmdirstatic->ref;
|
$oldref=$ecmdirstatic->ref;
|
||||||
$ecmdirstatic->ref=$ref;
|
$ecmdirstatic->ref=$ref;
|
||||||
print $ecmdirstatic->getNomUrl(0,$option);
|
print $ecmdirstatic->getNomUrl(0,$option);
|
||||||
|
|||||||
@ -78,28 +78,34 @@ function is_in_subtree($fulltree,$parentid,$childid)
|
|||||||
*
|
*
|
||||||
* @param fulltree Array of entries in correct order
|
* @param fulltree Array of entries in correct order
|
||||||
* @param key Key of value to show picto
|
* @param key Key of value to show picto
|
||||||
* @return int 1
|
* @return array (0 or 1 if at least one of this level after, 0 or 1 if at least one of higher level after)
|
||||||
*/
|
*/
|
||||||
function tree_showpad(&$fulltree,$key,$selected=0)
|
function tree_showpad(&$fulltree,$key,$selected=0)
|
||||||
{
|
{
|
||||||
$pos=1;
|
$pos=1;
|
||||||
|
|
||||||
|
// Loop on each pos, because we will output an img for each pos
|
||||||
while ($pos <= $fulltree[$key]['level'] && $fulltree[$key]['level'] > 0)
|
while ($pos <= $fulltree[$key]['level'] && $fulltree[$key]['level'] > 0)
|
||||||
{
|
{
|
||||||
// Process picto for column $pos
|
// Process picto for column $pos
|
||||||
|
|
||||||
$atleastonofthislevelafter=0;
|
$atleastonofthislevelafter=0;
|
||||||
|
$nbofhigherlevelafter=0;
|
||||||
$found=0;
|
$found=0;
|
||||||
//print 'x'.$key;
|
//print 'x'.$key;
|
||||||
foreach($fulltree as $key2 => $val2)
|
foreach($fulltree as $key2 => $val2)
|
||||||
{
|
{
|
||||||
if ($found == 1)
|
if ($found == 1) // We are after the entry to show
|
||||||
{
|
{
|
||||||
|
if ($fulltree[$key2]['level'] > $pos)
|
||||||
|
{
|
||||||
|
$nbofhigherlevelafter++;
|
||||||
|
}
|
||||||
if ($fulltree[$key2]['level'] == $pos)
|
if ($fulltree[$key2]['level'] == $pos)
|
||||||
{
|
{
|
||||||
$atleastonofthislevelafter=1;
|
$atleastonofthislevelafter=1;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if ($fulltree[$key2]['level'] < $pos)
|
if ($fulltree[$key2]['level'] <= $pos)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -121,7 +127,7 @@ function tree_showpad(&$fulltree,$key,$selected=0)
|
|||||||
$pos++;
|
$pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return array($atleastonofthislevelafter,$nbofhigherlevelafter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user