';
// Left area
// Tool bar
$selected='file_manager';
if (eregi('search',$action)) $selected='search_form';
$head = ecm_prepare_head_fm($fac);
dolibarr_fiche_head($head, $selected, '', 1);
print '';
if (eregi('search',$action))
{
//print_fiche_titre($langs->trans("ECMManualOrg"));
print '";
//print $langs->trans("ECMManualOrgDesc");
//print_fiche_titre($langs->trans("ECMAutoOrg"));
print '";
//print $langs->trans("ECMAutoOrgDesc");
}
if (empty($action) || $action == 'file_manager' || eregi('refresh',$action))
{
// Confirmation de la suppression d'une ligne categorie
if ($_GET['action'] == 'delete_section')
{
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urldecode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection');
print ' ';
}
if ($mesg) { print $mesg." "; }
// Construit liste des répertoires
print '';
print '';
print '| ';
print ''.$langs->trans("Refresh").' '.img_picto($langs->trans("Refresh"),'refresh').'';
print ' | ';
print ' ';
if (sizeof($sectionauto))
{
// 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 '';
$htmltooltip=$langs->trans("ECMAreaDesc2");
print $form->textwithhelp('',$htmltooltip,1,0);
print ' | ';
//print ''.$langs->trans("ECMNbOfDocsSmall").' '.img_picto($langs->trans("Refresh"),'refresh').' | ';
print ' ';
$sectionauto=dol_sort_array($sectionauto,'label',$sortorder,true,false);
$nbofentries=0;
$oldvallevel=0;
foreach ($sectionauto as $key => $val)
{
if ($val['test'])
{
$var=false;
print '';
// Section
print '| ';
print '';
print " | \n";
// Nb of doc
print ' | ';
// Edit link
print ' | ';
// Add link
print ' | ';
// Info
print '';
$htmltooltip=''.$langs->trans("ECMSection").': '.$val['label'].' ';
$htmltooltip=''.$langs->trans("Type").': '.$langs->trans("ECMAutoOrg").' ';
$htmltooltip.=''.$langs->trans("ECMCreationUser").': '.$langs->trans("ECMTypeAuto").' ';
$htmltooltip.=''.$langs->trans("Description").': '.$val['desc'];
print $form->textwithhelp('',$htmltooltip,1,0);
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 ' | ';
print ' | ';
print ''.img_edit_add().' | ';
print '';
$htmltooltip=$langs->trans("ECMAreaDesc2");
print $form->textwithhelp('',$htmltooltip,1,0);
print ' | ';
print ' ';
$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=false;
$ecmdirstatic->id=$val['id'];
$ecmdirstatic->ref=$val['label'];
// Refresh cache
if ($_GET['action'] == 'refreshauto')
{
$result=$ecmdirstatic->fetch($val['id']);
$ecmdirstatic->ref=$ecmdirstatic->label;
$result=$ecmdirstatic->refreshcachenboffile();
$val['cachenbofdoc']=$result;
}
print '';
// Section
print '';
print '| ';
print tree_showpad($rub,$key);
print ' | ';
print $ecmdirstatic->getNomUrl(1,'index');
print ' | ';
print ' | ';
print " | \n";
// Nb of docs
print ''.$val['cachenbofdoc'].' | ';
// Edit link
print ''.img_edit().' | ';
// Add link
print ''.img_edit_add().' | ';
// Info
print '';
$userstatic->id=$val['fk_user_c'];
$userstatic->nom=$val['login_c'];
$htmltooltip=''.$langs->trans("ECMSection").': '.$val['label'].' ';
$htmltooltip=''.$langs->trans("Type").': '.$langs->trans("ECMManualOrg").' ';
$htmltooltip.=''.$langs->trans("ECMCreationUser").': '.$userstatic->getNomUrl(1).' ';
$htmltooltip.=''.$langs->trans("ECMCreationDate").': '.dolibarr_print_date($val['date_c'],"dayhour").' ';
$htmltooltip.=''.$langs->trans("Description").': '.$val['description'];
print $form->textwithhelp('',$htmltooltip,1,0);
print " | ";
print " \n";
$oldvallevel=$val['level'];
$nbofentries++;
}
// If nothing to show
if ($nbofentries == 0)
{
print '| '.$langs->trans("ECMNoDirecotyYet").' | ';
}
print " ";
// Fin de zone Ajax
// Actions buttons
print '';
}
print ' | ';
print ' | ';
// Right area
print ' |