diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php
index 5ccef2be6b4..1cb0549a053 100644
--- a/htdocs/ecm/class/ecmdirectory.class.php
+++ b/htdocs/ecm/class/ecmdirectory.class.php
@@ -403,18 +403,19 @@ class EcmDirectory // extends CommonObject
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param string $option Sur quoi pointe le lien
* @param int $max Max length
+ * @param string $morehtml Add more param on a link
* @return string Chaine avec URL
*/
- function getNomUrl($withpicto=0,$option='',$max=0)
+ function getNomUrl($withpicto=0,$option='',$max=0,$more='')
{
global $langs;
$result='';
- $lien = '';
- if ($option == 'index') $lien = '';
- if ($option == 'indexexpanded') $lien = '';
- if ($option == 'indexnotexpanded') $lien = '';
+ $lien = '';
+ if ($option == 'index') $lien = '';
+ if ($option == 'indexexpanded') $lien = '';
+ if ($option == 'indexnotexpanded') $lien = '';
$lienfin='';
//$picto=DOL_URL_ROOT.'/theme/common/treemenu/folder.gif';
diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index 35a286b965a..05a2b437598 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -204,7 +204,7 @@ if ($action == 'refreshmanual')
// Now we compare both trees to complete missing trees into database
//var_dump($disktree);
//var_dump($sqltree);
- foreach($disktree as $dirdesc)
+ foreach($disktree as $dirdesc) // Loop on tree onto disk
{
$dirisindatabase=0;
foreach($sqltree as $dirsqldesc)
@@ -293,6 +293,9 @@ if ($action == 'refreshmanual')
}
}
+ $sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc=0 WHERE cachenbofdoc < 0";
+ $db->query($sql);
+
// If a directory was added, the fulltree array is not correctly completed and sorted, so we clean
// it to be sure that fulltree array is not used without reloading it.
if ($adirwascreated) $sqltree=null;
@@ -467,87 +470,51 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
print '
| ';
print ' | ';
print '';
- //print $form->textwithpicto('',$htmltooltip,1,0);
print ' | ';
- //print ''.$langs->trans("ECMNbOfDocsSmall").' '.img_picto($langs->trans("Refresh"),'refresh').' | ';
print '';
$sectionauto=dol_sort_array($sectionauto,'label','ASC',true,false);
+ print '';
+ print '';
+ print '';
+
$nbofentries=0;
$oldvallevel=0;
foreach ($sectionauto as $key => $val)
{
- if ($val['test']) // If condition to show is ok
+ if (empty($val['test'])) continue; // If condition to show is ok
+
+ $var=false;
+
+ print '- ';
+ if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))
{
- $var=false;
-
- print '
';
-
- // Section
- print '';
- print '| ';
- tree_showpad($sectionauto,$key);
- print ' | ';
-
- print '';
- if ($val['module'] == GETPOST("module"))
- {
- $n=3;
- $ref=img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/minustop'.$n.'.gif','',1);
- }
- else
- {
- $n=3;
- $ref=img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/plustop'.$n.'.gif','',1);
- }
- print '';
- print $ref;
- print '';
- print img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/folder.gif','',1);
- print ' | ';
-
- print '';
- print '';
- print $val['label'];
- print ' | ';
- print " | \n";
-
- // Nb of doc in dir
- print ' | ';
-
- // Nb of doc in subdir
- print ' | ';
-
- // Edit link
- print ' | ';
-
- // Add link
- print ' | ';
-
- // Info
- print '';
- $htmltooltip=''.$langs->trans("ECMSection").': '.$val['label'].' ';
- $htmltooltip=''.$langs->trans("Type").': '.$langs->trans("ECMSectionAuto").' ';
- $htmltooltip.=''.$langs->trans("ECMCreationUser").': '.$langs->trans("ECMTypeAuto").' ';
- $htmltooltip.=''.$langs->trans("Description").': '.$val['desc'];
- print $form->textwithpicto('',$htmltooltip,1,"info");
- print ' | ';
-
- print " \n";
-
- if ($val['module'] == GETPOST('module')) // We are on selected module
- {
- if (in_array($val['module'],array('product')))
- {
- $showonrightsize='featurenotyetavailable';
- }
- }
-
- $oldvallevel=$val['level'];
- $nbofentries++;
+ print '';
+ print $val['label'];
+ print '';
}
+ else
+ {
+ print '';
+ print $val['label'];
+ print '';
+ }
+
+ print '';
+ // Info
+ $htmltooltip=''.$langs->trans("ECMSection").': '.$val['label'].' ';
+ $htmltooltip=''.$langs->trans("Type").': '.$langs->trans("ECMSectionAuto").' ';
+ $htmltooltip.=''.$langs->trans("ECMCreationUser").': '.$langs->trans("ECMTypeAuto").' ';
+ $htmltooltip.=''.$langs->trans("Description").': '.$val['desc'];
+ print $form->textwithpicto('',$htmltooltip,1,"info");
+ print ' ';
+ print ' ';
+
+ $nbofentries++;
}
+
+ print ' |
';
}
@@ -637,8 +604,12 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
}
else
{
+ print '';
+ print '';
+ print ' ';
+
// Load full tree
- if (empty($sqltree)) $sqltree=$ecmdirstatic->get_full_arbo(0);
+ if (empty($sqltree)) $sqltree=$ecmdirstatic->get_full_arbo(0); // Slow
// ----- This section will show a tree from a fulltree array -----
// $section must also be defined
@@ -699,7 +670,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
$ecmdirstatic->ref=$val['label'];
// Refresh cache
- if (preg_match('/refresh/i',$_GET['action']))
+ if (preg_match('/refresh/i',$action))
{
$result=$ecmdirstatic->fetch($val['id']);
$ecmdirstatic->ref=$ecmdirstatic->label;
@@ -728,59 +699,33 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
else $option='indexnotexpanded';
//print $option;
- print '';
+ print '- ';
// Show tree graph pictos
- print '
';
- print '| ';
- $resarray=tree_showpad($sqltree,$key);
+ $cpt=1;
+ while ($cpt < $sqltree[$key]['level'])
+ {
+ print ' ';
+ $cpt++;
+ }
+ $resarray=tree_showpad($sqltree,$key,1);
$a=$resarray[0];
$nbofsubdir=$resarray[1];
$nboffilesinsubdir=$resarray[2];
- print ' | ';
-
- // Show picto
- print '';
- //print $val['fullpath']."(".$showline.")";
- $n='2';
- 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);
- if ($option == 'indexexpanded') $lien = '';
- if ($option == 'indexnotexpanded') $lien = '';
- //$newref=str_replace('_',' ',$ref);
- $newref=$ref;
- $lienfin='';
- print $lien.$newref.$lienfin;
- if (! in_array($val['id'],$expandedsectionarray)) print img_picto($ecmdirstatic->ref,DOL_URL_ROOT.'/theme/common/treemenu/folder.gif','',1);
- else print img_picto($ecmdirstatic->ref,DOL_URL_ROOT.'/theme/common/treemenu/folder-expanded.gif','',1);
- print ' | ';
// Show link
- print '';
- if ($section == $val['id']) print ' ';
- print $ecmdirstatic->getNomUrl(0,'index',32);
- if ($section == $val['id']) print '';
- print ' | ';
- print ' | ';
- print ' ';
- print " | \n";
+ print $ecmdirstatic->getNomUrl(0,$option,32,'class="fmdirlia jqft ecmjqft"');
+
+ print '';
// Nb of docs
- print ' ';
+ print '| ';
print $val['cachenbofdoc'];
print ' | ';
print '';
if ($nbofsubdir && $nboffilesinsubdir) print '+'.$nboffilesinsubdir.' ';
print ' | ';
- // Edit link
- print ''.img_view($langs->trans("Edit").' - '.$langs->trans("Show")).' | ';
-
- // Add link
- //print ''.img_edit_add().' | ';
- print ' | ';
-
// Info
print '';
$userstatic->id=$val['fk_user_c'];
@@ -796,7 +741,11 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
print $form->textwithpicto('',$htmltooltip,1,"info");
print " | ";
- print " \n";
+ print ' ';
+
+ print '';
+
+ print "\n";
}
$oldvallevel=$val['level'];
@@ -806,17 +755,16 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
// 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 '- ';
+ print '
';
print $langs->trans("ECMNoDirecotyYet");
- print ' | ';
- print ' | ';
- print '
| ';
- print ' | ';
- print ' ';
+ print ' ';
+ print " \n";
}
+
+ print '';
+ print '';
+ print ' ';
}
|