';
-print '| ';
+print ' | ';
// 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'=>''
+ );
$i++;
}
}
diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php
index c9102fdaa17..520619580a9 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;
+// 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)
+{
+ $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'=>''
+ );
+}
+
+
print '';
-print '| '.$langs->trans("Categories").' | '.$langs->trans("Description").' | ';
+print '| '.$langs->trans("Categories").' | '.$langs->trans("Description").' | | ';
+$nbofentries=(count($data) - 1);
-// ----- This section will show a tree from a fulltree array -----
-// $section must also be defined
-// ---------------------------------------------------------------
-
-
-// Root title line
-print '';
-print '';
-print '| ';
-print img_picto_common('','treemenu/base.gif');
-print ' | '.$langs->trans("AllCats");
-print ' | ';
-print '
| ';
-print ' | ';
-print ' | ';
-//print ' | ';
-print ' ';
-
-
-
-// Define fullpathselected ( _x_y_z ) of $section parameter
-$fullpathselected='';
-if (! empty($section))
+if ($nbofentries > 0)
{
- foreach($fulltree as $key => $val)
- {
- //print $val['id']."-".$section." ";
- if ($val['id'] == $section)
- {
- $fullpathselected=$val['fullpath'];
- break;
- }
- }
+ print '| ';
+ tree_recur($data,$data[0],0);
+ print ' | ';
}
-//print "fullpathselected=".$fullpathselected." ";
-
-// Update expandedsectionarray in session
-$expandedsectionarray=array();
-if (isset($_SESSION['dol_catexpandedsectionarray'.$type])) $expandedsectionarray=explode(',',$_SESSION['dol_catexpandedsectionarray'.$type]);
-
-if (! empty($section) && $_GET['sectionexpand'] == 'true')
+else
{
- // 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].' ';
-
-$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.' '."\n";
-
- if ($showline)
- {
- $var=!$var;
-
- if (in_array($val['id'],$expandedsectionarray)) $option='indexexpanded';
- else $option='indexnotexpanded';
- //print $option;
-
- print "";
-
- // Show tree graph pictos
- print '';
- print '| ';
- $resarray=tree_showpad($fulltree,$key);
- $a=$resarray[0];
- $nbofsubdir=$resarray[1];
- $nboffilesinsubdir=$resarray[2];
- print ' | ';
-
- // Show picto
- print '';
- //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 = '';
- if ($option == 'indexnotexpanded') $lien = '';
- $newref=str_replace('_',' ',$ref);
- $lienfin='';
- print $lien.$newref.$lienfin;
- if (! in_array($val['id'],$expandedsectionarray)) print img_picto('','object_category');
- else print img_picto('','object_category-expanded');
- print ' | ';
- // Show link
- print '';
- //if ($section == $val['id']) print ' ';
- // We don't want a link ... why ?
- $categstatic->id=$val['id'];
- $categstatic->ref=$val['label'];
- $categstatic->type=$type;
- print ' '.$categstatic->getNomUrl(0,'',60);
-
- //print ' '.dol_trunc($val['label'],28);
- //if ($section == $val['id']) print '';
- print ' | ';
- print ' ';
- print " | \n";
-
- // Description
- print '';
- print dol_trunc($val['description'],48);
- print ' | ';
-
- // Link to category card
- print ''.img_view().' | ';
-
- // Add link
- //print ''.img_edit_add().' | ';
- //print ' | ';
-
- print " \n";
- }
-
- $oldvallevel=$val['level'];
- $nbofentries++;
-}
-
-
-// If nothing to show
-if ($nbofentries == 0)
-{
- print '';
- print '| '.img_picto_common('','treemenu/branchbottom.gif').' | ';
- print ''.img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/minustop3.gif','',1).' | ';
- print '';
- print $langs->trans("NoCategoryYet");
- print ' | ';
- print ' | ';
- print '
| ';
- print ' | ';
- print ' ';
-}
-
-// ----- End of section -----
-// --------------------------
+ print '';
+ print '| '.img_picto_common('','treemenu/branchbottom.gif').' | ';
+ print '';
+ print $langs->trans("NoCategoryYet");
+ print ' | ';
+ print ' | ';
+ print '
| ';
+ print ' ';
+}
print " ";
llxFooter();
+
$db->close();
?>
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 2dc15e536a1..de55231f101 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 60597db8c59..9d82fb21ab9 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 ' |