From bdfecdc751754b714fa94939481cc5b434cdb2ca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Jan 2009 13:06:34 +0000 Subject: [PATCH] Removed PHP warnings with E_ALL level --- .settings/org.eclipse.core.resources.prefs | 3 +- htdocs/core/menubase.class.php | 138 ++++---- htdocs/includes/boxes/box_actions.php | 12 +- htdocs/includes/boxes/box_factures_fourn.php | 20 +- htdocs/includes/boxes/modules_boxes.php | 18 +- .../menus/barre_top/eldy_backoffice.php | 68 ++-- .../menus/barre_top/eldy_frontoffice.php | 70 ++-- htdocs/index.php | 31 +- htdocs/lib/functions.lib.php | 4 +- htdocs/main.inc.php | 30 +- htdocs/master.inc.php | 20 +- htdocs/pre.inc.php | 320 +++++++++--------- htdocs/propal.class.php | 6 +- 13 files changed, 370 insertions(+), 370 deletions(-) diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index fdf993d7ae0..99783457a1a 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,4 @@ -#Tue Jan 20 00:15:44 CET 2009 +#Wed Jan 21 13:16:02 CET 2009 eclipse.preferences.version=1 encoding//dev/initdemo/initdemo.sql=UTF-8 encoding//dev/skeletons/modMyModule.class.php=ISO-8859-1 @@ -50,7 +50,6 @@ encoding//htdocs/includes/menus/barre_left/eldy_frontoffice.php=ISO-8859-1 encoding//htdocs/includes/menus/barre_top/empty.php=ISO-8859-1 encoding//htdocs/includes/menus/barre_top/rodolphe.php=ISO-8859-1 encoding//htdocs/includes/modules/DolibarrModules.class.php=ISO-8859-1 -encoding//htdocs/includes/modules/facture/pdf_crabe.modules.php=ISO-8859-1 encoding//htdocs/includes/modules/modAdherent.class.php=ISO-8859-1 encoding//htdocs/includes/modules/modBanque.class.php=ISO-8859-1 encoding//htdocs/includes/modules/modCategorie.class.php=ISO-8859-1 diff --git a/htdocs/core/menubase.class.php b/htdocs/core/menubase.class.php index 724b68fadcf..5c3dccd17b2 100644 --- a/htdocs/core/menubase.class.php +++ b/htdocs/core/menubase.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2009 Laurent Destailleur * * 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 @@ -34,9 +34,9 @@ class Menubase var $db; // To store db handler var $error; // To return error code (or message) var $errors=array(); // To return several error codes (or messages) - + var $id; - + var $menu_handler; var $module; var $type; @@ -48,12 +48,12 @@ class Menubase var $titre; var $langs; var $level; - var $leftmenu; //menu_handler=trim($this->menu_handler); $this->module=trim($this->module); @@ -92,10 +92,10 @@ class Menubase $this->perms=trim($this->perms); $this->user=trim($this->user); if (! $this->level) $this->level=0; - + // Check parameters // Put here code to add control on parameters values - + // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."menu("; $sql.= "menu_handler,"; @@ -134,7 +134,7 @@ class Menubase if ($resql) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."menu"); - + return $this->id; } else @@ -154,7 +154,7 @@ class Menubase function update($user=0, $notrigger=0) { global $conf, $langs; - + // Clean parameters $this->rowid=trim($this->rowid); $this->menu_handler=trim($this->menu_handler); @@ -204,8 +204,8 @@ class Menubase return 1; } - - + + /* * \brief Load object in memory from database * \param id id object @@ -235,7 +235,7 @@ class Menubase $sql.= " ".$this->db->pdate('t.tms').""; $sql.= " FROM ".MAIN_DB_PREFIX."menu as t"; $sql.= " WHERE t.rowid = ".$id; - + dolibarr_syslog("Menubase::fetch sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -243,9 +243,9 @@ class Menubase if ($this->db->num_rows($resql)) { $obj = $this->db->fetch_object($resql); - + $this->id = $obj->rowid; - + $this->menu_handler = $obj->menu_handler; $this->module = $obj->module; $this->type = $obj->type; @@ -263,7 +263,7 @@ class Menubase $this->tms = $obj->tms; } $this->db->free($resql); - + return 1; } else @@ -273,8 +273,8 @@ class Menubase return -1; } } - - + + /* * \brief Delete object in database * \param user User that delete @@ -283,10 +283,10 @@ class Menubase function delete($user) { global $conf, $langs; - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; $sql.= " WHERE rowid=".$this->id; - + dolibarr_syslog("Menubase::delete sql=".$sql); $resql = $this->db->query($sql); if (! $resql) @@ -295,11 +295,11 @@ class Menubase dolibarr_syslog("Menubase::delete ".$this->error, LOG_ERR); return -1; } - + return 1; } - + /** * \brief Initialise object with example values * \remarks id must be 0 if object instance is a specimen. @@ -307,7 +307,7 @@ class Menubase function initAsSpecimen() { $this->id=0; - + $this->menu_handler='all'; $this->module='specimen'; $this->type='top'; @@ -335,18 +335,18 @@ class Menubase * @param menu_handler Name of menu_handler used (auguria, eldy...) * @return array Menu array completed */ - function menuLeftCharger($newmenu, $mainmenu, $myleftmenu, $type_user, $menu_handler) + function menuLeftCharger($newmenu, $mainmenu, $myleftmenu, $type_user, $menu_handler) { global $langs, $user, $conf, $leftmenu; // To export to dol_eval function global $rights; // To export to dol_eval function - + $leftmenu=$myleftmenu; - + $this->newmenu = $newmenu; $this->leftmenu = $leftmenu; $tabMenu = array (); - + $sql = "SELECT m.rowid, m.fk_menu, m.url, m.titre, m.langs, m.perms, m.target, m.mainmenu, m.leftmenu,"; $sql.= " mo.action"; $sql.= " FROM " . MAIN_DB_PREFIX . "menu as m"; @@ -375,7 +375,7 @@ class Menubase // Define $chaine $chaine=""; $title = $langs->trans($menu['titre']); - if ($title == $menu['titre'] && ! empty($menu['langs'])) + if ($title == $menu['titre'] && ! empty($menu['langs'])) { $title = $langs->trans($menu['titre']); $langs->load($menu['langs']); @@ -388,8 +388,8 @@ class Menubase else { $chaine = $langs->trans($title); - } - + } + // Define $right $perms = true; if ($menu['perms']) @@ -397,7 +397,7 @@ class Menubase $perms = $this->verifCond($menu['perms']); //print "verifCond rowid=".$menu['rowid']." ".$menu['right'].":".$perms."
\n"; } - + // Define $constraint $constraint = true; if ($menu['action']) @@ -405,7 +405,7 @@ class Menubase $constraint = $this->verifCond($menu['action']); //print "verifCond rowid=".$menu['rowid']." ".$menu['action'].":".$constraint."
\n"; } - + if ($menu['rowid'] != $oldrowid && $oldrowid) $b++; // Break on new entry $oldrowid=$menu['rowid']; @@ -421,7 +421,7 @@ class Menubase else $tabMenu[$b][4] = ($tabMenu[$b][4] && $perms); if (! isset($tabMenu[$b][7])) $tabMenu[$b][7] = $constraint; else $tabMenu[$b][7] = ($tabMenu[$b][7] && $constraint); - + $a++; } $this->db->free($resql); @@ -430,8 +430,9 @@ class Menubase { dolibarr_print_error($this->db); } - + // Get menutopid + $menutopid=''; $sql = "SELECT m.rowid, m.titre, m.type"; $sql.= " FROM " . MAIN_DB_PREFIX . "menu as m"; $sql.= " WHERE m.mainmenu = '".$mainmenu."'"; @@ -440,9 +441,9 @@ class Menubase // It should have only one response $resql = $this->db->query($sql); $menutop = $this->db->fetch_object($resql); - $menutopid=$menutop->rowid; + if ($menutop) $menutopid=$menutop->rowid; $this->db->free($resql); - //print "menutopid=".$menutopid." sql=".$sql; + //print "menutopid=".$menutopid." sql=".$sql; // Now edit this->newmenu to add entries in tabMenu that are in parent sons $this->recur($tabMenu, $menutopid, 1); @@ -457,27 +458,27 @@ class Menubase * @param string $pere * @param string $rang */ - function recur($tab, $pere, $rang) + function recur($tab, $pere, $rang) { global $leftmenu; // To be exported in dol_eval function - + //print "xx".$pere; $leftmenu = $this->leftmenu; //ballayage du tableau for ($x = 0; $x < count($tab); $x++) { //si un element a pour pere : $pere - if ($tab[$x][1] == $pere) + if ($tab[$x][1] == $pere) { if ($tab[$x][7]) { $leftmenuConstraint = true; - if ($tab[$x][6]) + if ($tab[$x][6]) { $leftmenuConstraint = $this->verifCond($tab[$x][6]); } - if ($leftmenuConstraint) + if ($leftmenuConstraint) { // print "x".$pere." ".$tab[$x][6]; @@ -500,7 +501,7 @@ class Menubase global $user,$conf,$lang,$leftmenu; global $rights; // To export to dol_eval function - //print $strRights."
\n"; + //print $strRights."
\n"; if ($strRights != "") { $rights = true; @@ -516,12 +517,12 @@ class Menubase { $rights = true; } - + return $rights; } /** - * Return all values of mainmenu where leftmenu defined + * Return all values of mainmenu where leftmenu defined * in pre.inc.php must be overwritten completely by dynamic menu. * * @return array @@ -529,7 +530,7 @@ class Menubase function listeMainmenu() { $overwritemenufor=array(); - + $sql = "SELECT DISTINCT m.mainmenu"; $sql.= " FROM " . MAIN_DB_PREFIX . "menu as m"; $sql.= " WHERE m.menu_handler in ('".$this->menu_handler."','all')"; @@ -548,10 +549,10 @@ class Menubase { dolibarr_print_error($this->db); } - + return $overwritemenufor; } - + /** * \brief Load tabMenu array * \param type_user 0=Internal,1=External,2=All @@ -563,15 +564,15 @@ class Menubase { global $langs, $user, $conf; global $rights; // To export to dol_eval function - + $tabMenu=array(); - - $sql = "SELECT m.rowid, m.mainmenu, m.titre, m.url, m.langs, m.perms,"; + + $sql = "SELECT m.rowid, m.mainmenu, m.titre, m.url, m.langs, m.perms, m.target,"; $sql.= " mo.action"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."menu_const as mc ON m.rowid = mc.fk_menu"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."menu_constraint as mo ON mc.fk_constraint = mo.rowid"; - $sql.= " WHERE m.type = 'top'"; + $sql.= " WHERE m.type = 'top'"; $sql.= " AND m.menu_handler in('".$menu_handler."','all')"; if ($type_user == 0) $sql.= " AND m.user in (0,2)"; if ($type_user == 1) $sql.= " AND m.user in (1,2)"; @@ -590,18 +591,18 @@ class Menubase while ($a < $numa) { $objm = $this->db->fetch_object($resql); - + // Define $chaine $chaine=""; $title=$langs->trans($objm->titre); if ($title == $objm->titre) // Translation not found - { + { if (! empty($objm->langs)) { // If it seems there no translation, we load language file defined in menu entry table $langs->load($objm->langs); } - + if (eregi("/",$title)) { $tab_titre = explode("/",$title); @@ -610,28 +611,28 @@ class Menubase else { $chaine = $langs->trans($title); - } + } } else { $chaine=$title; } //print "x".$objm->titre."-".$chaine; - + // Define $right $perms = true; if ($objm->perms) { $perms = $this->verifCond($objm->perms); } - + // Define $constraint $constraint = true; if ($objm->action) { $constraint = $this->verifCond($objm->action); } - + if ($objm->rowid != $oldrowid && $oldrowid) $b++; // Break on new entry $oldrowid=$objm->rowid; @@ -639,15 +640,14 @@ class Menubase $tabMenu[$b]['mainmenu'] = $objm->mainmenu; $tabMenu[$b]['titre'] = $chaine; // Title $tabMenu[$b]['url'] = $objm->url; - $tabMenu[$b]['atarget'] = $this->atarget; - $tabMenu[$b]['class'] = $class; + $tabMenu[$b]['atarget'] = $objm->target; if (! isset($tabMenu[$b]['right'])) $tabMenu[$b]['right'] = $perms; else $tabMenu[$b]['right'] = ($tabMenu[$b]['right'] && $perms); if (! isset($tabMenu[$b]['enabled'])) $tabMenu[$b]['enabled'] = $constraint; else $tabMenu[$b]['enabled'] = ($tabMenu[$b]['enabled'] && $constraint); - - //var_dump($tabMenu); - $a++; + + //var_dump($tabMenu); + $a++; } } else @@ -671,15 +671,15 @@ function dol_eval($s) // Only global variables can be changed by eval function and returned to caller global $langs, $user, $conf; global $rights; - global $leftmenu; - + global $leftmenu; + // \todo // Warning. We must add code to exclude test if it contains = (affectation) that is not == (compare) - + //print $s."
\n"; eval($s); - - return 1; + + return 1; } ?> diff --git a/htdocs/includes/boxes/box_actions.php b/htdocs/includes/boxes/box_actions.php index 7a57b192b55..d0ceda1b1ac 100644 --- a/htdocs/includes/boxes/box_actions.php +++ b/htdocs/includes/boxes/box_actions.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -63,7 +63,7 @@ class box_actions extends ModeleBoxes { global $user, $langs, $db, $conf; $this->max=$max; - + include_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); $actionstatic=new ActionComm($db); @@ -89,13 +89,13 @@ class box_actions extends ModeleBoxes { $sql.= " ORDER BY a.datec DESC"; $sql.= $db->plimit($max, 0); - dolibarr_syslog("Box_actions::loadBox boxcode=".$boxcode." sql=".$sql); + dolibarr_syslog("Box_actions::loadBox sql=".$sql, LOG_DEBUG); $result = $db->query($sql); if ($result) { $now=gmmktime(); $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; - + $num = $db->num_rows($result); $i = 0; while ($i < $num) @@ -111,7 +111,7 @@ class box_actions extends ModeleBoxes { $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => ("task"), 'url' => DOL_URL_ROOT."/comm/action/fiche.php?id=".$objp->id); - + $this->info_box_contents[$i][1] = array('td' => 'align="left" nowrap="1"', 'text' => dolibarr_trunc($label,12), 'text2'=> $late, @@ -132,7 +132,7 @@ class box_actions extends ModeleBoxes { $i++; } - + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoActionsToDo")); } else { diff --git a/htdocs/includes/boxes/box_factures_fourn.php b/htdocs/includes/boxes/box_factures_fourn.php index ab2e584b51c..6eb06235adb 100644 --- a/htdocs/includes/boxes/box_factures_fourn.php +++ b/htdocs/includes/boxes/box_factures_fourn.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * * 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 @@ -36,7 +36,7 @@ class box_factures_fourn extends ModeleBoxes { var $db; var $param; - + var $info_box_head = array(); var $info_box_contents = array(); @@ -57,10 +57,10 @@ class box_factures_fourn extends ModeleBoxes { */ function loadBox($max=5) { - global $user, $langs, $db; + global $conf, $user, $langs, $db; $this->max=$max; - + include_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"); $facturestatic=new FactureFournisseur($db); @@ -93,23 +93,23 @@ class box_factures_fourn extends ModeleBoxes { { $num = $db->num_rows($result); $now=gmmktime(); - + $i = 0; $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; while ($i < $num) { $objp = $db->fetch_object($result); - $datelimite=$db->jdate($obj->datelimite); + $datelimite=$db->jdate($objp->datelimite); $datec=$db->jdate($objp->datec); - + $late = ''; if ($objp->paye == 0 && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dolibarr_print_date($datelimite,'day'))); $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid); - + $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->facnumber, 'text2'=> $late, @@ -124,10 +124,10 @@ class box_factures_fourn extends ModeleBoxes { $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)); - + $i++; } - + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpayedCustomerBills")); } else { diff --git a/htdocs/includes/boxes/modules_boxes.php b/htdocs/includes/boxes/modules_boxes.php index c5d67553703..5a3ebe2e99a 100644 --- a/htdocs/includes/boxes/modules_boxes.php +++ b/htdocs/includes/boxes/modules_boxes.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2009 Laurent Destailleur * * 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 @@ -34,7 +34,7 @@ class ModeleBoxes var $db; var $error=''; var $max=5; - + /* * \brief Constructeur */ @@ -104,7 +104,7 @@ class ModeleBoxes $var = true; dolibarr_syslog("modules_box::showBox ".get_Class($this)); - + // Define nbcol and nblines of the box to show $nbcol=0; if (isset($contents[0])) $nbcol=sizeof($contents[0]); @@ -158,7 +158,7 @@ class ModeleBoxes if (isset($contents[$i])) { $var=!$var; - + // TR if (isset($contents[$i][0]['tr'])) print ''; else print ''; @@ -171,7 +171,7 @@ class ModeleBoxes $tdparam=''; if (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td']; - if (!$contents[$i][$j]['text']) $contents[$i][$j]['text']=""; + if (empty($contents[$i][$j]['text'])) $contents[$i][$j]['text']=""; $texte=isset($contents[$i][$j]['text'])?$contents[$i][$j]['text']:''; $textewithnotags=eregi_replace('<[^>]+>','',$texte); $texte2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:''; @@ -194,7 +194,7 @@ class ModeleBoxes $logo=eregi_replace("^object_","",$contents[$i][$j]['logo']); print img_object($langs->trans("Show"),$logo); } - + $maxlength=$MAXLENGTHBOX; if (! empty($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength']; @@ -207,14 +207,14 @@ class ModeleBoxes if (eregi('^"; } print "\n"; } } - + // Complete line to max /* while ($i < $this->max) @@ -223,7 +223,7 @@ class ModeleBoxes print ' '; $i++; }*/ - + print "\n"; } diff --git a/htdocs/includes/menus/barre_top/eldy_backoffice.php b/htdocs/includes/menus/barre_top/eldy_backoffice.php index 0d205ce740c..38e6b8fb167 100644 --- a/htdocs/includes/menus/barre_top/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_top/eldy_backoffice.php @@ -25,7 +25,7 @@ \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 ... + \remarks ou si menu selectionne ... */ @@ -37,10 +37,10 @@ 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 $atarget=""; // Valeur du target a utiliser dans les liens - + /** * \brief Constructeur * \param db Handler d'acces base de donnee @@ -49,25 +49,25 @@ class MenuTop { { global $langs; $this->db=$db; - + $langs->setTransFromTab("Company",$langs->trans("ThirdParty")); $langs->setTransFromTab("NewCompany",$langs->trans("NewThirdParty")); } - - + + /** * \brief Affiche le menu */ function showmenu() { global $user,$conf,$langs,$dolibarr_main_db_name;; - + // 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"]=""; - + print ''; // Home @@ -89,7 +89,7 @@ class MenuTop { { $langs->load("companies"); $langs->load("suppliers"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies") { @@ -117,7 +117,7 @@ class MenuTop { if ($conf->produit->enabled || $conf->service->enabled) { $langs->load("products"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "products") { @@ -131,7 +131,7 @@ class MenuTop { 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) { @@ -154,7 +154,7 @@ class MenuTop { if ($conf->commercial->enabled) { $langs->load("commercial"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "commercial") { @@ -164,7 +164,7 @@ class MenuTop { { $class = 'class="tmenu"'; } - + $idsel='id="commercial" '; if($user->rights->societe->lire) { @@ -181,7 +181,7 @@ class MenuTop { || $conf->facture->enabled) { $langs->load("compta"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy") { @@ -191,7 +191,7 @@ class MenuTop { { $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) @@ -208,7 +208,7 @@ class MenuTop { if ($conf->projet->enabled) { $langs->load("projects"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "project") { @@ -218,7 +218,7 @@ class MenuTop { { $class = 'class="tmenu"'; } - + $idsel='id="project" '; if ($user->rights->projet->lire) { @@ -235,7 +235,7 @@ class MenuTop { || $conf->global->MAIN_MODULE_IMPORT || $conf->global->MAIN_MODULE_DOMAIN) { $langs->load("other"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "tools") { @@ -245,7 +245,7 @@ class MenuTop { { $class = 'class="tmenu"'; } - + $idsel='id="tools" '; if ($user->rights->mailing->lire || $user->rights->bookmark->lire || $user->rights->export->lire) { @@ -256,9 +256,9 @@ class MenuTop { if (! $this->hideifnotallowed) print ''; } } - + // Telephonie - if ($conf->telephonie->enabled && $user->rights->telephonie->lire) + if (! empty($conf->telephonie->enabled) && $user->rights->telephonie->lire) { $class=""; if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"])) @@ -275,7 +275,7 @@ class MenuTop { } // Energie - if ($conf->energie->enabled) + if (! empty($conf->energie->enabled)) { $langs->load("energy"); $class=""; @@ -291,12 +291,12 @@ class MenuTop { $idsel='id="energie" '; print ''; } - + // OSCommerce 1 - if ($conf->boutique->enabled) + if (! empty($conf->boutique->enabled)) { $langs->load("shop"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") { @@ -306,16 +306,16 @@ class MenuTop { { $class = 'class="tmenu"'; } - + $idsel='id="shop" '; print ''; } - + // OSCommerce WS - if ($conf->oscommercews->enabled) + if (! empty($conf->oscommercews->enabled)) { $langs->load("shop"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") { @@ -325,7 +325,7 @@ class MenuTop { { $class = 'class="tmenu"'; } - + $idsel='id="shop" '; print ''; } @@ -334,7 +334,7 @@ class MenuTop { if ($conf->adherent->enabled) { // $langs->load("members"); Added in main file - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members") { @@ -344,7 +344,7 @@ class MenuTop { { $class = 'class="tmenu"'; } - + $idsel='id="members" '; if ($user->rights->adherent->lire) { @@ -387,8 +387,8 @@ class MenuTop { } } } - - + + print '
'.$langs->trans("Tools").'atarget?" target=$this->atarget":"").'>'.$langs->trans("Energy").'atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'
'; } diff --git a/htdocs/includes/menus/barre_top/eldy_frontoffice.php b/htdocs/includes/menus/barre_top/eldy_frontoffice.php index cc6ae79ffe9..682c1a63b5b 100644 --- a/htdocs/includes/menus/barre_top/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_top/eldy_frontoffice.php @@ -25,7 +25,7 @@ \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 ... + \remarks ou si menu selectionne ... */ @@ -37,10 +37,10 @@ class MenuTop { var $require_left=array("eldy_frontoffice"); // Si doit etre en phase avec un gestionnaire de menu gauche particulier var $hideifnotallowed=true; // Put 0 for back office menu, 1 for front office menu - + var $atarget=""; // Valeur du target a utiliser dans les liens - + /** * \brief Constructeur * \param db Handler d'acces base de donnee @@ -49,25 +49,25 @@ class MenuTop { { global $langs; $this->db=$db; - + $langs->setTransFromTab("Company",$langs->trans("ThirdParty")); $langs->setTransFromTab("NewCompany",$langs->trans("NewThirdParty")); } - - + + /** * \brief Affiche le menu */ function showmenu() { global $user,$conf,$langs,$dolibarr_main_db_name;; - + // 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"]=""; - + print ''; // Home @@ -89,7 +89,7 @@ class MenuTop { { $langs->load("companies"); $langs->load("suppliers"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies") { @@ -117,7 +117,7 @@ class MenuTop { if ($conf->produit->enabled || $conf->service->enabled) { $langs->load("products"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "products") { @@ -131,7 +131,7 @@ class MenuTop { 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) { @@ -154,7 +154,7 @@ class MenuTop { if ($conf->commercial->enabled) { $langs->load("commercial"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "commercial") { @@ -164,7 +164,7 @@ class MenuTop { { $class = 'class="tmenu"'; } - + $idsel='id="commercial" '; if($user->rights->societe->lire) { @@ -181,7 +181,7 @@ class MenuTop { || $conf->facture->enabled) { $langs->load("compta"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy") { @@ -191,7 +191,7 @@ class MenuTop { { $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) @@ -208,7 +208,7 @@ class MenuTop { if ($conf->projet->enabled) { $langs->load("projects"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "project") { @@ -218,7 +218,7 @@ class MenuTop { { $class = 'class="tmenu"'; } - + $idsel='id="project" '; if ($user->rights->projet->lire) { @@ -235,7 +235,7 @@ class MenuTop { || $conf->global->MAIN_MODULE_IMPORT || $conf->global->MAIN_MODULE_DOMAIN) { $langs->load("other"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "tools") { @@ -245,7 +245,7 @@ class MenuTop { { $class = 'class="tmenu"'; } - + $idsel='id="tools" '; if ($user->rights->mailing->lire || $user->rights->bookmark->lire || $user->rights->export->lire) { @@ -256,9 +256,9 @@ class MenuTop { if (! $this->hideifnotallowed) print ''; } } - + // Telephonie - if ($conf->telephonie->enabled && $user->rights->telephonie->lire) + if (! empty($conf->telephonie->enabled) && $user->rights->telephonie->lire) { $class=""; if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"])) @@ -275,7 +275,7 @@ class MenuTop { } // Energie - if ($conf->energie->enabled) + if (! empty($conf->energie->enabled)) { $langs->load("energy"); $class=""; @@ -291,12 +291,12 @@ class MenuTop { $idsel='id="energie" '; print ''; } - + // OSCommerce 1 - if ($conf->boutique->enabled) + if (! empty($conf->boutique->enabled)) { $langs->load("shop"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") { @@ -306,16 +306,16 @@ class MenuTop { { $class = 'class="tmenu"'; } - + $idsel='id="shop" '; print ''; } - + // OSCommerce WS - if ($conf->oscommercews->enabled) + if (! empty($conf->oscommercews->enabled)) { $langs->load("shop"); - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") { @@ -325,16 +325,16 @@ class MenuTop { { $class = 'class="tmenu"'; } - + $idsel='id="shop" '; print ''; } - + // Members if ($conf->adherent->enabled) { // $langs->load("members"); Added in main file - + $class=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members") { @@ -344,7 +344,7 @@ class MenuTop { { $class = 'class="tmenu"'; } - + $idsel='id="members" '; if ($user->rights->adherent->lire) { @@ -387,8 +387,8 @@ class MenuTop { } } } - - + + print '
'.$langs->trans("Tools").'atarget?" target=$this->atarget":"").'>'.$langs->trans("Energy").'atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'
'; } diff --git a/htdocs/index.php b/htdocs/index.php index 112a47d07e7..a0b56cfadd5 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -124,17 +124,18 @@ if ($user->societe_id == 0) $var=true; // Condition à vérifier pour affichage de chaque ligne du tableau de bord - $conditions=array($conf->societe->enabled && $user->rights->societe->lire, - $conf->societe->enabled && $user->rights->societe->lire, - $conf->fournisseur->enabled && $user->rights->fournisseur->lire, - $conf->adherent->enabled && $user->rights->adherent->lire, - $conf->produit->enabled && $user->rights->produit->lire, - $conf->service->enabled && $user->rights->produit->lire, - $conf->propal->enabled && $user->rights->propale->lire, - $conf->commande->enabled && $user->rights->commande->lire, - $conf->facture->enabled && $user->rights->facture->lire, - $conf->telephonie->enabled && $user->rights->telephonie->lire, - $conf->societe->enabled && $user->rights->contrat->activer); + $conditions=array( + ! empty($conf->societe->enabled) && $user->rights->societe->lire, + ! empty($conf->societe->enabled) && $user->rights->societe->lire, + ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire, + ! empty($conf->adherent->enabled) && $user->rights->adherent->lire, + ! empty($conf->produit->enabled) && $user->rights->produit->lire, + ! empty($conf->service->enabled) && $user->rights->produit->lire, + ! empty($conf->propal->enabled) && $user->rights->propale->lire, + ! empty($conf->commande->enabled) && $user->rights->commande->lire, + ! empty($conf->facture->enabled) && $user->rights->facture->lire, + ! empty($conf->telephonie->enabled) && $user->rights->telephonie->lire, + ! empty($conf->societe->enabled) && $user->rights->contrat->activer); // Fichier des classes qui contiennent la methode load_state_board pour chaque ligne $includes=array(DOL_DOCUMENT_ROOT."/client.class.php", DOL_DOCUMENT_ROOT."/prospect.class.php", @@ -219,7 +220,7 @@ if ($user->societe_id == 0) "bills", "", "Contracts"); - + //print memory_get_usage()."
"; // Boucle et affiche chaque ligne du tableau @@ -585,7 +586,7 @@ if (sizeof($boxarray)) print ''."\n"; print ''; - + // Affichage colonne gauche print '\n"; // Affichage colonne droite print '
'."\n"; @@ -622,7 +623,7 @@ if (sizeof($boxarray)) print "'; - + print "\n\n"; print ''."\n"; print "\n"; } - + // Zone de recherche supplementaire if ($form_search) { @@ -921,7 +921,7 @@ function left_menu($menu_array, $helppagename='', $form_search='') } } - if ($conf->global->MAIN_SHOW_BUGTRACK_LINK == 1) + if (! empty($conf->global->MAIN_SHOW_BUGTRACK_LINK)) { // Lien vers le bugtrack $bugbaseurl='http://savannah.nongnu.org/bugs/?'; @@ -1020,18 +1020,18 @@ function llxFooter($foot='',$limitIEbug=1) if (sizeof($conf->logbuffer)) { print "\n"; - print "\n"; + print "End of log output -->\n"; } - + print "\n"; - if ($foot) print ''."\n"; + if ($foot) print ''."\n"; print "\n"; print "\n"; } diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index ab407d9cde4..f18dd8c688d 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -134,9 +134,9 @@ $conf->db->prefix = $dolibarr_main_db_prefix; if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation='latin1_swedish_ci'; $conf->db->dolibarr_main_db_collation=$dolibarr_main_db_collation; // Identifiant autres -$conf->main_authentication = $dolibarr_main_authentication; +$conf->main_authentication = empty($dolibarr_main_authentication)?'':$dolibarr_main_authentication; // Force https -$conf->main_force_https = $dolibarr_main_force_https; +$conf->main_force_https = empty($dolibarr_main_force_https)?'':$dolibarr_main_force_https; // Define charset for HTML Output (can set hidden value force_charset in conf.php file) if (empty($force_charset_do_notuse)) $force_charset_do_notuse='UTF-8'; $conf->character_set_client=strtoupper($force_charset_do_notuse); @@ -284,15 +284,15 @@ if (! defined('NOREQUIRESOC')) $mysoc->fax=$conf->global->MAIN_INFO_SOCIETE_FAX; $mysoc->url=$conf->global->MAIN_INFO_SOCIETE_WEB; // Anciens id prof - $mysoc->siren=$conf->global->MAIN_INFO_SIREN; - $mysoc->siret=$conf->global->MAIN_INFO_SIRET; - $mysoc->ape=$conf->global->MAIN_INFO_APE; - $mysoc->rcs=$conf->global->MAIN_INFO_RCS; + $mysoc->siren=empty($conf->global->MAIN_INFO_SIREN)?'':$conf->global->MAIN_INFO_SIREN; + $mysoc->siret=empty($conf->global->MAIN_INFO_SIRET)?'':$conf->global->MAIN_INFO_SIRET; + $mysoc->ape=empty($conf->global->MAIN_INFO_APE)?'':$conf->global->MAIN_INFO_APE; + $mysoc->rcs=empty($conf->global->MAIN_INFO_RCS)?'':$conf->global->MAIN_INFO_RCS; // Id prof génériques - $mysoc->profid1=$conf->global->MAIN_INFO_SIREN; - $mysoc->profid2=$conf->global->MAIN_INFO_SIRET; - $mysoc->profid3=$conf->global->MAIN_INFO_APE; - $mysoc->profid4=$conf->global->MAIN_INFO_RCS; + $mysoc->profid1=empty($conf->global->MAIN_INFO_SIREN)?'':$conf->global->MAIN_INFO_SIREN; + $mysoc->profid2=empty($conf->global->MAIN_INFO_SIRET)?'':$conf->global->MAIN_INFO_SIRET; + $mysoc->profid3=empty($conf->global->MAIN_INFO_APE)?'':$conf->global->MAIN_INFO_APE; + $mysoc->profid4=empty($conf->global->MAIN_INFO_RCS)?'':$conf->global->MAIN_INFO_RCS; $mysoc->tva_assuj=$conf->global->FACTURE_TVAOPTION; $mysoc->tva_intra=$conf->global->MAIN_INFO_TVAINTRA; $mysoc->capital=$conf->global->MAIN_INFO_CAPITAL; diff --git a/htdocs/pre.inc.php b/htdocs/pre.inc.php index 6172f905ac2..5acdb96f3a0 100644 --- a/htdocs/pre.inc.php +++ b/htdocs/pre.inc.php @@ -1,7 +1,7 @@ +/* Copyright (C) 2001-2007 Rodolphe Quiedeville * Copyright (C) 2003 Éric Seigne - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Guillaume Delecourt * @@ -21,180 +21,180 @@ */ /** - \file htdocs/pre.inc.php - \brief File to manage left menu for home page - \version $Id$ -*/ + \file htdocs/pre.inc.php + \brief File to manage left menu for home page + \version $Id$ + */ require ("./main.inc.php"); function llxHeader($head = "") { - global $user, $conf, $langs; + global $user, $conf, $langs; - top_menu($head); - - $menu = new Menu(); - - if ($conf->societe->enabled && $user->rights->societe->lire) - { - $langs->load("companies"); - $menu->add(DOL_URL_ROOT."/societe.php", $langs->trans("Companies")); - - if ($user->rights->societe->creer) - { + top_menu($head); + + $menu = new Menu(); + + if (! empty($conf->societe->enabled) && $user->rights->societe->lire) + { + $langs->load("companies"); + $menu->add(DOL_URL_ROOT."/societe.php", $langs->trans("Companies")); + + if ($user->rights->societe->creer) + { $menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create", $langs->trans("MenuNewCompany")); - } - - if(is_dir("societe/groupe")) - { - $menu->add_submenu(DOL_URL_ROOT."/societe/groupe/index.php", $langs->trans("MenuSocGroup")); - } - $menu->add_submenu(DOL_URL_ROOT."/contact/index.php",$langs->trans("Contacts")); - } + } - if ($conf->categorie->enabled) + if(is_dir("societe/groupe")) + { + $menu->add_submenu(DOL_URL_ROOT."/societe/groupe/index.php", $langs->trans("MenuSocGroup")); + } + $menu->add_submenu(DOL_URL_ROOT."/contact/index.php",$langs->trans("Contacts")); + } + + if (! empty($conf->categorie->enabled)) { $langs->load("categories"); $menu->add(DOL_URL_ROOT."/categories/index.php?type=0", $langs->trans("Categories")); } - - if ($conf->commercial->enabled && isset($user->rights->commercial->lire) && $user->rights->commercial->lire) - { - $langs->load("commercial"); - $menu->add(DOL_URL_ROOT."/comm/index.php",$langs->trans("Commercial")); - - $menu->add_submenu(DOL_URL_ROOT."/comm/clients.php",$langs->trans("Customers")); - $menu->add_submenu(DOL_URL_ROOT."/comm/prospect/prospects.php",$langs->trans("Prospects")); - - if ($user->rights->propale->lire) - { + + if (! empty($conf->commercial->enabled) && isset($user->rights->commercial->lire) && $user->rights->commercial->lire) + { + $langs->load("commercial"); + $menu->add(DOL_URL_ROOT."/comm/index.php",$langs->trans("Commercial")); + + $menu->add_submenu(DOL_URL_ROOT."/comm/clients.php",$langs->trans("Customers")); + $menu->add_submenu(DOL_URL_ROOT."/comm/prospect/prospects.php",$langs->trans("Prospects")); + + if ($user->rights->propale->lire) + { $langs->load("propal"); $menu->add_submenu(DOL_URL_ROOT."/comm/propal.php", $langs->trans("Prop")); - } - } - - if ($conf->compta->enabled || $conf->comptaexpert->enabled) - { - $langs->load("compta"); - $menu->add(DOL_URL_ROOT."/compta/index.php", $langs->trans("MenuFinancial")); - - if ($user->rights->facture->lire) { - $langs->load("bills"); - $menu->add_submenu(DOL_URL_ROOT."/compta/facture.php", $langs->trans("Bills")); - } - } - - if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) - { - $langs->trans("interventions"); - $menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions")); - } - - if (($conf->produit->enabled || $conf->service->enabled) && $user->rights->produit->lire) - { - $langs->load("products"); - $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"); } - $menu->add(DOL_URL_ROOT."/product/index.php", "$chaine"); - -/* - if ($conf->boutique->enabled) - { - if ($conf->boutique->livre->enabled) - { - $menu->add_submenu(DOL_URL_ROOT."/boutique/livre/index.php", "Livres"); - } + } + } - if ($conf->boutique->album->enabled) - { - $menu->add_submenu(DOL_URL_ROOT."/product/album/index.php", "Albums"); - } - } -*/ - } + if (! empty($conf->compta->enabled) || $conf->comptaexpert->enabled) + { + $langs->load("compta"); + $menu->add(DOL_URL_ROOT."/compta/index.php", $langs->trans("MenuFinancial")); + + if ($user->rights->facture->lire) { + $langs->load("bills"); + $menu->add_submenu(DOL_URL_ROOT."/compta/facture.php", $langs->trans("Bills")); + } + } + + if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) + { + $langs->trans("interventions"); + $menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions")); + } + + if (($conf->produit->enabled || $conf->service->enabled) && $user->rights->produit->lire) + { + $langs->load("products"); + $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"); } + $menu->add(DOL_URL_ROOT."/product/index.php", "$chaine"); + + /* + if ($conf->boutique->enabled) + { + if ($conf->boutique->livre->enabled) + { + $menu->add_submenu(DOL_URL_ROOT."/boutique/livre/index.php", "Livres"); + } + + if ($conf->boutique->album->enabled) + { + $menu->add_submenu(DOL_URL_ROOT."/product/album/index.php", "Albums"); + } + } + */ + } - if ($conf->commande->enabled && $user->rights->commande->lire) - { - $langs->load("orders"); - $menu->add(DOL_URL_ROOT."/commande/index.php", $langs->trans("Orders")); - } - - if ($conf->document->enabled) - { - $menu->add(DOL_URL_ROOT."/docs/index.php", $langs->trans("Documents")); - } - - if ($conf->expedition->enabled && $user->rights->expedition->lire) - { - $langs->load("sendings"); - $menu->add(DOL_URL_ROOT."/expedition/index.php", $langs->trans("Sendings")); - } - - if ($conf->mailing->enabled && $user->rights->mailing->lire) - { - $langs->load("mails"); - $menu->add(DOL_URL_ROOT."/comm/mailing/index.php",$langs->trans("EMailings")); - } - - if ($conf->telephonie->enabled) - { - $menu->add(DOL_URL_ROOT."/telephonie/index.php", "Téléphonie"); - } - - if ($conf->don->enabled) - { - $menu->add(DOL_URL_ROOT."/compta/dons/index.php", $langs->trans("Donations")); - } - - if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) - { - $langs->load("suppliers"); - $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); - } - - if ($conf->voyage->enabled && $user->societe_id == 0) - { - $menu->add(DOL_URL_ROOT."/compta/voyage/index.php","Voyages"); - $menu->add_submenu(DOL_URL_ROOT."/compta/voyage/index.php","Voyages"); - $menu->add_submenu(DOL_URL_ROOT."/compta/voyage/reduc.php","Reduc"); - } - - if ($conf->domaine->enabled) - { - $menu->add(DOL_URL_ROOT."/domain/index.php", "Domaines"); - } - - if ($conf->postnuke->enabled) - { - $menu->add(DOL_URL_ROOT."/postnuke/articles/index.php", "Editorial"); - } - - if ($conf->bookmark->enabled && $user->rights->bookmark->lire) - { - $menu->add(DOL_URL_ROOT."/bookmarks/liste.php", $langs->trans("Bookmarks")); - } - - if ($conf->export->enabled) - { - $langs->load("exports"); - $menu->add(DOL_URL_ROOT."/exports/index.php", $langs->trans("Exports")); - } - - if ($user->rights->user->user->lire || $user->admin) - { - $langs->load("users"); - $menu->add(DOL_URL_ROOT."/user/home.php", $langs->trans("MenuUsersAndGroups")); - } - - if ($user->admin) - { - $menu->add(DOL_URL_ROOT."/admin/index.php", $langs->trans("Setup")); - } - - left_menu($menu->liste); + if (! empty($conf->commande->enabled) && $user->rights->commande->lire) + { + $langs->load("orders"); + $menu->add(DOL_URL_ROOT."/commande/index.php", $langs->trans("Orders")); + } + + if (! empty($conf->document->enabled)) + { + $menu->add(DOL_URL_ROOT."/docs/index.php", $langs->trans("Documents")); + } + + if (! empty($conf->expedition->enabled) && $user->rights->expedition->lire) + { + $langs->load("sendings"); + $menu->add(DOL_URL_ROOT."/expedition/index.php", $langs->trans("Sendings")); + } + + if (! empty($conf->mailing->enabled) && $user->rights->mailing->lire) + { + $langs->load("mails"); + $menu->add(DOL_URL_ROOT."/comm/mailing/index.php",$langs->trans("EMailings")); + } + + if (! empty($conf->telephonie->enabled)) + { + $menu->add(DOL_URL_ROOT."/telephonie/index.php", "Téléphonie"); + } + + if (! empty($conf->don->enabled)) + { + $menu->add(DOL_URL_ROOT."/compta/dons/index.php", $langs->trans("Donations")); + } + + if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire) + { + $langs->load("suppliers"); + $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); + } + + if (! empty($conf->voyage->enabled) && $user->societe_id == 0) + { + $menu->add(DOL_URL_ROOT."/compta/voyage/index.php","Voyages"); + $menu->add_submenu(DOL_URL_ROOT."/compta/voyage/index.php","Voyages"); + $menu->add_submenu(DOL_URL_ROOT."/compta/voyage/reduc.php","Reduc"); + } + + if (! empty($conf->domaine->enabled)) + { + $menu->add(DOL_URL_ROOT."/domain/index.php", "Domaines"); + } + + if (! empty($conf->postnuke->enabled)) + { + $menu->add(DOL_URL_ROOT."/postnuke/articles/index.php", "Editorial"); + } + + if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) + { + $menu->add(DOL_URL_ROOT."/bookmarks/liste.php", $langs->trans("Bookmarks")); + } + + if (! empty($conf->export->enabled)) + { + $langs->load("exports"); + $menu->add(DOL_URL_ROOT."/exports/index.php", $langs->trans("Exports")); + } + + if ($user->rights->user->user->lire || $user->admin) + { + $langs->load("users"); + $menu->add(DOL_URL_ROOT."/user/home.php", $langs->trans("MenuUsersAndGroups")); + } + + if ($user->admin) + { + $menu->add(DOL_URL_ROOT."/admin/index.php", $langs->trans("Setup")); + } + + left_menu($menu->liste); } ?> diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 1ad6dbb0cba..da71b3f0aaf 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -1,11 +1,11 @@ * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2008 Raphael Bertrand (Resultic) + * Copyright (C) 2008 Raphael Bertrand (Resultic) * * 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 @@ -1717,7 +1717,7 @@ class Propal extends CommonObject if ($resql) { if ($mode == 'opened') $delay_warning=$conf->propal->cloture->warning_delay; - if ($mode == 'signed') $delay_warning=$conf->propal->facture->warning_delay; + if ($mode == 'signed') $delay_warning=$conf->propal->facturation->warning_delay; while ($obj=$this->db->fetch_object($resql)) {