diff --git a/ChangeLog b/ChangeLog
index bf58724de367aeabb488ff0d8ebe6b9743bf7098..f1a44ef58e03c90478e1e6775fc9caed2237a1ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,15 +6,27 @@ English Dolibarr ChangeLog
 For users:
 - New: Some performance enhancements.
 - New: Can attach files onto trip and expenses modules.
-- New: Add option MAIN_PDF_TITLE_BACKGROUND_COLOR
-- New: Can define a hierarchical responsible on user
-- New: Merge tab customer and prospect
-- New: Add ES formated address country rule
-
+- New: Add option MAIN_PDF_TITLE_BACKGROUND_COLOR.
+- New: Merge tab customer and prospect.
+- New: Add ES formated address country rule.
+- New: Can define a hierarchical responsible on user.
+- New: Add a hierarchical view for users.
+- New: Can expand/collapse menus, categories and users list.
+- New: extra parameters are supported into ODT templates.
+- New: total per vat rate are available as tags for ODT templates.
+- New: Add more types for extra parameters (lists, phone, emails, checkbox, prices)
+- New: Some part of interface use more CSS3 (ie: agenda)
+  
 For developers:
 - System of menu managers has been rewritten to reduce code to do same things. 
 - An external module can force its theme.
 - Add function dol_set_focus('#xxx').
+- A mymodule can bring its own core/modules/mymodule/modules_mymodule.php file.
+- Removed not used libraries.
+- More web services. 
+- Renamed some french fields into english.
+- First change to manage margins on contracts.
+- Add hook getFormMail.
 
 For translators:
 - Update language files.
diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php
index 1fd5365e27208d6328c3fc69e24657133ff25242..5a042a656793c1d1088cd94af7a05a1795703cb9 100644
--- a/htdocs/admin/menus/index.php
+++ b/htdocs/admin/menus/index.php
@@ -209,8 +209,8 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes')
 $form=new Form($db);
 $formadmin=new FormAdmin($db);
 
-$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js?lang='.$langs->defaultlang);
-$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css?lang='.$langs->defaultlang);
+$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
+$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
 
 llxHeader('',$langs->trans("Menus"),'','',0,0,$arrayofjs,$arrayofcss);
 
@@ -271,10 +271,12 @@ print '<table class="border" width="100%">';
 
 print '<tr class="liste_titre">';
 print '<td>'.$langs->trans("TreeMenuPersonalized").'</td>';
+print '<td align="right"><div id="iddivjstreecontrol"><a href="#">'.img_picto('','object_category').' '.$langs->trans("UndoExpandAll").'</a>';
+print ' | <a href="#">'.img_picto('','object_category-expanded').' '.$langs->trans("ExpandAll").'</a></div></td>';
 print '</tr>';
 
 print '<tr>';
-print '<td>';
+print '<td colspan="2">';
 
 // ARBORESCENCE
 
@@ -316,7 +318,23 @@ if ($conf->use_javascript_ajax)
 		{
 			if (! empty($menu['langs'])) $langs->load($menu['langs']);
 			$titre = $langs->trans($menu['titre']);
-			$data[] = array('rowid'=>$menu['rowid'],'fk_menu'=>$menu['fk_menu'],'title'=>$titre,'mainmenu'=>$menu['mainmenu'],'leftmenu'=>$menu['leftmenu'],'fk_mainmenu'=>$menu['fk_mainmenu'],'fk_leftmenu'=>$menu['fk_leftmenu']);
+			$data[] = array(
+				'rowid'=>$menu['rowid'],
+				'fk_menu'=>$menu['fk_menu'],
+				'title'=>$titre,
+				'mainmenu'=>$menu['mainmenu'],
+				'leftmenu'=>$menu['leftmenu'],
+				'fk_mainmenu'=>$menu['fk_mainmenu'],
+				'fk_leftmenu'=>$menu['fk_leftmenu'],
+				'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.
+						'<strong> &nbsp; <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.$titre.'</a></strong>'.
+						'</td><td align="right">'.
+						'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> '.
+						'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default',0,'class="menuNew" id="new'.$menu['rowid'].'"').'</a> '.
+						'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default',0,'class="menuDel" id="del'.$menu['rowid'].'"').'</a> '.
+						'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Monter","1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Descendre","1downarrow").'</a>'.
+						'</td></tr></table>'
+			);
 			$i++;
 		}
 	}
diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php
index c9102fdaa178ad93b27e955874249de595a61807..520619580a91781a6ef723823f270b64024dd713 100644
--- a/htdocs/categories/index.php
+++ b/htdocs/categories/index.php
@@ -52,7 +52,11 @@ elseif ($type == 2) $title=$langs->trans("CustomersCategoriesArea");
 elseif ($type == 3) $title=$langs->trans("MembersCategoriesArea");
 else $title=$langs->trans("CategoriesArea");
 
-llxHeader("","",$title);
+$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
+$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
+
+llxHeader('',$title,'','',0,0,$arrayofjs,$arrayofcss);
+
 
 print_fiche_titre($title);
 
@@ -128,187 +132,56 @@ $cate_arbo = $categstatic->get_full_arbo($type);
 // Define fulltree array
 $fulltree=$cate_arbo;
 
-print '<table class="liste" width="100%">';
-print '<tr class="liste_titre"><td>'.$langs->trans("Categories").'</td><td colspan="3">'.$langs->trans("Description").'</td></tr>';
-
-
-// ----- This section will show a tree from a fulltree array -----
-// $section must also be defined
-// ---------------------------------------------------------------
-
-
-// Root title line
-print '<tr><td>';
-print '<table class="nobordernopadding"><tr class="nobordernopadding">';
-print '<td align="left" width="24">';
-print img_picto_common('','treemenu/base.gif');
-print '</td><td align="left">'.$langs->trans("AllCats");
-print '</td>';
-print '</tr></table></td>';
-print '<td align="right">&nbsp;</td>';
-print '<td align="right">&nbsp;</td>';
-//print '<td align="right">&nbsp;</td>';
-print '</tr>';
-
-
-
-// Define fullpathselected ( _x_y_z ) of $section parameter
-$fullpathselected='';
-if (! empty($section))
-{
-	foreach($fulltree as $key => $val)
-	{
-		//print $val['id']."-".$section."<br>";
-		if ($val['id'] == $section)
-		{
-			$fullpathselected=$val['fullpath'];
-			break;
-		}
-	}
-}
-//print "fullpathselected=".$fullpathselected."<br>";
-
-// Update expandedsectionarray in session
-$expandedsectionarray=array();
-if (isset($_SESSION['dol_catexpandedsectionarray'.$type])) $expandedsectionarray=explode(',',$_SESSION['dol_catexpandedsectionarray'.$type]);
-
-if (! empty($section) && $_GET['sectionexpand'] == 'true')
-{
-	// We add all sections that are parent of opened section
-	$pathtosection=explode('_',$fullpathselected);
-	foreach($pathtosection as $idcursor)
-	{
-		if ($idcursor && ! in_array($idcursor,$expandedsectionarray))	// Not already in array
-		{
-			$expandedsectionarray[]=$idcursor;
-		}
-	}
-	$_SESSION['dol_catexpandedsectionarray'.$type]=join(',',$expandedsectionarray);
-}
-if (! empty($section) && $_GET['sectionexpand'] == 'false')
-{
-	// We removed all expanded sections that are child of the closed section
-	$oldexpandedsectionarray=$expandedsectionarray;
-	$expandedsectionarray=array();
-	foreach($oldexpandedsectionarray as $sectioncursor)
-	{
-		// is_in_subtree(fulltree,sectionparent,sectionchild)
-		if ($sectioncursor && ! is_in_subtree($fulltree,$section,$sectioncursor)) $expandedsectionarray[]=$sectioncursor;
-	}
-	$_SESSION['dol_catexpandedsectionarray'.$type]=join(',',$expandedsectionarray);
-}
-//print $_SESSION['dol_catexpandedsectionarray'.$type].'<br>';
-
-$nbofentries=0;
-$oldvallevel=0;
-$var=true;
-foreach($fulltree as $key => $val)
+// Define data (format for treeview)
+$data=array();
+$data[] = array('rowid'=>0,'fk_menu'=>-1,'title'=>"racine",'mainmenu'=>'','leftmenu'=>'','fk_mainmenu'=>'','fk_leftmenu'=>'');
+foreach($fulltree as $key => $val)
 {
-	//$fullpathparent=preg_replace('/_[^_]+$/i','',$val['fullpath']);
+	$categstatic->id=$val['id'];
+	$categstatic->ref=$val['label'];
+	$categstatic->type=$type;
+	$li=$categstatic->getNomUrl(1,'',60);
+
+	$data[] = array(
+	'rowid'=>$val['rowid'],
+	'fk_menu'=>$val['fk_parent'],
+	'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.$li.
+	'</td><td width="50%">'.
+	' '.$val['description'].'</td>'.
+	'<td align="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td>'.
+	'</tr></table>'
+	);
+}
 
-	// Define showline
-	$showline=0;
-
-	//var_dump($expandedsectionarray);
-
-	// If directory is son of expanded directory, we show line
-	if (isset($val['fk_parent']) && in_array($val['fk_parent'],$expandedsectionarray)) $showline=4;
-	// If directory is parent of selected directory or is selected directory, we show line
-	elseif (preg_match('/'.$val['fullpath'].'_/i',$fullpathselected.'_')) $showline=2;
-	// If we are level one we show line
-	elseif ($val['level'] < 2) $showline=1;
-	//print 'xxx '.$val['level'].' - '.$fullpathselected.' - '.$val['fullpath'].' - '.$val['fk_parent'].' showline='.$showline.'<br>'."\n";
-
-	if ($showline)
-	{
-        $var=!$var;
-
-	    if (in_array($val['id'],$expandedsectionarray)) $option='indexexpanded';
-		else $option='indexnotexpanded';
-		//print $option;
-
-        print "<tr ".$bc[$var].">";
-
-		// Show tree graph pictos
-		print '<td align="left">';
-		print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
-		$resarray=tree_showpad($fulltree,$key);
-		$a=$resarray[0];
-		$nbofsubdir=$resarray[1];
-		$nboffilesinsubdir=$resarray[2];
-		print '</td>';
-
-		// Show picto
-		print '<td valign="top">';
-		//print $val['fullpath']."(".$showline.")";
-		$n='2';
-		if (! 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);
-		if ($option == 'indexexpanded') $lien = '<a href="'.$_SERVER["PHP_SELF"].'?section='.$val['id'].'&amp;type='.$type.'&amp;sectionexpand=false">';
-    	if ($option == 'indexnotexpanded') $lien = '<a href="'.$_SERVER["PHP_SELF"].'?section='.$val['id'].'&amp;type='.$type.'&amp;sectionexpand=true">';
-    	$newref=str_replace('_',' ',$ref);
-    	$lienfin='</a>';
-    	print $lien.$newref.$lienfin;
-		if (! in_array($val['id'],$expandedsectionarray)) print img_picto('','object_category');
-		else print img_picto('','object_category-expanded');
-		print '</td>';
-		// Show link
-		print '<td valign="middle">';
-		//if ($section == $val['id']) print ' <u>';
-		// We don't want a link ... why ?
-		$categstatic->id=$val['id'];
-		$categstatic->ref=$val['label'];
-		$categstatic->type=$type;
-		print ' &nbsp;'.$categstatic->getNomUrl(0,'',60);
-
-		//print ' &nbsp;'.dol_trunc($val['label'],28);
-		//if ($section == $val['id']) print '</u>';
-		print '</td>';
-		print '</tr></table>';
-		print "</td>\n";
 
-		// Description
-		print '<td>';
-		print dol_trunc($val['description'],48);
-		print '</td>';
-
-		// Link to category card
-		print '<td align="right"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td>';
-
-		// Add link
-		//print '<td align="right"><a href="'.DOL_URL_ROOT.'/ecm/docdir.php?action=create&amp;catParent='.$val['id'].'">'.img_edit_add().'</a></td>';
-		//print '<td align="right">&nbsp;</td>';
-
-		print "</tr>\n";
-	}
-
-	$oldvallevel=$val['level'];
-	$nbofentries++;
-}
+print '<table class="liste" width="100%">';
+print '<tr class="liste_titre"><td>'.$langs->trans("Categories").'</td><td>'.$langs->trans("Description").'</td><td align="right"><div id="iddivjstreecontrol"><a href="#">'.img_picto('','object_category').' '.$langs->trans("UndoExpandAll").'</a>';
+print ' | <a href="#">'.img_picto('','object_category-expanded').' '.$langs->trans("ExpandAll").'</a></div></td></tr>';
 
+$nbofentries=(count($data) - 1);
 
-// If nothing to show
-if ($nbofentries == 0)
+if ($nbofentries > 0)
 {
-	print '<tr>';
-	print '<td class="left"><table class="nobordernopadding"><tr class="nobordernopadding"><td>'.img_picto_common('','treemenu/branchbottom.gif').'</td>';
-	print '<td>'.img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/minustop3.gif','',1).'</td>';
-	print '<td valign="middle">';
-	print $langs->trans("NoCategoryYet");
-	print '</td>';
-	print '<td>&nbsp;</td>';
-	print '</table></td>';
-	print '<td colspan="4">&nbsp;</td>';
-	print '</tr>';
+	print '<tr><td colspan="3">';
+	tree_recur($data,$data[0],0);
+	print '</td></tr>';
 }
-
-// ----- End of section -----
-// --------------------------
+else
+{
+	print '<tr>';
+	print '<td colspan="3"><table class="nobordernopadding"><tr class="nobordernopadding"><td>'.img_picto_common('','treemenu/branchbottom.gif').'</td>';
+	print '<td valign="middle">';
+	print $langs->trans("NoCategoryYet");
+	print '</td>';
+	print '<td>&nbsp;</td>';
+	print '</table></td>';
+	print '</tr>';
+}
 
 print "</table>";
 
 
 llxFooter();
+
 $db->close();
 ?>
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 2dc15e536a13fde44ac99c66e1da72aa2865a8cf..de55231f10102dbaf2f710e0c373875bec39820b 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -88,6 +88,7 @@ if (GETPOST('viewday'))  {
     $action='show_day'; $day=($day?$day:date("d"));
 }                                  // View by day
 
+$langs->load("agenda");
 $langs->load("other");
 $langs->load("commercial");
 
diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php
index 60597db8c590dc6e976de9cdc45bafbb2f263d8a..9d82fb21ab940280bd06328748fb91de832ddd31 100644
--- a/htdocs/comm/action/rapport/index.php
+++ b/htdocs/comm/action/rapport/index.php
@@ -30,7 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
 require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
 require_once DOL_DOCUMENT_ROOT.'/core/modules/action/rapport.pdf.php';
 
-$langs->load("commercial");
+$langs->load("agenda");
+$langs->load("commercial");
 
 $action=GETPOST('action','alpha');
 $month=GETPOST('month');
@@ -103,7 +104,7 @@ if ($resql)
 	print '<tr class="liste_titre">';
 	print '<td>'.$langs->trans("Date").'</td>';
 	print '<td align="center">'.$langs->trans("EventsNb").'</td>';
-	print '<td>'.$langs->trans("Action").'</td>';
+	print '<td align="center">'.$langs->trans("Action").'</td>';
 	print '<td align="center">'.$langs->trans("PDF").'</td>';
 	print '<td align="center">'.$langs->trans("Date").'</td>';
 	print '<td align="center">'.$langs->trans("Size").'</td>';
@@ -121,7 +122,7 @@ if ($resql)
 			print "<td>".$obj->df."</td>\n";
 			print '<td align="center">'.$obj->cc.'</td>';
 
-			print '<td>';
+			print '<td align="center">';
 			print '<a href="'.$_SERVER["PHP_SELF"].'?action=builddoc&amp;page='.$page.'&amp;month='.$obj->month.'&amp;year='.$obj->year.'">'.img_picto($langs->trans('GenerateReport'),'filenew').'</a>';
 			print '</td>';
 
diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php
index 7f8ed742fc6ce7e76737f224bf726057b6d41ccb..f565467575ee41edc9a8a833fc45b2e803fca04c 100644
--- a/htdocs/core/lib/treeview.lib.php
+++ b/htdocs/core/lib/treeview.lib.php
@@ -23,55 +23,7 @@
  */
 
 
-// ------------------------------- Used by category tree view -----------------
-
-/**
- * Return if a child id is in descendance of parentid
- *
- * @param	array	 $fulltree		Full tree. Tree must be an array of records that looks like:
- *									id = id record
- *									id_mere = id record mother
- *									id_children = array of direct child id
- *									label = record label
- * 									fullpath = Full path of id
- * 									level =	Level of record
- * @param	int		$parentid		Parent id
- * @param	int		$childid		Child id
- * @return	int						1=Yes, 0=No
- */
-function is_in_subtree($fulltree,$parentid,$childid)
-{
-	if ($parentid == $childid) return 1;
-
-	// Get fullpath of parent
-	$fullpathparent='';
-	foreach($fulltree as $key => $val)
-	{
-		//print $val['id']."-".$section."<br>";
-		if ($val['id'] == $parentid)
-		{
-			$fullpathparent=$val['fullpath'];
-			break;
-		}
-	}
-	//print '> parent='.$parentid.' - child='.$childid.' - '.$fullpathparent.'<br>';
-
-	foreach($fulltree as $record)
-	{
-		if ($record['id'] == $childid)
-		{
-			//print $record['fullpath'].'_'.' - '.$fullpathparent.'_';
-			if (preg_match('/'.$fullpathparent.'_/i',$record['fullpath'].'_'))
-			{
-				//print 'DEL='.$childid;
-				return 1;
-			}
-		}
-	}
-
-	return 0;
-}
-
+// ------------------------------- Used by ajax tree view -----------------
 
 /**
  * Show indent and picto of a tree line. Return array with information of line.
@@ -145,55 +97,38 @@ function tree_showpad(&$fulltree,$key,$silent=0)
 // ------------------------------- Used by menu editor -----------------
 
 /**
- *  Show an element with correct offset
- *
- *  @param	array	$tab    	Array of element
- *  @param  int	    $rang   	Level of offset
- *  @return	void
- */
-function tree_showline($tab,$rang)
-{
-	global $conf, $rangLast, $idLast, $menu_handler;
-
-	// Content of line
-	print '<table class="nobordernopadding centpercent"><tr><td>';
-	print '<strong> &nbsp; <a href="edit.php?menu_handler='.$menu_handler.'&action=edit&menuId='.$tab['rowid'].'">'.$tab['title'].'</a></strong>';
-	print '</td><td align="right">';
-	print '<a href="edit.php?menu_handler='.$menu_handler.'&action=edit&menuId='.$tab['rowid'].'">'.img_edit('default',0,'class="menuEdit" id="edit'.$tab['rowid'].'"').'</a> ';
-	print '<a href="edit.php?menu_handler='.$menu_handler.'&action=create&menuId='.$tab['rowid'].'">'.img_edit_add('default',0,'class="menuNew" id="new'.$tab['rowid'].'"').'</a> ';
-	print '<a href="index.php?menu_handler='.$menu_handler.'&action=delete&menuId='.$tab['rowid'].'">'.img_delete('default',0,'class="menuDel" id="del'.$tab['rowid'].'"').'</a> ';
-	print '<a href="index.php?menu_handler='.$menu_handler.'&action=up&menuId='.$tab['rowid'].'">'.img_picto("Monter","1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler.'&action=down&menuId='.$tab['rowid'].'">'.img_picto("Descendre","1downarrow").'</a>';
-	print '</td></tr></table>';
-
-	$rangLast = $rang;
-	$idLast = $tab['rowid'];
-}
-
-
-/**
- *  Recursive function to output menu tree
+ *  Recursive function to output menu tree. <ul id="iddivjstree"><li>...</li></ul>
+ *  Note: To have this function working, check you have loaded the js and css for treeview.
+ *  $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
+ *                   '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
+ *	$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
  *
- *  @param	array	$tab    Array of all elements
- *  @param  int	    $pere   Array with parent ids ('rowid'=>,'mainmenu'=>,'leftmenu'=>,'fk_mainmenu=>,'fk_leftmenu=>)
- *  @param  int	    $rang   Level of element
+ *  @param	array	$tab    		Array of all elements
+ *  @param  int	    $pere   		Array with parent ids ('rowid'=>,'mainmenu'=>,'leftmenu'=>,'fk_mainmenu=>,'fk_leftmenu=>)
+ *  @param  int	    $rang   		Level of element
+ *  @param	string	$iddivjstree	Id to use for parent ul element
  *  @return	void
  */
-function tree_recur($tab,$pere,$rang)
+function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree')
 {
-	if (empty($pere['rowid'])) 
+	if (empty($pere['rowid']))
 	{
-		// Test also done with jstree and dynatree (not able to have <a> inside label) 
+		// Test also done with jstree and dynatree (not able to have <a> inside label)
 		print '<script type="text/javascript" language="javascript">
 		$(document).ready(function(){
-			$("#iddivjstree").treeview({
+			$("#'.$iddivjstree.'").treeview({
 				collapsed: true,
 				animated: "fast",
-				persist: "location"
+				persist: "cookie",
+				control: "#'.$iddivjstree.'control",
+				toggle: function() {
+					/* window.console && console.log("%o was toggled", this); */
+				}
 			});
 		})
 		</script>';
-		
-		print '<ul id="iddivjstree" style="min-height:300px;">';
+
+		print '<ul id="'.$iddivjstree.'">';
 	}
 
 	if ($rang > 10)	return;	// Protection contre boucle infinie
@@ -207,29 +142,25 @@ function tree_recur($tab,$pere,$rang)
 		// If an element has $pere for parent
 		if ($tab[$x]['fk_menu'] != -1 && $tab[$x]['fk_menu'] == $pere['rowid'])
 		{
-			if (empty($ulprinted) && ! empty($pere['rowid'])) { print '<ul'.(empty($pere['rowid'])?' id="treeData"':'').'>'; $ulprinted++; } 
+			if (empty($ulprinted) && ! empty($pere['rowid'])) { print '<ul'.(empty($pere['rowid'])?' id="treeData"':'').'>'; $ulprinted++; }
 			print "\n".'<li>';
-			// We shot it with an offset
-			tree_showline($tab[$x],$rang);
-
+			print $tab[$x]['entry'];
 			// And now we search all its sons of lower level
 			tree_recur($tab,$tab[$x],$rang+1);
 			print '</li>';
 		}
 		elseif (! empty($tab[$x]['rowid']) && $tab[$x]['fk_menu'] == -1 && $tab[$x]['fk_mainmenu'] == $pere['mainmenu'] && $tab[$x]['fk_leftmenu'] == $pere['leftmenu'])
 		{
-			if (empty($ulprinted) && ! empty($pere['rowid'])) { print '<ul'.(empty($pere['rowid'])?' id="treeData"':'').'>'; $ulprinted++; } 
+			if (empty($ulprinted) && ! empty($pere['rowid'])) { print '<ul'.(empty($pere['rowid'])?' id="treeData"':'').'>'; $ulprinted++; }
 			print "\n".'<li>';
-			// We shot it with an offset
-			tree_showline($tab[$x],$rang);
-
+			print $tab[$x]['entry'];
 			// And now we search all its sons of lower level
 			tree_recur($tab,$tab[$x],$rang+1);
 			print '</li>';
 		}
 	}
 	if (! empty($ulprinted) && ! empty($pere['rowid'])) { print '</ul>'."\n"; }
-	
+
 	if (empty($pere['rowid'])) print '</ul>';
 }
 
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/ajax-loader.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/ajax-loader.gif
new file mode 100644
index 0000000000000000000000000000000000000000..bc545850add6bc46ed3eca7b55445c4a99362a7c
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/ajax-loader.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/file.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/file.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7e6216798f8e5abfc81a2fe2e5cb32b7a2d82e10
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/file.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/folder-closed.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/folder-closed.gif
new file mode 100644
index 0000000000000000000000000000000000000000..541107888e6739a7b367ad3d208e1efa933f877d
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/folder-closed.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/folder.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/folder.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2b31631ca2bfec3a8afb1bfdd4f8ed4c5bcc3a18
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/folder.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/minus.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/minus.gif
new file mode 100644
index 0000000000000000000000000000000000000000..47fb7b767c4e4659c2b42130a2dd7f46dd9a74eb
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/minus.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/plus.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/plus.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6906621627d48e3008a71dd6de6e4f9763da59f9
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/plus.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-black-line.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-black-line.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e5496877a07487f2f7437a9f87e07c590b51160a
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-black-line.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-black.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-black.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d549b9fc56ced0c90bb7ed01c77be78b67fd8d67
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-black.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-default-line.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-default-line.gif
new file mode 100644
index 0000000000000000000000000000000000000000..37114d3068e0a787dd44a39430a8fc44d1963dcf
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-default-line.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-default.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-default.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a12ac52ffe4d085657aaf45db3cf5717c751230c
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-default.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-famfamfam-line.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-famfamfam-line.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6e289cecc51b59a01c1278ce95653badf4e643de
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-famfamfam-line.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-famfamfam.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-famfamfam.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0cb178e89925dde14c2ea46ede7ed0152d6fde00
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-famfamfam.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-gray-line.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-gray-line.gif
new file mode 100644
index 0000000000000000000000000000000000000000..37600447dc002bbc0dd16e1391b711360aae2e34
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-gray-line.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-gray.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-gray.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cfb8a2f0961b880d9ecc9e59f831d0c0bf9d06db
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-gray.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-red-line.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-red-line.gif
new file mode 100644
index 0000000000000000000000000000000000000000..df9e749a8f1f58862588efc64988003efad01d51
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-red-line.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-red.gif b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-red.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3bbb3a157f1568d59d6db02b55a3b3fe9a1ff7a7
Binary files /dev/null and b/htdocs/includes/jquery/plugins/jquerytreeview/images/treeview-red.gif differ
diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js b/htdocs/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js
new file mode 100644
index 0000000000000000000000000000000000000000..8e8e1d9e01fc4477e1005dc73670b1dfafd1d49a
--- /dev/null
+++ b/htdocs/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js
@@ -0,0 +1,92 @@
+/**
+ * Cookie plugin
+ *
+ * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ */
+
+/**
+ * Create a cookie with the given name and value and other optional parameters.
+ *
+ * @example $.cookie('the_cookie', 'the_value');
+ * @desc Set the value of a cookie.
+ * @example $.cookie('the_cookie', 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true});
+ * @desc Create a cookie with all available options.
+ * @example $.cookie('the_cookie', 'the_value');
+ * @desc Create a session cookie.
+ * @example $.cookie('the_cookie', null);
+ * @desc Delete a cookie by passing null as value.
+ *
+ * @param String name The name of the cookie.
+ * @param String value The value of the cookie.
+ * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
+ * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
+ *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
+ *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
+ *                             when the the browser exits.
+ * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
+ * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
+ * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
+ *                        require a secure protocol (like HTTPS).
+ * @type undefined
+ *
+ * @name $.cookie
+ * @cat Plugins/Cookie
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
+ */
+
+/**
+ * Get the value of a cookie with the given name.
+ *
+ * @example $.cookie('the_cookie');
+ * @desc Get the value of a cookie.
+ *
+ * @param String name The name of the cookie.
+ * @return The value of the cookie.
+ * @type String
+ *
+ * @name $.cookie
+ * @cat Plugins/Cookie
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
+ */
+jQuery.cookie = function(name, value, options) {
+    if (typeof value != 'undefined') { // name and value given, set cookie
+        options = options || {};
+        if (value === null) {
+            value = '';
+            options.expires = -1;
+        }
+        var expires = '';
+        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
+            var date;
+            if (typeof options.expires == 'number') {
+                date = new Date();
+                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
+            } else {
+                date = options.expires;
+            }
+            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
+        }
+        var path = options.path ? '; path=' + options.path : '';
+        var domain = options.domain ? '; domain=' + options.domain : '';
+        var secure = options.secure ? '; secure' : '';
+        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
+    } else { // only name given, get cookie
+        var cookieValue = null;
+        if (document.cookie && document.cookie != '') {
+            var cookies = document.cookie.split(';');
+            for (var i = 0; i < cookies.length; i++) {
+                var cookie = jQuery.trim(cookies[i]);
+                // Does this cookie string begin with the name we want?
+                if (cookie.substring(0, name.length + 1) == (name + '=')) {
+                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
+                    break;
+                }
+            }
+        }
+        return cookieValue;
+    }
+};
\ No newline at end of file
diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql
index f7fe723b9b657772c0ab557e341b8c2749a110f1..cad2ac40bb428595ac44ae7abe8527a1d7ac3ef2 100755
--- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql
+++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql
@@ -44,4 +44,4 @@ alter table llx_extrafields add column param text after pos;
 alter table llx_propal   CHANGE COLUMN fk_adresse_livraison fk_delivery_address integer;
 alter table llx_commande CHANGE COLUMN fk_adresse_livraison fk_delivery_address integer;
 alter table llx_don      CHANGE COLUMN adresse address text;
-
+alter table llx_adherent CHANGE COLUMN adresse address text;
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 59641c1bbc15f05a03ed53b0a31569a9603f0d4a..5569f1b67847d010b965c3ff9f044e94b8157af6 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -1785,7 +1785,7 @@ class User extends CommonObject
 	/**
 	 *  Retourne le libelle du statut d'un user (actif, inactif)
 	 *
-	 *  @param	int		$mode          0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
+	 *  @param	int		$mode          0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
 	 *  @return	string 			       Label of status
 	 */
 	function getLibStatut($mode=0)
@@ -2191,7 +2191,7 @@ class User extends CommonObject
 		$this->load_parentof();
 
 		// Init $this->users array
-		$sql = "SELECT DISTINCT u.rowid, u.firstname, u.name, u.fk_user";	// Distinct reduce pb with old tables with duplicates
+		$sql = "SELECT DISTINCT u.rowid, u.firstname, u.name, u.fk_user, u.login, u.statut";	// Distinct reduce pb with old tables with duplicates
 		$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
 		$sql.= " WHERE u.entity IN (".getEntity('user',1).")";
 
@@ -2204,9 +2204,11 @@ class User extends CommonObject
 			{
 				$this->users[$obj->rowid]['rowid'] = $obj->rowid;
 				$this->users[$obj->rowid]['id'] = $obj->rowid;
-				$this->users[$obj->rowid]['fk_user'] = $obj->fk_parent;
+				$this->users[$obj->rowid]['fk_user'] = $obj->fk_user;
 				$this->users[$obj->rowid]['firstname'] = $obj->firstname;
 				$this->users[$obj->rowid]['name'] = $obj->name;
+				$this->users[$obj->rowid]['login'] = $obj->login;
+				$this->users[$obj->rowid]['statut'] = $obj->statut;
 				$i++;
 			}
 		}
@@ -2297,7 +2299,7 @@ class User extends CommonObject
 		{
 			print 'id: '.$this->users[$key]['id'];
 			print ' name: '.$this->users[$key]['name'];
-			print ' parent: '.$this->users[$key]['fk_parent'];
+			print ' parent: '.$this->users[$key]['fk_user'];
 			print ' fullpath: '.$this->users[$key]['fullpath'];
 			print ' fullname: '.$this->users[$key]['fullname'];
 			print "<br>\n";
diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php
index f95d877859bd1af3b52e4490deab82d8f41b076a..ad5584483fc7460798d5f7121cdcd8ebb624e87e 100644
--- a/htdocs/user/hierarchy.php
+++ b/htdocs/user/hierarchy.php
@@ -53,9 +53,12 @@ $companystatic = new Societe($db);
 
 $form = new Form($db);
 
-llxHeader();
+$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
+$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
+
+llxHeader('',$langs->trans("ListOfUsers"). ' ('.$langs->trans("HierarchicView").')','','',0,0,$arrayofjs,$arrayofcss);
 
-print_fiche_titre($langs->trans("ListOfUsers"). ' ('.$langs->trans("HierarchicView").')', '<form action="'.DOL_URL_ROOT.'/user/index.php" method="POST"><input type="submit" class="button" style="width:120px" name="viewcal" value="'.dol_escape_htmltag($langs->trans("List")).'"></form>');
+print_fiche_titre($langs->trans("ListOfUsers"). ' ('.$langs->trans("HierarchicView").')', '<form action="'.DOL_URL_ROOT.'/user/index.php" method="POST"><input type="submit" class="button" style="width:120px" name="viewcal" value="'.dol_escape_htmltag($langs->trans("ViewList")).'"></form>');
 
 
 
@@ -64,187 +67,55 @@ $user_arbo = $userstatic->get_full_tree();
 
 // Define fulltree array
 $fulltree=$user_arbo;
-
-print '<table class="liste" width="100%">';
-
-
-// ----- This section will show a tree from a fulltree array -----
-// $section must also be defined
-// ---------------------------------------------------------------
-
-
-// Root title line
-print '<tr><td>';
-print '<table class="nobordernopadding"><tr class="nobordernopadding">';
-print '<td align="left" width="24">';
-print img_picto_common('','treemenu/base.gif');
-print '</td><td align="left">'.$langs->trans("All");
-print '</td>';
-print '</tr></table></td>';
-print '<td align="right">&nbsp;</td>';
-print '<td align="right">&nbsp;</td>';
-//print '<td align="right">&nbsp;</td>';
-print '</tr>';
-
-
-
-// Define fullpathselected ( _x_y_z ) of $section parameter
-$fullpathselected='';
-if (! empty($section))
-{
-	foreach($fulltree as $key => $val)
-	{
-		//print $val['id']."-".$section."<br>";
-		if ($val['id'] == $section)
-		{
-			$fullpathselected=$val['fullpath'];
-			break;
-		}
-	}
-}
-//print "fullpathselected=".$fullpathselected."<br>";
-
-// Update expandedsectionarray in session
-$expandedsectionarray=array();
-if (isset($_SESSION['dol_catexpandedsectionarray'.$type])) $expandedsectionarray=explode(',',$_SESSION['dol_catexpandedsectionarray'.$type]);
-
-if (! empty($section) && $_GET['sectionexpand'] == 'true')
-{
-	// We add all sections that are parent of opened section
-	$pathtosection=explode('_',$fullpathselected);
-	foreach($pathtosection as $idcursor)
-	{
-		if ($idcursor && ! in_array($idcursor,$expandedsectionarray))	// Not already in array
-		{
-			$expandedsectionarray[]=$idcursor;
-		}
-	}
-	$_SESSION['dol_catexpandedsectionarray'.$type]=join(',',$expandedsectionarray);
-}
-if (! empty($section) && $_GET['sectionexpand'] == 'false')
-{
-	// We removed all expanded sections that are child of the closed section
-	$oldexpandedsectionarray=$expandedsectionarray;
-	$expandedsectionarray=array();
-	foreach($oldexpandedsectionarray as $sectioncursor)
-	{
-		// is_in_subtree(fulltree,sectionparent,sectionchild)
-		if ($sectioncursor && ! is_in_subtree($fulltree,$section,$sectioncursor)) $expandedsectionarray[]=$sectioncursor;
-	}
-	$_SESSION['dol_catexpandedsectionarray'.$type]=join(',',$expandedsectionarray);
-}
-//print $_SESSION['dol_catexpandedsectionarray'.$type].'<br>';
-
-$nbofentries=0;
-$oldvallevel=0;
-$var=true;
-foreach($fulltree as $key => $val)
-{
-	//$fullpathparent=preg_replace('/_[^_]+$/i','',$val['fullpath']);
-
-	// Define showline
-	$showline=0;
-
-	//var_dump($expandedsectionarray);
-
-	// If directory is son of expanded directory, we show line
-	if (isset($val['fk_parent']) && in_array($val['fk_parent'],$expandedsectionarray)) $showline=4;
-	// If directory is parent of selected directory or is selected directory, we show line
-	elseif (preg_match('/'.$val['fullpath'].'_/i',$fullpathselected.'_')) $showline=2;
-	// If we are level one we show line
-	elseif ($val['level'] < 2) $showline=1;
-	//print 'xxx '.$val['level'].' - '.$fullpathselected.' - '.$val['fullpath'].' - '.$val['fk_parent'].' showline='.$showline.'<br>'."\n";
-
-	if ($showline)
-	{
-        $var=!$var;
-
-	    if (in_array($val['id'],$expandedsectionarray)) $option='indexexpanded';
-		else $option='indexnotexpanded';
-		//print $option;
-
-        print "<tr ".$bc[$var].">";
-
-		// Show tree graph pictos
-		print '<td align="left">';
-		print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
-		$resarray=tree_showpad($fulltree,$key);
-		$a=$resarray[0];
-		$nbofsubdir=$resarray[1];
-		$nboffilesinsubdir=$resarray[2];
-		print '</td>';
-
-		// Show picto
-		print '<td valign="top">';
-		//print $val['fullpath']."(".$showline.")";
-		$n='2';
-		if (! 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);
-		if ($option == 'indexexpanded') $lien = '<a href="'.$_SERVER["PHP_SELF"].'?section='.$val['id'].'&amp;type='.$type.'&amp;sectionexpand=false">';
-    	if ($option == 'indexnotexpanded') $lien = '<a href="'.$_SERVER["PHP_SELF"].'?section='.$val['id'].'&amp;type='.$type.'&amp;sectionexpand=true">';
-    	$newref=str_replace('_',' ',$ref);
-    	$lienfin='</a>';
-    	print $lien.$newref.$lienfin;
-		if (! in_array($val['id'],$expandedsectionarray)) print img_picto('','object_category');
-		else print img_picto('','object_category-expanded');
-		print '</td>';
-		// Show link
-		print '<td valign="middle">';
-		//if ($section == $val['id']) print ' <u>';
-		// We don't want a link ... why ?
-		$userstatic->id=$val['id'];
-		$userstatic->ref=$val['label'];
-		$userstatic->type=$type;
-		print ' &nbsp;'.$userstatic->getNomUrl(0,'',60);
-
-		//print ' &nbsp;'.dol_trunc($val['label'],28);
-		//if ($section == $val['id']) print '</u>';
-		print '</td>';
-		print '</tr></table>';
-		print "</td>\n";
-
-		// Description
-		print '<td>';
-		print dol_trunc($val['description'],48);
-		print '</td>';
-
-		// Link to category card
-		print '<td align="right"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td>';
-
-		// Add link
-		//print '<td align="right"><a href="'.DOL_URL_ROOT.'/ecm/docdir.php?action=create&amp;catParent='.$val['id'].'">'.img_edit_add().'</a></td>';
-		//print '<td align="right">&nbsp;</td>';
-
-		print "</tr>\n";
-	}
-
-	$oldvallevel=$val['level'];
-	$nbofentries++;
-}
-
-
-// If nothing to show
-if ($nbofentries == 0)
+
+// Define data (format for treeview)
+$data=array();
+$data[] = array('rowid'=>0,'fk_menu'=>-1,'title'=>"racine",'mainmenu'=>'','leftmenu'=>'','fk_mainmenu'=>'','fk_leftmenu'=>'');
+foreach($fulltree as $key => $val)
 {
-	print '<tr>';
-	print '<td class="left"><table class="nobordernopadding"><tr class="nobordernopadding"><td>'.img_picto_common('','treemenu/branchbottom.gif').'</td>';
-	print '<td>'.img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/minustop3.gif','',1).'</td>';
-	print '<td valign="middle">';
-	print $langs->trans("NoCategoryYet");
-	print '</td>';
-	print '<td>&nbsp;</td>';
-	print '</table></td>';
-	print '<td colspan="4">&nbsp;</td>';
-	print '</tr>';
-}
-
-// ----- End of section -----
-// --------------------------
-
+	$userstatic->id=$val['id'];
+	$userstatic->ref=$val['label'];
+	$userstatic->firstname=$val['firstname'];
+	$userstatic->lastname=$val['name'];
+	$userstatic->statut=$val['statut'];
+	$li=$userstatic->getNomUrl(1,'').' ('.$val['login'].')';
+
+	$data[] = array(
+		'rowid'=>$val['rowid'],
+		'fk_menu'=>$val['fk_user'],
+		'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.$li.'</td><td align="right">'.$userstatic->getLibStatut(5).'</td></tr></table>'
+	);
+}
+
+
+print '<table class="liste" width="100%">';
+print '<tr class="liste_titre"><td>'.$langs->trans("HierarchicView").'</td><td></td><td align="right"><div id="iddivjstreecontrol"><a href="#">'.img_picto('','object_category').' '.$langs->trans("UndoExpandAll").'</a>';
+print ' | <a href="#">'.img_picto('','object_category-expanded').' '.$langs->trans("ExpandAll").'</a></div></td></tr>';
+
+$nbofentries=(count($data) - 1);
+
+if ($nbofentries > 0)
+{
+	print '<tr><td colspan="3">';
+	tree_recur($data,$data[0],0);
+	print '</td></tr>';
+}
+else
+{
+	print '<tr>';
+	print '<td colspan="3"><table class="nobordernopadding"><tr class="nobordernopadding"><td>'.img_picto_common('','treemenu/branchbottom.gif').'</td>';
+	print '<td valign="middle">';
+	print $langs->trans("NoCategoryYet");
+	print '</td>';
+	print '<td>&nbsp;</td>';
+	print '</table></td>';
+	print '</tr>';
+}
+
 print "</table>";
 
 
 llxFooter();
+
 $db->close();
 ?>