';
+
+ print '';
+ print '| '.$langs->trans("ECMSectionOfDocuments").' | ';
+ print '
';
if (sizeof($sectionauto))
{
- // Automatic sections
- print '';
- print '| '.$langs->trans("ECMSectionOfDocuments").' | ';
- print ''.$langs->trans("Type").' | ';
- print ''.$langs->trans("ECMNbOfDocsSmall").' '.img_picto($langs->trans("Refresh"),'refresh').' | ';
- print '';
- if ($user->rights->ecm->setup)
- {
- print ''.img_picto($langs->trans("ECMNewSection"),'edit_add').'';
- }
- else
- {
- print ' ';
- }
+ // Automatic sections title line
+ print ' |
';
+ print '';
+ print '| ';
+ print img_picto_common('','treemenu/base.gif');
+ print ' | '.$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionAuto").')';
print ' | ';
- print ' | ';
+ print ' ';
+ print ' | | ';
+ print ' | ';
+ //print ''.$langs->trans("ECMNbOfDocsSmall").' '.img_picto($langs->trans("Refresh"),'refresh').' | ';
print '
';
$sectionauto=dol_sort_array($sectionauto,'label',$sortorder,true,false);
- $var=true;
+ $nbofentries=0;
+ $oldvallevel=0;
foreach ($sectionauto as $key => $val)
{
if ($val['test'])
{
- $var=! $var;
+ $var=false;
print '';
// Section
print '| ';
- print img_picto('','object_dir').' ';
- print '';
+ print '';
print " | \n";
- // Type
- print ''.$langs->trans('ECMTypeAuto').' | ';
- print '? | ';
-
- // Edit link
- print ' | ';
-
+ // Info
print '';
$htmltooltip=''.$langs->trans("ECMSection").': '.$val['label'].' ';
$htmltooltip=''.$langs->trans("Type").': '.$langs->trans("ECMAutoOrg").' ';
@@ -270,24 +269,48 @@ if (empty($action) || $action == 'refresh')
$htmltooltip.=''.$langs->trans("Description").': '.$val['desc'];
print $form->textwithhelp('',$htmltooltip,1,0);
print ' | ';
+
+ // Edit link
+ print ' | ';
+
+ // Add link
+ print ' | ';
+
+ // Nb of doc
+ print '? | ';
print "
\n";
+
+ $oldvallevel=$val['level'];
+ $nbofentries++;
}
}
}
+ // Manual sections title line
+ print '';
+ print '';
+ print '| ';
+ print img_picto_common('','treemenu/base.gif');
+ print ' | '.$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionManual").')';
+ print ' | ';
+ print ' ';
+ print ' | | ';
+ print ''.img_edit_add().' | ';
+ print ''.$langs->trans("ECMNbOfDocsSmall").' '.img_picto($langs->trans("Refresh"),'refresh').' | ';
+ print '
';
- // Manual sections
$ecmdirstatic = new ECMDirectory($db);
$rub=$ecmdirstatic->get_full_arbo();
$userstatic = new User($db);
$nbofentries=0;
+ $oldvallevel=0;
$var=true;
foreach($rub as $key => $val)
{
- $var=!$var;
+ $var=false;
$ecmdirstatic->id=$val['id'];
$ecmdirstatic->ref=$val['label'];
@@ -307,20 +330,16 @@ if (empty($action) || $action == 'refresh')
// Section
print '';
- print str_repeat(' ',$val['level']-1);
+ print '| ';
+ print tree_showpad($rub,$key);
+ print ' | ';
print $ecmdirstatic->getNomUrl(1);
+ print ' | ';
+ print ' ';
+ print ' | ';
print " | \n";
- // Description
- print ''.$langs->trans("ECMTypeManual").' | ';
-
- // Nb of docs
- //print ''.$obj->cachenbofdoc.' | ';
- print ''.$val['cachenbofdoc'].' | ';
-
- // Edit link
- print ''.img_edit().' | ';
-
+ // Info
print '';
$userstatic->id=$val['fk_user_c'];
$userstatic->nom=$val['login_c'];
@@ -332,8 +351,19 @@ if (empty($action) || $action == 'refresh')
print $form->textwithhelp('',$htmltooltip,1,0);
print " | ";
+ // Edit link
+ print ''.img_edit().' | ';
+
+ // Add link
+ print ''.img_edit_add().' | ';
+
+ // Nb of docs
+ //print ''.$obj->cachenbofdoc.' | ';
+ print ''.$val['cachenbofdoc'].' | ';
+
print "\n";
+ $oldvallevel=$val['level'];
$nbofentries++;
}
diff --git a/htdocs/includes/modules/modECM.class.php b/htdocs/includes/modules/modECM.class.php
index a6f7d370bd1..f69747be23c 100644
--- a/htdocs/includes/modules/modECM.class.php
+++ b/htdocs/includes/modules/modECM.class.php
@@ -153,7 +153,7 @@ class modECM extends DolibarrModules
'type'=>'left',
'titre'=>'ECMFileManager',
'mainmenu'=>'ecm',
- 'url'=>'/ecm/index.php',
+ 'url'=>'/ecm/index.php?action=file_manager',
'langs'=>'ecm',
'position'=>100,
'perms'=>'$user->rights->ecm->read',
diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index f10144d6080..9ac630d6a76 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -811,7 +811,7 @@ function img_object($alt, $object)
\brief Affiche picto (fonction g�n�rique)
\param alt Texte sur le alt de l'image
\param picto Nom de l'image a afficher (Si pas d'extension, on met '.png')
- \param options Attribut suppl�mentaire a la balise img
+ \param options Attribut supplementaire a la balise img
\param pictoisfullpath If 1, image path is a full path
\return string Retourne tag img
*/
@@ -823,6 +823,22 @@ function img_picto($alt, $picto, $options='', $pictoisfullpath=0)
return '
';
}
+/**
+ \brief Affiche picto (fonction g�n�rique)
+ \param alt Texte sur le alt de l'image
+ \param picto Nom de l'image a afficher (Si pas d'extension, on met '.png')
+ \param options Attribut supplementaire a la balise img
+ \param pictoisfullpath If 1, image path is a full path
+ \return string Retourne tag img
+ */
+function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0)
+{
+ global $conf;
+ if (! eregi('(\.png|\.gif)$',$picto)) $picto.='.png';
+ if ($pictoisfullpath) return '
';
+ return '
';
+}
+
/**
\brief Affiche logo action
\param alt Texte sur le alt de l'image
diff --git a/htdocs/lib/treeview.lib.php b/htdocs/lib/treeview.lib.php
index e14bc50eb35..b113ce1ee14 100644
--- a/htdocs/lib/treeview.lib.php
+++ b/htdocs/lib/treeview.lib.php
@@ -24,6 +24,40 @@
* \version $Id$
*/
+/**
+ * Show picto of a tree view
+ *
+ * @param unknown_type $tab Array of entries in correct order
+ * @param unknown_type $key Key of value
+ */
+function tree_showpad(&$tab,$key)
+{
+ $pos=1;
+ while ($pos <= $tab[$key]['level'] && $tab[$key]['level'] > 0)
+ {
+ // Process picto for column $pos
+ // \TODO If at least one of this level
+ $atleastonofthislevelafter=1;
+ if ($atleastonofthislevelafter)
+ {
+ if ($tab[$key]['level'] == $pos) print img_picto_common('','treemenu/branch.gif');
+ else print img_picto_common('','treemenu/line.gif');
+ }
+ else
+ {
+ if ($tab[$key]['level'] == $pos) print img_picto_common('','treemenu/branchbottom.gif');
+ else print img_picto_common('','treemenu/linebottom.gif');
+ }
+ $pos++;
+ }
+}
+
+
+
+
+
+// ------------------------------- Used by enu editor -----------------
+
/**
* \brief Ad javascript tree functions
*/