From dddb23e3bb5fbd9b5efb96a2fde749901445a6ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Sep 2008 13:15:25 +0000 Subject: [PATCH] Enhancement of ECM module --- htdocs/ecm/docdir.php | 11 ++- htdocs/ecm/ecmdirectory.class.php | 1 + htdocs/ecm/index.php | 137 +++++++++++++++++------------- htdocs/lib/ecm.lib.php | 27 ++++++ 4 files changed, 117 insertions(+), 59 deletions(-) diff --git a/htdocs/ecm/docdir.php b/htdocs/ecm/docdir.php index 41a31f2660d..800e8af566e 100644 --- a/htdocs/ecm/docdir.php +++ b/htdocs/ecm/docdir.php @@ -83,6 +83,11 @@ if (! empty($_GET["section"])) // Action ajout d'un produit ou service if ($_POST["action"] == 'add' && $user->rights->ecm->setup) { + if (! empty($_POST["cancel"])) + { + Header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager'); + exit; + } $ecmdir->ref = trim($_POST["ref"]); $ecmdir->label = trim($_POST["label"]); $ecmdir->description = trim($_POST["desc"]); @@ -164,7 +169,11 @@ if ($_GET["action"] == 'create') print ''; print ''."\n"; - print ''."\n"; + print ''; + print ''; + print '     '; + print ''; + print ''."\n"; print ''; print ''; diff --git a/htdocs/ecm/ecmdirectory.class.php b/htdocs/ecm/ecmdirectory.class.php index dafbee06233..6b141d65d01 100644 --- a/htdocs/ecm/ecmdirectory.class.php +++ b/htdocs/ecm/ecmdirectory.class.php @@ -377,6 +377,7 @@ class EcmDirectory // extends CommonObject $result=''; $lien = ''; + if ($option == 'index') $lien = ''; $lienfin=''; //$picto=DOL_URL_ROOT.'/theme/common/treemenu/folder.gif'; diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index fed66f070e4..4558066b5b2 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -26,6 +26,7 @@ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/ecm.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/ecmdirectory.class.php"); @@ -142,34 +143,35 @@ print $langs->trans("ECMAreaDesc")."
"; print $langs->trans("ECMAreaDesc2")."
"; print "
\n"; -// Tool bar -$colspan=3; -print ''; -print ''; -print ''; -print ''; -print '
'.img_picto('','object_list').' '.$langs->trans("ECMFileManager").''.img_picto('','search').' '.$langs->trans("Search").'
'; +print ''; + print "
'; + +// 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 ($butshown % 2 == 0) print ''; print "'; print ' '; - print ''; - print "
'; if (eregi('search',$action)) { - print ''; + print "'; + print "
'; - //print_fiche_titre($langs->trans("ECMManualOrg")); print '
'; print ''; print ""; print ''; - print "'; + print "'; print ''; - print "'; - print "'; - print "
'.$langs->trans("ECMSearchByKeywords").'
".$langs->trans("Ref").':
".$langs->trans("Ref").':
".$langs->trans("Title").':
".$langs->trans("Keyword").':

"; + print "
".$langs->trans("Title").':
".$langs->trans("Keyword").':
"; //print $langs->trans("ECMManualOrgDesc"); - print '
'; - //print_fiche_titre($langs->trans("ECMAutoOrg")); print '
'; @@ -182,7 +184,7 @@ if (eregi('search',$action)) foreach($sectionauto as $section) { if (! $section['test']) continue; - if ($butshown % 2 == 0) print '
".$section['label'].': 

"; + print '
"; //print $langs->trans("ECMAutoOrgDesc"); - - print ''; - print ''; } @@ -219,21 +218,28 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) print ''; print ''; - print ''; + print ''; print ''; if (sizeof($sectionauto)) { // Automatic sections title line - print ''; + print '
'.$langs->trans("ECMSectionOfDocuments").''; + print ''.$langs->trans("Refresh").' '.img_picto($langs->trans("Refresh"),'refresh').''; + print '
'; + print '
'; 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 ''; @@ -261,8 +267,17 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) print ''; print "\n"; + // Nb of doc + print ' '; + + // Edit link + print ' '; + + // Add link + print ' '; + // Info - print ''; + print ''; $htmltooltip=''.$langs->trans("ECMSection").': '.$val['label'].'
'; $htmltooltip=''.$langs->trans("Type").': '.$langs->trans("ECMAutoOrg").'
'; $htmltooltip.=''.$langs->trans("ECMCreationUser").': '.$langs->trans("ECMTypeAuto").'
'; @@ -270,15 +285,6 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) print $form->textwithhelp('',$htmltooltip,1,0); print ''; - // Edit link - print ' '; - - // Add link - print ' '; - - // Nb of doc - print '?'; - print "\n"; $oldvallevel=$val['level']; @@ -288,16 +294,21 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) } // Manual sections title line - print ''; + print ''; print ''; print ''; - print '
'; print img_picto_common('','treemenu/base.gif'); print ''.$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionManual").')'; print '
'; - print ' '; + print ''; + print ''; + print ''; + print ' '; print ''.img_edit_add().''; - print ''.$langs->trans("ECMNbOfDocsSmall").' '.img_picto($langs->trans("Refresh"),'refresh').''; + print ''; + $htmltooltip=$langs->trans("ECMAreaDesc2"); + print $form->textwithhelp('',$htmltooltip,1,0); + print ''; print ''; $ecmdirstatic = new ECMDirectory($db); @@ -333,14 +344,22 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) print '
'; print tree_showpad($rub,$key); print ''; - print $ecmdirstatic->getNomUrl(1); + print $ecmdirstatic->getNomUrl(1,'index'); print ''; - print '  '; - print '
'; + print ' '; print "\n"; + // Nb of docs + print ''.$val['cachenbofdoc'].''; + + // Edit link + print ''.img_edit().''; + + // Add link + print ''.img_edit_add().''; + // Info - print ''; + print ''; $userstatic->id=$val['fk_user_c']; $userstatic->nom=$val['login_c']; $htmltooltip=''.$langs->trans("ECMSection").': '.$val['label'].'
'; @@ -351,16 +370,6 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) 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']; @@ -376,21 +385,33 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action)) print ""; // Fin de zone Ajax -} - // Actions buttons -/* print '
'; if ($user->rights->ecm->setup) { - print ''.$langs->trans('ECMAddSection').''; + print ''.$langs->trans('ECMAddSection').''; } else { print ''.$langs->trans('ECMAddSection').''; } print '
'; -*/ + + +} + +print ''; + +print ''; + +// Right area + + + + + +print ''; + print '
'; diff --git a/htdocs/lib/ecm.lib.php b/htdocs/lib/ecm.lib.php index 235fdb9ecbd..35e883742e5 100644 --- a/htdocs/lib/ecm.lib.php +++ b/htdocs/lib/ecm.lib.php @@ -38,4 +38,31 @@ function ecm_prepare_head($obj) return $head; } +/** + \file htdocs/lib/invoice.lib.php + \brief Ensemble de fonctions de base pour le module factures + \version $Id$ + + Ensemble de fonctions de base de dolibarr sous forme d'include +*/ + +function ecm_prepare_head_fm($fac) +{ + global $langs, $conf; + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT.'/ecm/index.php?action=file_manager'; + $head[$h][1] = $langs->trans('ECMFileManager'); + $head[$h][2] = 'file_manager'; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/ecm/index.php?action=search_form'; + $head[$h][1] = $langs->trans('Search'); + $head[$h][2] = 'search_form'; + $h++; + + return $head; +} + ?>