Removed PHP warnings with E_ALL level

This commit is contained in:
Laurent Destailleur
2009-01-21 13:06:34 +00:00
parent f15eac3a7a
commit bdfecdc751
13 changed files with 370 additions and 370 deletions

View File

@@ -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

View File

@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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; //<! 0=Left menu in pre.inc.php files must not be overwrite by database menu, 1=Must be
var $leftmenu; //<! 0=Left menu in pre.inc.php files must not be overwrite by database menu, 1=Must be
var $perms;
var $user;
var $tms;
/**
* \brief Constructor
* \param DB Database handler
@@ -66,7 +66,7 @@ class Menubase
return 1;
}
/**
* \brief Create in database
* \param user User that create
@@ -75,7 +75,7 @@ class Menubase
function create($user)
{
global $conf, $langs;
// Clean parameters
$this->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."<br>\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."<br>\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."<br>\n";
//print $strRights."<br>\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."<br>\n";
eval($s);
return 1;
return 1;
}
?>

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
*
* 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 {

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 {

View File

@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 '<tr valign="top" '.$contents[$i][0]['tr'].'>';
else print '<tr valign="top" '.$bcx[$var].'>';
@@ -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('^<img',$texte2)) print $texte2; // show text with no html cleaning
else print $texte2withnotags; // show text with html cleaning
print "</td>";
}
print "</tr>\n";
}
}
// Complete line to max
/*
while ($i < $this->max)
@@ -223,7 +223,7 @@ class ModeleBoxes
print '<tr '.$bcx[$var].'><td colspan="'.$nbcol.'">&nbsp;</td></tr>';
$i++;
}*/
print "</table>\n";
}

View File

@@ -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 <a class="tmenu" href="...?mainmenu=...">...</a>
\remarks ou si menu selectionne <a class="tmenusel" href="...?mainmenu=...">...</a>
\remarks ou si menu selectionne <a class="tmenusel" href="...?mainmenu=...">...</a>
*/
@@ -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 '<table class="tmenu"><tr class="tmenu">';
// 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 '<td class="tmenu"><a class="tmenudisabled" '.$idsel.'href="#">'.$langs->trans("Tools").'</a></td>';
}
}
// 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 '<td class="tmenu"><a '.$class.' '.$idsel.'href="'.DOL_URL_ROOT.'/energie/index.php?mainmenu=energie"'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("Energy").'</a></td>';
}
// 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 '<td class="tmenu"><a '.$class.' '.$idsel.'href="'.DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&amp;leftmenu="'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'</a></td>';
}
// 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 '<td class="tmenu"><a '.$class.' '.$idsel.'href="'.DOL_URL_ROOT.'/oscommerce_ws/index.php?mainmenu=shop&amp;leftmenu="'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'</a></td>';
}
@@ -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 '</tr></table>';
}

View File

@@ -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 <a class="tmenu" href="...?mainmenu=...">...</a>
\remarks ou si menu selectionne <a class="tmenusel" href="...?mainmenu=...">...</a>
\remarks ou si menu selectionne <a class="tmenusel" href="...?mainmenu=...">...</a>
*/
@@ -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 '<table class="tmenu"><tr class="tmenu">';
// 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 '<td class="tmenu"><a class="tmenudisabled" '.$idsel.'href="#">'.$langs->trans("Tools").'</a></td>';
}
}
// 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 '<td class="tmenu"><a '.$class.' '.$idsel.'href="'.DOL_URL_ROOT.'/energie/index.php?mainmenu=energie"'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("Energy").'</a></td>';
}
// 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 '<td class="tmenu"><a '.$class.' '.$idsel.'href="'.DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&amp;leftmenu="'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'</a></td>';
}
// 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 '<td class="tmenu"><a '.$class.' '.$idsel.'href="'.DOL_URL_ROOT.'/oscommerce_ws/index.php?mainmenu=shop&amp;leftmenu="'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("OSCommerce").'</a></td>';
}
// 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 '</tr></table>';
}

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
@@ -124,17 +124,18 @@ if ($user->societe_id == 0)
$var=true;
// Condition <20> 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()."<br>";
// Boucle et affiche chaque ligne du tableau
@@ -585,7 +586,7 @@ if (sizeof($boxarray))
print '<tr><td class="notopnoleftnoright">'."\n";
print '<table width="100%" style="border-collapse: collapse; border: 0px; margin: 0px; padding: 0px;"><tr>';
// Affichage colonne gauche
print '<td width="50%" valign="top">'."\n";
@@ -622,7 +623,7 @@ if (sizeof($boxarray))
print "</td>\n";
// Affichage colonne droite
print '<td width="50%" valign="top">';
print "\n<!-- Box right container -->\n";
print '<div id="right">'."\n";

View File

@@ -260,7 +260,7 @@ function dol_syslog($message, $level=LOG_INFO)
{
$facility = LOG_USER;
}
unset ($facility);
openlog("dolibarr", LOG_PID | LOG_PERROR, $facility);
if (! $level)
@@ -2051,7 +2051,7 @@ function price($amount, $html=0, $outlangs='', $trunc=1, $rounding=2)
$amount = ereg_replace(',','.',$amount); // should be useless
//print $amount."-";
$datas = split('\.',$amount);
$decpart = $datas[1];
$decpart = isset($datas[1])?$datas[1]:'';
$decpart = eregi_replace('0+$','',$decpart); // Supprime les 0 de fin de partie decimale
//print "decpart=".$decpart."<br>";
$end='';

View File

@@ -121,7 +121,7 @@ if ($conf->main_force_https)
if (eregi('^http:',$_SERVER["SCRIPT_URI"]) && ! eregi('^https:',$_SERVER["SCRIPT_URI"])) // If link is http
{
$newurl=eregi_replace('^http:','https:',$_SERVER["SCRIPT_URI"]);
dolibarr_syslog("dolibarr_main_force_https is on, we make a redirect to ".$newurl,LOG_DEBUG);
header("Location: ".$newurl);
exit;
@@ -160,7 +160,7 @@ dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id()
// Disable modules (this must be after session_start)
if (! empty($_REQUEST["disablemodules"])) $_SESSION["disablemodules"]=$_REQUEST["disablemodules"];
if (! empty($_SESSION["disablemodules"]))
if (! empty($_SESSION["disablemodules"]))
{
$disabled_modules=split(',',$_SESSION["disablemodules"]);
foreach($disabled_modules as $module)
@@ -220,11 +220,11 @@ if (! isset($_SESSION["dol_login"]))
dolibarr_syslog('Bad value for code, connexion refused');
$langs->load('main');
$langs->load('other');
$user->trigger_mesg='ErrorBadValueForCode - login='.$_POST["username"];
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadValueForCode");
$test=false;
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($db);
@@ -282,7 +282,7 @@ if (! isset($_SESSION["dol_login"]))
// Bad password. No authmode has found a good password.
$user->trigger_mesg=$langs->trans("ErrorBadLoginPassword").' - login='.$_POST["username"];
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($db);
@@ -530,7 +530,7 @@ if ($conf->global->MAIN_NEED_SMARTY)
if (empty($dolibarr_smarty_libs_dir)) $dolibarr_smarty_libs_dir=DOL_DATA_ROOT.'/../external-libs/smarty/libs/';
if (empty($dolibarr_smarty_compile)) $dolibarr_smarty_compile=DOL_DATA_ROOT.'/smarty/templates/temp';
if (empty($dolibarr_smarty_cache)) $dolibarr_smarty_cache=DOL_DATA_ROOT.'/smarty/cache/temp';
$smarty_libs = $dolibarr_smarty_libs_dir. "Smarty.class.php";
if (file_exists ($smarty_libs))
{
@@ -559,7 +559,7 @@ if ($user->statut < 1)
accessforbidden($langs->trans("ErrorLoginDisabled"));
exit;
}
dolibarr_syslog("Access to ".$_SERVER["PHP_SELF"],LOG_INFO);
@@ -814,7 +814,7 @@ function top_menu($head, $title='', $target='')
$htmltext.='<br><b>'.$langs->trans("CurrentTheme").'</b>: '.$conf->theme;
$htmltext.='<br><b>'.$langs->trans("CurrentUserLanguage").'</b>: '.$langs->getDefaultLang();
if (! empty($_SESSION["disablemodules"])) $htmltext.='<br><b>'.$langs->trans("DisabledModules").'</b>: <br>'.join('<br>',split(',',$_SESSION["disablemodules"]));
$html=new Form($db);
print $html->textwithtooltip('',$htmltext,2,1,$text);
@@ -884,7 +884,7 @@ function left_menu($menu_array, $helppagename='', $form_search='')
$ret.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php',
img_object($langs->trans("List"),'user').' '.$langs->trans("Members"), 'member', 'sall');
}
if ($ret)
{
print "\n";
@@ -894,7 +894,7 @@ function left_menu($menu_array, $helppagename='', $form_search='')
print '</div>'."\n";
print "<!-- End SearchForm -->\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 "<!-- Start of log output\n";
print "<!-- Start of log output\n";
//print '<div class="hidden">'."\n";
foreach($conf->logbuffer as $logline)
{
print $logline."<br>\n";
}
//print '</div>'."\n";
print "End of log output -->\n";
print "End of log output -->\n";
}
print "\n";
if ($foot) print '<!-- '.$foot.' -->'."\n";
if ($foot) print '<!-- '.$foot.' -->'."\n";
print "</body>\n";
print "</html>\n";
}

View File

@@ -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<EFBFBD>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;

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 <20>ric Seigne <erics@rycks.com>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
*
@@ -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<EFBFBD>l<EFBFBD>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<EFBFBD>l<EFBFBD>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);
}
?>

View File

@@ -1,11 +1,11 @@
<?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
*
* 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))
{