diff --git a/htdocs/includes/menus/barre_top/eldy_backoffice.php b/htdocs/includes/menus/barre_top/eldy_backoffice.php index fc4af571dc6..cd854fb3561 100644 --- a/htdocs/includes/menus/barre_top/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_top/eldy_backoffice.php @@ -18,15 +18,15 @@ */ /** - \file htdocs/includes/menus/barre_top/eldy_backoffice.php - \brief Gestionnaire nomme eldy du menu du haut - \version $Id$ - - \remarks La construction d'un gestionnaire pour le menu du haut est simple: - \remarks Toutes les entrees de menu a faire apparaitre dans la barre du haut - \remarks doivent etre affichees par ... - \remarks ou si menu selectionne ... -*/ + * \file htdocs/includes/menus/barre_top/eldy_backoffice.php + * \brief Gestionnaire nomme eldy du menu du haut + * \version $Id$ + * + * \remarks La construction d'un gestionnaire pour le menu du haut est simple: + * \remarks Toutes les entrees de menu a faire apparaitre dans la barre du haut + * \remarks doivent etre affichees par ... + * \remarks ou si menu selectionne ... + */ /** @@ -35,134 +35,134 @@ */ class MenuTop { - var $require_left=array("eldy_backoffice"); // Si doit etre en phase avec un gestionnaire de menu gauche particulier - var $hideifnotallowed=false; // Put 0 for back office menu, 1 for front office menu + var $require_left=array("eldy_backoffice"); // Si doit etre en phase avec un gestionnaire de menu gauche particulier + var $hideifnotallowed=false; // Put 0 for back office menu, 1 for front office menu - var $atarget=""; // Valeur du target a utiliser dans les liens + var $atarget=""; // Valeur du target a utiliser dans les liens - /** - * \brief Constructeur - * \param db Handler d'acces base de donnee - */ - function MenuTop($db) - { - $this->db=$db; - } + /** + * \brief Constructeur + * \param db Handler d'acces base de donnee + */ + function MenuTop($db) + { + $this->db=$db; + } - /** - * \brief Affiche le menu - */ - function showmenu() - { - global $user,$conf,$langs,$dolibarr_main_db_name;; + /** + * \brief Affiche le menu + */ + function showmenu() + { + global $user,$conf,$langs,$dolibarr_main_db_name;; - // On sauve en session le menu principal choisi + // On sauve en session le menu principal choisi if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"]; if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"]; - $_SESSION["leftmenuopened"]=""; + $_SESSION["leftmenuopened"]=""; - print ''; + print '
'; - // Home - $class=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "home") - { - $class='class="tmenusel"'; $_SESSION['idmenu']=''; - } - else - { - $class = 'class="tmenu"'; - } - $idsel='id="home" '; - print ''; + // Home + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "home") + { + $class='class="tmenusel"'; $_SESSION['idmenu']=''; + } + else + { + $class = 'class="tmenu"'; + } + $idsel='id="home" '; + print ''; - // Third parties - if ($conf->societe->enabled || $conf->fournisseur->enabled) - { - $langs->load("companies"); - $langs->load("suppliers"); + // Third parties + if ($conf->societe->enabled || $conf->fournisseur->enabled) + { + $langs->load("companies"); + $langs->load("suppliers"); - $class=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies") - { - $class='class="tmenusel"'; $_SESSION['idmenu']=''; - } - else - { - $class = 'class="tmenu"'; - } - - $idsel='id="companies" '; - if (($conf->societe->enabled && $user->rights->societe->lire) - || ($conf->fournisseur->enabled && $user->rights->fournisseur->lire)) + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies") { - print ''; + $class='class="tmenusel"'; $_SESSION['idmenu']=''; } else { - if (! $this->hideifnotallowed) print ''; + $class = 'class="tmenu"'; + } + + $idsel='id="companies" '; + if (($conf->societe->enabled && $user->rights->societe->lire) + || ($conf->fournisseur->enabled && $user->rights->fournisseur->lire)) + { + print ''; + } + else + { + if (! $this->hideifnotallowed) print ''; } } - // Products-Services - if ($conf->produit->enabled || $conf->service->enabled) - { - $langs->load("products"); + // Products-Services + if ($conf->produit->enabled || $conf->service->enabled) + { + $langs->load("products"); - $class=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "products") - { - $class='class="tmenusel"'; $_SESSION['idmenu']=''; - } - else - { - $class = 'class="tmenu"'; - } - $chaine=""; - if ($conf->produit->enabled) { $chaine.=$langs->trans("Products"); } - if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; } - if ($conf->service->enabled) { $chaine.=$langs->trans("Services"); } + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "products") + { + $class='class="tmenusel"'; $_SESSION['idmenu']=''; + } + else + { + $class = 'class="tmenu"'; + } + $chaine=""; + if ($conf->produit->enabled) { $chaine.=$langs->trans("Products"); } + if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; } + if ($conf->service->enabled) { $chaine.=$langs->trans("Services"); } - $idsel='id="products" '; - if ($user->rights->produit->lire) - { - print ''; - } - else - { - if (! $this->hideifnotallowed) print ''; - } - } + $idsel='id="products" '; + if ($user->rights->produit->lire) + { + print ''; + } + else + { + if (! $this->hideifnotallowed) print ''; + } + } - // Commercial - /*$showcommercial=0; - if ($conf->societe->enabled) $showcommercial=1; - if ($conf->propal->enabled) $showcommercial=1; - if ($conf->commande->enabled) $showcommercial=1; - if ($conf->contrat->enabled) $showcommercial=1; - if ($conf->ficheinter->enabled) $showcommercial=1; - if ($showcommercial)*/ + // Commercial + /*$showcommercial=0; + if ($conf->societe->enabled) $showcommercial=1; + if ($conf->propal->enabled) $showcommercial=1; + if ($conf->commande->enabled) $showcommercial=1; + if ($conf->contrat->enabled) $showcommercial=1; + if ($conf->ficheinter->enabled) $showcommercial=1; + if ($showcommercial)*/ if ($conf->commercial->enabled) - { - $langs->load("commercial"); + { + $langs->load("commercial"); - $class=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "commercial") - { - $class='class="tmenusel"'; $_SESSION['idmenu']=''; - } - else - { - $class = 'class="tmenu"'; - } + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "commercial") + { + $class='class="tmenusel"'; $_SESSION['idmenu']=''; + } + else + { + $class = 'class="tmenu"'; + } - $idsel='id="commercial" '; - if($user->rights->societe->lire) + $idsel='id="commercial" '; + if($user->rights->societe->lire) { print ''; } @@ -172,227 +172,226 @@ class MenuTop { } } - // Financial - if ($conf->compta->enabled || $conf->comptaexpert->enabled || $conf->banque->enabled - || $conf->facture->enabled) - { - $langs->load("compta"); + // Financial + if ($conf->compta->enabled || $conf->comptaexpert->enabled || $conf->banque->enabled + || $conf->facture->enabled) + { + $langs->load("compta"); - $class=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy") - { - $class='class="tmenusel"'; $_SESSION['idmenu']=''; - } - else - { - $class = 'class="tmenu"'; - } + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy") + { + $class='class="tmenusel"'; $_SESSION['idmenu']=''; + } + else + { + $class = 'class="tmenu"'; + } - $idsel='id="accountancy" '; - if ($user->rights->compta->resultat->lire || $user->rights->comptaexpert->plancompte->lire - || $user->rights->facture->lire || $user->rights->banque->lire) - { - print ''; - } - else - { - if (! $this->hideifnotallowed) print ''; - } - } + $idsel='id="accountancy" '; + if ($user->rights->compta->resultat->lire || $user->rights->comptaexpert->plancompte->lire + || $user->rights->facture->lire || $user->rights->banque->lire) + { + print ''; + } + else + { + if (! $this->hideifnotallowed) print ''; + } + } - // Projects - if ($conf->projet->enabled) - { - $langs->load("projects"); + // Projects + if ($conf->projet->enabled) + { + $langs->load("projects"); - $class=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "project") - { - $class='class="tmenusel"'; $_SESSION['idmenu']=''; - } - else - { - $class = 'class="tmenu"'; - } + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "project") + { + $class='class="tmenusel"'; $_SESSION['idmenu']=''; + } + else + { + $class = 'class="tmenu"'; + } - $idsel='id="project" '; - if ($user->rights->projet->lire) - { - print ''; - } - else - { - if (! $this->hideifnotallowed) print ''; - } - } + $idsel='id="project" '; + if ($user->rights->projet->lire) + { + print ''; + } + else + { + if (! $this->hideifnotallowed) print ''; + } + } - // Tools - if ($conf->mailing->enabled || $conf->export->enabled || $conf->global->MAIN_MODULE_IMPORT || $conf->global->MAIN_MODULE_DOMAIN) - { - $langs->load("other"); + // Tools + if ($conf->mailing->enabled || $conf->export->enabled || $conf->global->MAIN_MODULE_IMPORT || $conf->global->MAIN_MODULE_DOMAIN) + { + $langs->load("other"); - $class=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "tools") - { - $class='class="tmenusel"'; $_SESSION['idmenu']=''; - } - else - { - $class = 'class="tmenu"'; - } + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "tools") + { + $class='class="tmenusel"'; $_SESSION['idmenu']=''; + } + else + { + $class = 'class="tmenu"'; + } - $idsel='id="tools" '; - if ($user->rights->mailing->lire || $user->rights->bookmark->lire || $user->rights->export->lire) - { - print ''; - } - else - { - if (! $this->hideifnotallowed) print ''; - } - } + $idsel='id="tools" '; + if ($user->rights->mailing->lire || $user->rights->bookmark->lire || $user->rights->export->lire) + { + print ''; + } + else + { + if (! $this->hideifnotallowed) print ''; + } + } - // Telephonie - if (! empty($conf->telephonie->enabled) && $user->rights->telephonie->lire) - { - $class=""; - if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"])) - { - $class='class="tmenusel"'; $_SESSION['idmenu']=''; - } - else - { - $class = 'class="tmenu"'; - } + // Telephonie + if (! empty($conf->telephonie->enabled) && $user->rights->telephonie->lire) + { + $class=""; + if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenusel"'; $_SESSION['idmenu']=''; + } + else + { + $class = 'class="tmenu"'; + } - $idsel='id="telephonie" '; - print ''; - } + $idsel='id="telephonie" '; + print ''; + } - // Energie - if (! empty($conf->energie->enabled)) - { - $langs->load("energy"); - $class=""; - if (ereg("^".DOL_URL_ROOT."\/energie\/",$_SERVER["PHP_SELF"])) - { - $class='class="tmenusel"'; $_SESSION['idmenu']=''; - } - else - { - $class = 'class="tmenu"'; - } + // Energie + if (! empty($conf->energie->enabled)) + { + $langs->load("energy"); + $class=""; + if (ereg("^".DOL_URL_ROOT."\/energie\/",$_SERVER["PHP_SELF"])) + { + $class='class="tmenusel"'; $_SESSION['idmenu']=''; + } + else + { + $class = 'class="tmenu"'; + } - $idsel='id="energie" '; - print ''; - } + $idsel='id="energie" '; + print ''; + } // OSCommerce 1 - if (! empty($conf->boutique->enabled)) - { - $langs->load("shop"); + if (! empty($conf->boutique->enabled)) + { + $langs->load("shop"); - $class=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") - { - $class='class="tmenusel"'; $_SESSION['idmenu']=''; - } - else - { - $class = 'class="tmenu"'; - } + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") + { + $class='class="tmenusel"'; $_SESSION['idmenu']=''; + } + else + { + $class = 'class="tmenu"'; + } - $idsel='id="shop" '; - print ''; - } + $idsel='id="shop" '; + print ''; + } - // OSCommerce WS - if (! empty($conf->oscommercews->enabled)) - { - $langs->load("shop"); + // OSCommerce WS + if (! empty($conf->oscommercews->enabled)) + { + $langs->load("shop"); - $class=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") - { - $class='class="tmenusel"'; $_SESSION['idmenu']=''; - } - else - { - $class = 'class="tmenu"'; - } + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") + { + $class='class="tmenusel"'; $_SESSION['idmenu']=''; + } + else + { + $class = 'class="tmenu"'; + } - $idsel='id="shop" '; - print ''; - } + $idsel='id="shop" '; + print ''; + } - // Members - if ($conf->adherent->enabled) - { - // $langs->load("members"); Added in main file + // Members + if ($conf->adherent->enabled) + { + // $langs->load("members"); Added in main file - $class=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members") - { - $class='class="tmenusel"'; $_SESSION['idmenu']=''; - } - else - { - $class = 'class="tmenu"'; - } + $class=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members") + { + $class='class="tmenusel"'; $_SESSION['idmenu']=''; + } + else + { + $class = 'class="tmenu"'; + } - $idsel='id="members" '; - if ($user->rights->adherent->lire) - { - print ''; - } - else - { - if (! $this->hideifnotallowed) print ''; - } - } - - // Affichage des menus personnalises - require_once(DOL_DOCUMENT_ROOT."/core/menubase.class.php"); + $idsel='id="members" '; + if ($user->rights->adherent->lire) + { + print ''; + } + else + { + if (! $this->hideifnotallowed) print ''; + } + } - $menuArbo = new Menubase($this->db,'eldy','top'); - $tabMenu = $menuArbo->menuTopCharger(0,$_SESSION['mainmenu'],'eldy'); - - for($i=0; $i'; - print $tabMenu[$i]['titre']; - print ''; - } - else - { - if (! $this->hideifnotallowed) print ''; - } - } - } + // Affichage des menus personnalises + require_once(DOL_DOCUMENT_ROOT."/core/menubase.class.php"); + $menuArbo = new Menubase($this->db,'eldy','top'); + $tabMenu = $menuArbo->menuTopCharger(0,$_SESSION['mainmenu'],'eldy'); - print '
atarget?" target=$this->atarget":"").'>'.$langs->trans("Home").'atarget?" target=$this->atarget":"").'>'.$langs->trans("Home").'atarget?" target=$this->atarget":"").'>'.$langs->trans("ThirdParties").''.$langs->trans("ThirdParties").'atarget?" target=$this->atarget":"").'>'.$langs->trans("ThirdParties").''.$langs->trans("ThirdParties").'atarget?" target=$this->atarget":"").'>'.$chaine.''.$chaine.'atarget?" target=$this->atarget":"").'>'.$chaine.''.$chaine.'atarget?" target=$this->atarget":"").'>'.$langs->trans("Commercial").'atarget?" target=$this->atarget":"").'>'.$langs->trans("MenuFinancial").''.$langs->trans("MenuFinancial").'atarget?" target=$this->atarget":"").'>'.$langs->trans("MenuFinancial").''.$langs->trans("MenuFinancial").'atarget?" target=$this->atarget":"").'>'.$langs->trans("Projects").''.$langs->trans("Projects").'atarget?" target=$this->atarget":"").'>'.$langs->trans("Projects").''.$langs->trans("Projects").'atarget?" target=$this->atarget":"").'>'.$langs->trans("Tools").''.$langs->trans("Tools").'atarget?" target=$this->atarget":"").'>'.$langs->trans("Tools").''.$langs->trans("Tools").'atarget?" target=$this->atarget":"").'>Telephonieatarget?" target=$this->atarget":"").'>Telephonieatarget?" target=$this->atarget":"").'>'.$langs->trans("Energy").'atarget?" target=$this->atarget":"").'>'.$langs->trans("Energy").'atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'atarget?" target=$this->atarget":"").'>'.$langs->trans("MenuMembers").''.$langs->trans("MenuMembers").'atarget?" target=$this->atarget":"").'>'.$langs->trans("MenuMembers").''.$langs->trans("MenuMembers").''.$tabMenu[$i]['titre'].'
'; - } + for($i=0; $i'; + print $tabMenu[$i]['titre']; + print ''; + } + else + { + if (! $this->hideifnotallowed) print ''.$tabMenu[$i]['titre'].''; + } + } + } + + print ''; + } } -?> +?> \ No newline at end of file diff --git a/htdocs/includes/menus/barre_top/eldy_frontoffice.php b/htdocs/includes/menus/barre_top/eldy_frontoffice.php index 9aa1c44a25f..4dbd1ba9a75 100644 --- a/htdocs/includes/menus/barre_top/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_top/eldy_frontoffice.php @@ -18,14 +18,14 @@ */ /** - \file htdocs/includes/menus/barre_top/eldy_frontoffice.php - \brief Gestionnaire nomme eldy du menu du haut - \version $Id$ - - \remarks La construction d'un gestionnaire pour le menu du haut est simple: - \remarks Toutes les entrees de menu a faire apparaitre dans la barre du haut - \remarks doivent etre affichees par ... - \remarks ou si menu selectionne ... + * \file htdocs/includes/menus/barre_top/eldy_frontoffice.php + * \brief Gestionnaire nomme eldy du menu du haut + * \version $Id$ + * + * \remarks La construction d'un gestionnaire pour le menu du haut est simple: + * \remarks Toutes les entrees de menu a faire apparaitre dans la barre du haut + * \remarks doivent etre affichees par ... + * \remarks ou si menu selectionne ... */