diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index bd7319e278d..ae6c9942762 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -53,7 +53,7 @@ class modMyModule extends DolibarrModules // Key text used to identify module (for permission, menus, etc...) $this->rights_class = 'mymodule'; - // Family can be 'crm','financial','hr','projects','product','technic','other' + // Family can be 'crm','financial','hr','projects','product','ecm','technic','other' // It is used to group modules in module setup page $this->family = "projects"; // Module title used if translation string 'ModuleXXXName' not found (XXX is value MyModule) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 8112378e141..9936c54600d 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -294,9 +294,10 @@ $familylib=array( 'products'=>$langs->trans("ModuleFamilyProducts"), 'hr'=>$langs->trans("ModuleFamilyHr"), 'projects'=>$langs->trans("ModuleFamilyProjects"), -'other'=>$langs->trans("ModuleFamilyOther"), -'technic'=>$langs->trans("ModuleFamilyTechnic"), 'financial'=>$langs->trans("ModuleFamilyFinancial"), +'ecm'=>$langs->trans("ModuleFamilyECM"), +'technic'=>$langs->trans("ModuleFamilyTechnic"), +'other'=>$langs->trans("ModuleFamilyOther") ); foreach ($orders as $key => $value) { diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 8893bf5d985..a968bf4a12f 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2007 Rodolphe Quiedeville * * This program is free software; you can redistribute it and/or modify @@ -15,15 +15,12 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ /** \file htdocs/admin/system/dolibarr.php \brief Fichier page info systemes Dolibarr - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); @@ -93,6 +90,8 @@ $db->begin(); $dir = DOL_DOCUMENT_ROOT . "/includes/modules/"; $handle=opendir($dir); $modules = array(); +$modules_names = array(); +$modules_files = array(); while (($file = readdir($handle))!==false) { if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php') @@ -101,12 +100,12 @@ while (($file = readdir($handle))!==false) if ($modName) { - include_once("../../includes/modules/$file"); + include_once(DOL_DOCUMENT_ROOT."/includes/modules/".$file); $objMod = new $modName($db); $modules[$objMod->numero]=$objMod; $modules_names[$objMod->numero]=$objMod->name; - + $modules_files[$objMod->numero]=$file; $picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic'; } } @@ -127,7 +126,10 @@ foreach($sortorder as $numero=>$name) $idperms=""; $var=!$var; // Module - print "".img_object("",$picto[$numero]).' '.$modules[$numero]->getName().""; + print ""; + $alt=$name.' - '.$modules_files[$numero]; + print img_object($alt,$picto[$numero]).' '.$modules[$numero]->getName(); + print ""; // Version print ''.$modules[$numero]->getVersion().''; // Id diff --git a/htdocs/compta/param/index.php b/htdocs/compta/param/index.php index 2c045f665b9..c28b32deda3 100644 --- a/htdocs/compta/param/index.php +++ b/htdocs/compta/param/index.php @@ -15,22 +15,18 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ /** \file htdocs/compta/param/index.php \ingroup compta \brief Page acceuil zone paramétrage comptabilité - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); $langs->load("compta"); -$langs->load("admin"); $langs->load("bills"); /* diff --git a/htdocs/compta/prelevement/config.php b/htdocs/compta/prelevement/config.php index 3f29c47e09d..39c32ed9389 100644 --- a/htdocs/compta/prelevement/config.php +++ b/htdocs/compta/prelevement/config.php @@ -31,7 +31,6 @@ require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); if (!$user->rights->prelevement->bons->lire) accessforbidden(); -$langs->load("admin"); if ($_GET["action"] == "set" && $user->rights->prelevement->bons->configurer) { diff --git a/htdocs/conf/conf.class.php b/htdocs/conf/conf.class.php index 8303697ce1c..1382d4e9b28 100644 --- a/htdocs/conf/conf.class.php +++ b/htdocs/conf/conf.class.php @@ -338,7 +338,9 @@ class Conf $this->fckeditor->dir_output=DOL_DATA_ROOT."/fckeditor"; // Module etiquette $this->label->enabled=defined("MAIN_MODULE_LABEL")?MAIN_MODULE_LABEL:0; - + // Module ECM + $this->ecm->enabled=defined("MAIN_MODULE_ECM")?MAIN_MODULE_ECM:0; + $this->ecm->dir_output=DOL_DATA_ROOT."/ecm"; /* * Modification de quelques variable de conf en fonction des Constantes diff --git a/htdocs/ecm/docmine.php b/htdocs/ecm/docmine.php new file mode 100644 index 00000000000..43961dbd3fe --- /dev/null +++ b/htdocs/ecm/docmine.php @@ -0,0 +1,288 @@ + + */ + +/** + \file htdoc/google/index.php + \ingroup google + \brief Main google area page + \version $Id$ + \author Laurent Destailleur +*/ + +require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); + +// Load traductions files +$langs->load("ecm"); +$langs->load("companies"); +$langs->load("other"); + +// Load permissions +$user->getrights('ecm'); + +// Get parameters +$socid = isset($_GET["socid"])?$_GET["socid"]:''; + +// Permissions +if ($user->societe_id > 0) +{ + $action = ''; + $socid = $user->societe_id; +} + +$section=$_GET["section"]; +if (! $section) $section='misc'; +$upload_dir = $conf->ecm->dir_output.'/'.$section; + + + +/******************************************************************* +* ACTIONS +* +* Put here all code to do according to value of "action" parameter +********************************************************************/ + +// Envoie fichier +if ( $_POST["sendit"] && $conf->upload != 0) +{ + if (! is_dir($upload_dir)) create_exdir($upload_dir); + + if (is_dir($upload_dir)) + { + $result = doliMoveFileUpload($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name']); + if ($result == 1) + { + $mesg = '
'.$langs->trans("FileTransferComplete").'
'; + //print_r($_FILES); + } + else if (!$result) + { + // Echec transfert (fichier d?passant la limite ?) + $mesg = '
'.$langs->trans("ErrorFileNotUploaded").'
'; + // print_r($_FILES); + } + else + { + // Fichier infect? par un virus + $mesg = '
'.$langs->trans("ErrorFileIsInfectedWith",$result).'
'; + } + } +} + +// Suppression fichier +if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes') +{ + $file = $upload_dir . "/" . urldecode($_GET["urlfile"]); + dol_delete_file($file); + $mesg = '
'.$langs->trans("FileWasRemoved").'
'; +} + + + + + +/******************************************************************* +* PAGE +* +* Put here all code to do according to value of "action" parameter +********************************************************************/ + +llxHeader(); + +$form=new Form($db); + +print_fiche_titre($langs->trans("DocsMine")); +print "
"; + +//$head = societe_prepare_head($societe); + + +//dolibarr_fiche_head($head, 'document', $societe->nom); + + +/* +* Confirmation de la suppression d'une ligne produit +*/ +if ($_GET['action'] == 'delete_file') +{ + $form->form_confirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); + print '
'; +} + +// Construit liste des fichiers +clearstatcache(); +$totalsize=0; +$filearray=array(); +$errorlevel=error_reporting(); +error_reporting(0); +$handle=opendir($upload_dir); +error_reporting($errorlevel); +if ($handle) +{ + $i=0; + while (($file = readdir($handle))!==false) + { + if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') + { + $filearray[$i]->name=$file; + $filearray[$i]->size=filesize($upload_dir."/".$file); + $filearray[$i]->date=filemtime($upload_dir."/".$file); + $totalsize+=$filearray[$i]->size; + $i++; + } + } + closedir($handle); +} +else +{ + // print '
'.$langs->trans("ErrorCanNotReadDir",$upload_dir).'
'; +} + + +/* + +print ''; + +// Nbre fichiers +print ''; + +//Total taille +print ''; + +print '
'.$langs->trans("NbOfAttachedFiles").''.sizeof($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; + +print ''; + +*/ + + +if ($mesg) { print $mesg."
"; } + +// Affiche formulaire upload +$formfile=new FormFile($db); +$formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/docmine.php'); + +// Affiche liste des documents existant +print_titre($langs->trans("AttachedFiles")); + +/** + * TODO Mettre cette section dans une zone AJAX + */ +$modulepart='ecm'; +$url=$_SERVER["PHP_SELF"]; +print ''; +print ''; +$param='&socid='.$socid; +print_liste_field_titre($langs->trans("Document"),$_SERVER["PHP_SELF"],"name","",$param,'align="left"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("Size"),$_SERVER["PHP_SELF"],"size","",$param,'align="right"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"date","",$param,'align="center"',$sortfield,$sortorder); +print ''; +print ''; + +function compare_file($a, $b) +{ + global $sortorder; + global $sortfield; + + $sortorder=strtoupper($sortorder); + + if ($sortorder == 'ASC') { $retup=-1; $retdown=1; } + else { $retup=1; $retdown=-1; } + + if ($sortfield == 'name') + { + if ($a->name == $b->name) return 0; + return ($a->name < $b->name) ? $retup : $retdown; + } + if ($sortfield == 'date') + { + if ($a->date == $b->date) return 0; + return ($a->date < $b->date) ? $retup : $retdown; + } + if ($sortfield == 'size') + { + if ($a->size == $b->size) return 0; + return ($a->size < $b->size) ? $retup : $retdown; + } +} + +usort($filearray,"compare_file"); + +$var=true; +foreach($filearray as $key => $file) +{ + if (!is_dir($dir.$file->name) && substr($file->name, 0, 1) <> '.' && substr($file->name, 0, 3) <> 'CVS') + { + $var=!$var; + print "\n"; + print ''; + print ''; + print '\n"; + } +} +print "
 
"; + echo ''.$file->name.''; + print "'.$file->size.' '.$langs->trans("bytes").''.dolibarr_print_date($file->date,"dayhour").''; + echo ''.img_delete().''; + print "
"; +// Fin de zone Ajax + + +print "

"; + +// Courriers +// Les courriers sont des documents speciaux generes par des scripts +// situes dans scripts/courrier. +// Voir Rodo +if ($conf->global->MAIN_MODULE_EDITEUR) +{ + $filearray=array(); + $errorlevel=error_reporting(); + error_reporting(0); + $handle=opendir($courrier_dir); + error_reporting($errorlevel); + if ($handle) + { + $i=0; + while (($file = readdir($handle))!==false) + { + if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') + { + $filearray[$i]=$file; + $i++; + } + } + closedir($handle); + } + + print ''; + print ''; + + $var=true; + foreach($filearray as $key => $file) + { + if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') + { + $var=!$var; + print "\n"; + + print ''; + print ''; + print "\n"; + } + } + print "
'.$langs->trans("Courriers").''.$langs->trans("Size").''.$langs->trans("Date").'
"; + $loc = "courrier/".get_exdir($socid); + echo ''.$file.''; + print "'.filesize($courrier_dir."/".$file). ' '.$langs->trans("bytes").''.dolibarr_print_date(filemtime($courrier_dir."/".$file),"dayhour").'
"; +} + + + + +// End of page +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/ecm/docother.php b/htdocs/ecm/docother.php new file mode 100644 index 00000000000..2586d8d09b8 --- /dev/null +++ b/htdocs/ecm/docother.php @@ -0,0 +1,168 @@ + + */ + +/** + \file htdoc/google/index.php + \ingroup google + \brief Main google area page + \version $Id$ + \author Laurent Destailleur +*/ + +require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); + +// Load traductions files +$langs->load("ecm"); +$langs->load("companies"); +$langs->load("other"); + +// Load permissions +$user->getrights('ecm'); + +// Get parameters +$socid = isset($_GET["socid"])?$_GET["socid"]:''; + +// Permissions +if ($user->societe_id > 0) +{ + $action = ''; + $socid = $user->societe_id; +} + +$section=$_GET["section"]; +if (! $section) $section='misc'; +$upload_dir = $conf->ecm->dir_output.'/'.$section; + + + +/******************************************************************* +* ACTIONS +* +* Put here all code to do according to value of "action" parameter +********************************************************************/ + +// Envoie fichier +if ( $_POST["sendit"] && $conf->upload != 0) +{ + if (! is_dir($upload_dir)) create_exdir($upload_dir); + + if (is_dir($upload_dir)) + { + $result = doliMoveFileUpload($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name']); + if ($result == 1) + { + $mesg = '
'.$langs->trans("FileTransferComplete").'
'; + //print_r($_FILES); + } + else if (!$result) + { + // Echec transfert (fichier d?passant la limite ?) + $mesg = '
'.$langs->trans("ErrorFileNotUploaded").'
'; + // print_r($_FILES); + } + else + { + // Fichier infect? par un virus + $mesg = '
'.$langs->trans("ErrorFileIsInfectedWith",$result).'
'; + } + } +} + +// Suppression fichier +if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes') +{ + $file = $upload_dir . "/" . urldecode($_GET["urlfile"]); + dol_delete_file($file); + $mesg = '
'.$langs->trans("FileWasRemoved").'
'; +} + + + + + +/******************************************************************* +* PAGE +* +* Put here all code to do according to value of "action" parameter +********************************************************************/ + +llxHeader(); + +$form=new Form($db); + +print_fiche_titre($langs->trans("Documents")); + +//$head = societe_prepare_head($societe); + + +//dolibarr_fiche_head($head, 'document', $societe->nom); + + +/* +* Confirmation de la suppression d'une ligne produit +*/ +if ($_GET['action'] == 'delete_file') +{ +$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); +print '
'; +} + +// Construit liste des fichiers +clearstatcache(); +$totalsize=0; +$filearray=array(); +$errorlevel=error_reporting(); +error_reporting(0); +$handle=opendir($upload_dir); +error_reporting($errorlevel); +if ($handle) +{ + $i=0; + while (($file = readdir($handle))!==false) + { + if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') + { + $filearray[$i]->name=$file; + $filearray[$i]->size=filesize($upload_dir."/".$file); + $filearray[$i]->date=filemtime($upload_dir."/".$file); + $totalsize+=$filearray[$i]->size; + $i++; + } + } + closedir($handle); +} +else +{ + // print '
'.$langs->trans("ErrorCanNotReadDir",$upload_dir).'
'; +} + + +/* + +print ''; + +// Nbre fichiers +print ''; + +//Total taille +print ''; + +print '
'.$langs->trans("NbOfAttachedFiles").''.sizeof($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; + +print ''; + +*/ + + +if ($mesg) { print $mesg."
"; } + + +print $langs->trans("FeatureNotYetAvailable"); + +// End of page +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php new file mode 100644 index 00000000000..7d88e2bc39c --- /dev/null +++ b/htdocs/ecm/index.php @@ -0,0 +1,104 @@ + + */ + +/** + \file htdoc/google/index.php + \ingroup google + \brief Main google area page + \version $Id$ + \author Laurent Destailleur +*/ + +require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); + +// Load traductions files +$langs->load("ecm"); +$langs->load("companies"); +$langs->load("other"); + +// Load permissions +$user->getrights('ecm'); + +// Get parameters +$socid = isset($_GET["socid"])?$_GET["socid"]:''; + +// Permissions +if ($user->societe_id > 0) +{ + $action = ''; + $socid = $user->societe_id; +} + +$section=$_GET["section"]; +if (! $section) $section='misc'; +$upload_dir = $conf->ecm->dir_output.'/'.$section; + + + +/******************************************************************* +* ACTIONS +* +* Put here all code to do according to value of "action" parameter +********************************************************************/ + +// Envoie fichier +if ( $_POST["sendit"] && $conf->upload != 0) +{ + if (! is_dir($upload_dir)) create_exdir($upload_dir); + + if (is_dir($upload_dir)) + { + $result = doliMoveFileUpload($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name']); + if ($result == 1) + { + $mesg = '
'.$langs->trans("FileTransferComplete").'
'; + //print_r($_FILES); + } + else if (!$result) + { + // Echec transfert (fichier d?passant la limite ?) + $mesg = '
'.$langs->trans("ErrorFileNotUploaded").'
'; + // print_r($_FILES); + } + else + { + // Fichier infect? par un virus + $mesg = '
'.$langs->trans("ErrorFileIsInfectedWith",$result).'
'; + } + } +} + +// Suppression fichier +if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes') +{ + $file = $upload_dir . "/" . urldecode($_GET["urlfile"]); + dol_delete_file($file); + $mesg = '
'.$langs->trans("FileWasRemoved").'
'; +} + + + + + +/******************************************************************* +* PAGE +* +* Put here all code to do according to value of "action" parameter +********************************************************************/ + +llxHeader(); + +$form=new Form($db); + +print_fiche_titre($langs->trans("ECMArea")); + + + + +// End of page +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/ecm/pre.inc.php b/htdocs/ecm/pre.inc.php new file mode 100644 index 00000000000..a3cf834e3ca --- /dev/null +++ b/htdocs/ecm/pre.inc.php @@ -0,0 +1,35 @@ + + */ + +/** + \file htdocs/ecm/pre.inc.php + \ingroup ecm + \brief File to manage left menu for ecm module + \version $Id$ +*/ + +require ("../main.inc.php"); + +$user->getrights('ecm'); + +function llxHeader($head = "", $title="", $help_url='') +{ + global $conf,$langs; + $langs->load("ecm"); + $langs->load("bills"); + $langs->load("propal"); + + top_menu($head, $title); + + $menu = new Menu(); + + $menu->add(DOL_URL_ROOT."/ecm/index.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("MenuECM")); + $menu->add_submenu(DOL_URL_ROOT."/ecm/docmine.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsMine")); + $menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsThirdParties")); + $menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsInvoices")); + $menu->add_submenu(DOL_URL_ROOT."/ecm/docother.php?mainmenu=ecm&idmenu=".$_SESSION["idmenu"], $langs->trans("DocsProposals")); + + left_menu($menu->liste, $help_url); +} +?> diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index 5057d2699c1..78061dabaf0 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -116,7 +116,7 @@ class MenuLeft { { $langs->load("users"); - if($user->admin) + if ($user->admin) { $langs->load("admin"); @@ -707,7 +707,6 @@ class MenuLeft { { if ($conf->projet->enabled) { - $langs->load("admin"); $langs->load("projects"); $newmenu->add(DOL_URL_ROOT."/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire); $newmenu->add_submenu(DOL_URL_ROOT."/comm/clients.php?leftmenu=projects", $langs->trans("NewProject"), 1, $user->rights->projet->creer); @@ -730,7 +729,6 @@ class MenuLeft { if ($conf->mailing->enabled) { - $langs->load("admin"); $langs->load("mails"); $newmenu->add(DOL_URL_ROOT."/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire); diff --git a/htdocs/includes/menus/barre_left/eldy_frontoffice.php b/htdocs/includes/menus/barre_left/eldy_frontoffice.php index a254d611b45..669ebb9c669 100644 --- a/htdocs/includes/menus/barre_left/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_frontoffice.php @@ -708,7 +708,6 @@ class MenuLeft { if ($conf->mailing->enabled) { - $langs->load("admin"); $langs->load("mails"); /* $newmenu->add(DOL_URL_ROOT."/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire); diff --git a/htdocs/includes/menus/barre_top/eldy_backoffice.php b/htdocs/includes/menus/barre_top/eldy_backoffice.php index 2466f111fa4..df94a0698da 100644 --- a/htdocs/includes/menus/barre_top/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_top/eldy_backoffice.php @@ -320,7 +320,7 @@ class MenuTop { // Members if ($conf->adherent->enabled) { - $langs->load("members"); + // $langs->load("members"); Added in main file to increase $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members") @@ -353,7 +353,9 @@ class MenuTop { // Define idsel if (! empty($_SESSION['idmenu']) && $tabMenu[$i]['rowid'] == $_SESSION['idmenu']) $idsel='id="sel" '; else $idsel=''; - print 'atarget?" target=$this->atarget":"").'>'.$tabMenu[$i]['titre'].''; + print 'atarget?" target=$this->atarget":"").'>'; + print $tabMenu[$i]['titre']; + print ''; } else { diff --git a/htdocs/includes/menus/barre_top/eldy_frontoffice.php b/htdocs/includes/menus/barre_top/eldy_frontoffice.php index 8db9f0b3129..abd1e0169e1 100644 --- a/htdocs/includes/menus/barre_top/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_top/eldy_frontoffice.php @@ -288,7 +288,7 @@ class MenuTop { // Members if ($conf->adherent->enabled) { - $langs->load("members"); + // $langs->load("members"); Added in main file to increase $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members") diff --git a/htdocs/includes/modules/DolibarrModules.class.php b/htdocs/includes/modules/DolibarrModules.class.php index 26a5b5798f8..eb4e86a4b1d 100644 --- a/htdocs/includes/modules/DolibarrModules.class.php +++ b/htdocs/includes/modules/DolibarrModules.class.php @@ -200,70 +200,70 @@ class DolibarrModules } - /** - \brief Retourne le nom traduit du module si la traduction existe dans admin.lang, - sinon le nom defini par defaut dans le module. - \return string Nom du module traduit - */ - function getName() - { - global $langs; - $langs->load("admin"); - - if ($langs->trans("Module".$this->numero."Name") != ("Module".$this->numero."Name")) - { - // Si traduction du nom du module existe - return $langs->trans("Module".$this->numero."Name"); - } - else - { - // Si traduction du nom du module n'existe pas, on prend definition en dur dans module - return $this->name; - } - } + /** + \brief Retourne le nom traduit du module si la traduction existe dans admin.lang, + sinon le nom defini par defaut dans le module. + \return string Nom du module traduit + */ + function getName() + { + global $langs; + $langs->load("admin"); + + if ($langs->trans("Module".$this->numero."Name") != ("Module".$this->numero."Name")) + { + // Si traduction du nom du module existe + return $langs->trans("Module".$this->numero."Name"); + } + else + { + // Si traduction du nom du module n'existe pas, on prend definition en dur dans module + return $this->name; + } + } - /** - \brief Retourne la description traduite du module si la traduction existe dans admin.lang, - sinon la description definie par defaut dans le module. - \return string Nom du module traduit - */ - function getDesc() - { - global $langs; - $langs->load("admin"); - - if ($langs->trans("Module".$this->numero."Desc") != ("Module".$this->numero."Desc")) - { - // Si traduction de la description du module existe - return $langs->trans("Module".$this->numero."Desc"); - } - else - { - // Si traduction de la description du module n'existe pas, on prend definition en dur dans module - return $this->description; - } - } + /** + \brief Retourne la description traduite du module si la traduction existe dans admin.lang, + sinon la description definie par defaut dans le module. + \return string Nom du module traduit + */ + function getDesc() + { + global $langs; + $langs->load("admin"); + + if ($langs->trans("Module".$this->numero."Desc") != ("Module".$this->numero."Desc")) + { + // Si traduction de la description du module existe + return $langs->trans("Module".$this->numero."Desc"); + } + else + { + // Si traduction de la description du module n'existe pas, on prend definition en dur dans module + return $this->description; + } + } - /** - \brief Retourne la version du module. - Pour les modules a l'etat 'experimental', retourne la traduction de 'experimental' - Pour les modules 'dolibarr', retourne la version de Dolibarr - Pour les autres modules, retourne la version du module - \return string Version du module - */ - function getVersion() - { - global $langs; - $langs->load("admin"); - - if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); - elseif ($this->version == 'development') return $langs->trans("VersionDevelopment"); - elseif ($this->version == 'dolibarr') return DOL_VERSION; - elseif ($this->version) return $this->version; - else return $langs->trans("VersionUnknown"); - } + /** + \brief Retourne la version du module. + Pour les modules a l'etat 'experimental', retourne la traduction de 'experimental' + Pour les modules 'dolibarr', retourne la version de Dolibarr + Pour les autres modules, retourne la version du module + \return string Version du module + */ + function getVersion() + { + global $langs; + $langs->load("admin"); + + if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); + elseif ($this->version == 'development') return $langs->trans("VersionDevelopment"); + elseif ($this->version == 'dolibarr') return DOL_VERSION; + elseif ($this->version) return $this->version; + else return $langs->trans("VersionUnknown"); + } /** @@ -279,7 +279,6 @@ class DolibarrModules $sql .= " WHERE numero=".$this->numero." AND active = 1"; $resql = $this->db->query($sql); - if ($resql) { $num = $this->db->num_rows($resql); @@ -294,7 +293,6 @@ class DolibarrModules $this->db->free($resql); } - if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); elseif ($this->version == 'development') return $langs->trans("VersionDevelopment"); elseif ($this->version == 'dolibarr') return DOL_VERSION; diff --git a/htdocs/includes/modules/modECM.class.php b/htdocs/includes/modules/modECM.class.php index 6e5984ced75..a35d6fa6e0a 100644 --- a/htdocs/includes/modules/modECM.class.php +++ b/htdocs/includes/modules/modECM.class.php @@ -101,7 +101,7 @@ class modECM extends DolibarrModules $this->menu[$r]=array('fk_menu'=>0, 'type'=>'top', - 'titre'=>'ECM', + 'titre'=>'MenuECM(dotnoloadlang)', 'mainmenu'=>'ecm', 'leftmenu'=>'', 'url'=>'/ecm/index.php', diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 482257eb217..598669da0fd 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -174,6 +174,7 @@ ModuleFamilyOther=Other ModuleFamilyTechnic=Tools or System Modules ModuleFamilyExperimental=Experimental modules ModuleFamilyFinancial=Financial Modules (Accountancy/Treasury) +ModuleFamilyECM=ECM MenuHandlers=Menu handlers MenuAdmin=Menu editor ThisIsProcessToFollow=This is setup to process: @@ -271,6 +272,10 @@ Module2200Name=Droit de pr Module2200Desc=Gestion du droit de prêts Module2300Name=Menus Module2300Desc=Menus' management +Module2400Name=Agenda +Module2400Desc=Agenda and actions management +Module2500Name=Electronic Content Management +Module2500Desc=Save and share documents Permission11=Read invoices Permission12=Create invoices Permission13=Modify invoices diff --git a/htdocs/langs/en_US/ecm.lang b/htdocs/langs/en_US/ecm.lang new file mode 100644 index 00000000000..203f8858cb7 --- /dev/null +++ b/htdocs/langs/en_US/ecm.lang @@ -0,0 +1,7 @@ +# Dolibarr language file - en_US - ecm +MenuECM=Documents +DocsMine=My documents +DocsThirdParties=Documents third parties +DocsInvoices=Documents invoices +DocsProposals=Documents proposals +ECMArea=Electronic Content Management area \ No newline at end of file diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 322148c6baa..7b5313c87f3 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -411,6 +411,7 @@ TotalWoman=Total TotalMan=Total YouCanChangeValuesForThisListFromDictionnarySetup=You can change values for this list from menu setup - dictionnary Color=Color +MenuECM=Documents # Week day Monday=Monday Tuesday=Tuesday diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 65c8cb5d298..0e151257a3a 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -173,6 +173,7 @@ ModuleFamilyOther=Autre ModuleFamilyTechnic=Modules outils ou système ModuleFamilyExperimental=Modules expérimentaux (ne pas utiliser en production) ModuleFamilyFinancial=Modules financiers (Compta/trésorerie) +ModuleFamilyECM=GED MenuHandlers=Gestionnaires menu MenuAdmin=Edition menu ThisIsProcessToFollow=Voici la procédure à suivre: @@ -270,6 +271,10 @@ Module2200Name=Droit de pr Module2200Desc=Gestion du droit de prêts Module2300Name=Menus Module2300Desc=Administration des menus par base de données +Module2400Name=Agenda +Module2400Desc=Gestion de l'agenda et des actions +Module2500Name=Gestion Electronique de Document +Module2500Desc=Permet de stocker et administrer une base de documents Permission11=Consulter les factures Permission12=Créer les factures Permission13=Modifier les factures diff --git a/htdocs/langs/fr_FR/ecm.lang b/htdocs/langs/fr_FR/ecm.lang new file mode 100644 index 00000000000..3de8206420b --- /dev/null +++ b/htdocs/langs/fr_FR/ecm.lang @@ -0,0 +1,7 @@ +# Dolibarr language file - fr_FR - ecm +MenuECM=Documents +DocsMine=Mes documents +DocsThirdParties=Documents tiers +DocsInvoices=Documents factures +DocsProposals=Documents propositions +ECMArea=Espace Gestion de documents \ No newline at end of file diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 03445cadf3f..140fd9e0be4 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -413,6 +413,7 @@ TotalWoman=Totale TotalMan=Total YouCanChangeValuesForThisListFromDictionnarySetup=Vous pouvez changer ces valeurs depuis le menu configuration - dictionnaires Color=Couleur +MenuECM=Documents # Week day Monday=Lundi Tuesday=Mardi diff --git a/htdocs/lib/menubase.class.php b/htdocs/lib/menubase.class.php index a864fbd3419..0383b9c6f30 100644 --- a/htdocs/lib/menubase.class.php +++ b/htdocs/lib/menubase.class.php @@ -523,7 +523,15 @@ class Menubase if ($this->verifConstraint($objm->rowid)) { - $langs->load($objm->langs); + $title=$objm->titre; + if (! eregi('\(dotnoloadlang\)$',$title)) + { + if (! empty($objm->langs)) $langs->load($objm->langs); + } + else + { + $title=eregi_replace('\(dotnoloadlang\)$','',$title); + } $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == $objm->mainmenu) @@ -540,14 +548,14 @@ class Menubase eval($str); } - if(eregi("/",$objm->titre)) + if(eregi("/",$title)) { - $tab_titre = explode("/",$objm->titre); + $tab_titre = explode("/",$title); $chaine = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]); } else { - $chaine = $langs->trans($objm->titre); + $chaine = $langs->trans($title); } $tabMenu[$b]['rowid'] = $objm->rowid; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 95996d846e9..ee42cd53055 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -751,7 +751,7 @@ function top_menu($head, $title="", $target="") * Si la constante MAIN_NEED_UPDATE est definie (par le script de migration sql en general), c'est que * les donnees ont besoin d'un remaniement. Il faut passer le update.php */ - if (isset($conf->global->MAIN_NEED_UPDATE) && $conf->global->MAIN_NEED_UPDATE) + if (! empty($conf->global->MAIN_NEED_UPDATE)) { $langs->load("admin"); print '
'."\n"; diff --git a/htdocs/translate.class.php b/htdocs/translate.class.php index 0e035162dd1..7af423aa472 100644 --- a/htdocs/translate.class.php +++ b/htdocs/translate.class.php @@ -1,7 +1,7 @@ - * Copyright (C) 2004-2005 Destailleur Laurent + * Copyright (C) 2004-2008 Destailleur Laurent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,6 +21,7 @@ /** \file htdocs/translate.class.php \brief Fichier de la classe de traduction + \author Eric Seigne \author Laurent Destailleur \version $Id$ */ @@ -153,7 +154,15 @@ class Translate { */ function Load($domain,$alt=0) { - if (! empty($this->tab_loaded[$domain])) { return; } // Le fichier de ce domaine est deja charge + // Check parameters + if (empty($domain)) + { + dolibarr_syslog("Tranlsate::Load ErrorWrongParameters",LOG_WARNING); + return; + } + + // Check cache + if (! empty($this->tab_loaded[$domain])) { return; } // Le fichier de ce domaine est deja charge // Repertoire de traduction $scandir = $this->dir."/".$this->defaultlang; @@ -168,15 +177,15 @@ class Translate { elseif (eregi('^en',$this->defaultlang) && $this->defaultlang != 'en_US') $scandiralt = $this->dir."/en_US"; else $scandiralt = $this->dir."/en_US"; - $file_lang = $scandiralt . "/$domain.lang"; + $file_lang = $scandiralt . "/".$domain.".lang"; $filelangexists=is_file($file_lang); $alt=1; } + dolibarr_syslog("Translate::Load read file ".$file_lang); + if ($filelangexists) { - //dolibarr_syslog("Translate::Load read file ".$file_lang); - // Enable cache of lang file in session (faster but need more memory) // Speed gain: 40ms - Memory overusage: 200ko (Size of session cache file) $enablelangcacheinsession=false;