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 eclipse.preferences.version=1
encoding//dev/initdemo/initdemo.sql=UTF-8 encoding//dev/initdemo/initdemo.sql=UTF-8
encoding//dev/skeletons/modMyModule.class.php=ISO-8859-1 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/empty.php=ISO-8859-1
encoding//htdocs/includes/menus/barre_top/rodolphe.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/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/modAdherent.class.php=ISO-8859-1
encoding//htdocs/includes/modules/modBanque.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 encoding//htdocs/includes/modules/modCategorie.class.php=ISO-8859-1

View File

@ -1,5 +1,5 @@
<?php <?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 * 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 * 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 $db; // To store db handler
var $error; // To return error code (or message) var $error; // To return error code (or message)
var $errors=array(); // To return several error codes (or messages) var $errors=array(); // To return several error codes (or messages)
var $id; var $id;
var $menu_handler; var $menu_handler;
var $module; var $module;
var $type; var $type;
@ -48,12 +48,12 @@ class Menubase
var $titre; var $titre;
var $langs; var $langs;
var $level; 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 $perms;
var $user; var $user;
var $tms; var $tms;
/** /**
* \brief Constructor * \brief Constructor
* \param DB Database handler * \param DB Database handler
@ -66,7 +66,7 @@ class Menubase
return 1; return 1;
} }
/** /**
* \brief Create in database * \brief Create in database
* \param user User that create * \param user User that create
@ -75,7 +75,7 @@ class Menubase
function create($user) function create($user)
{ {
global $conf, $langs; global $conf, $langs;
// Clean parameters // Clean parameters
$this->menu_handler=trim($this->menu_handler); $this->menu_handler=trim($this->menu_handler);
$this->module=trim($this->module); $this->module=trim($this->module);
@ -92,10 +92,10 @@ class Menubase
$this->perms=trim($this->perms); $this->perms=trim($this->perms);
$this->user=trim($this->user); $this->user=trim($this->user);
if (! $this->level) $this->level=0; if (! $this->level) $this->level=0;
// Check parameters // Check parameters
// Put here code to add control on parameters values // Put here code to add control on parameters values
// Insert request // Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."menu("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."menu(";
$sql.= "menu_handler,"; $sql.= "menu_handler,";
@ -134,7 +134,7 @@ class Menubase
if ($resql) if ($resql)
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."menu"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."menu");
return $this->id; return $this->id;
} }
else else
@ -154,7 +154,7 @@ class Menubase
function update($user=0, $notrigger=0) function update($user=0, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
// Clean parameters // Clean parameters
$this->rowid=trim($this->rowid); $this->rowid=trim($this->rowid);
$this->menu_handler=trim($this->menu_handler); $this->menu_handler=trim($this->menu_handler);
@ -204,8 +204,8 @@ class Menubase
return 1; return 1;
} }
/* /*
* \brief Load object in memory from database * \brief Load object in memory from database
* \param id id object * \param id id object
@ -235,7 +235,7 @@ class Menubase
$sql.= " ".$this->db->pdate('t.tms').""; $sql.= " ".$this->db->pdate('t.tms')."";
$sql.= " FROM ".MAIN_DB_PREFIX."menu as t"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as t";
$sql.= " WHERE t.rowid = ".$id; $sql.= " WHERE t.rowid = ".$id;
dolibarr_syslog("Menubase::fetch sql=".$sql, LOG_DEBUG); dolibarr_syslog("Menubase::fetch sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
@ -243,9 +243,9 @@ class Menubase
if ($this->db->num_rows($resql)) if ($this->db->num_rows($resql))
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->menu_handler = $obj->menu_handler; $this->menu_handler = $obj->menu_handler;
$this->module = $obj->module; $this->module = $obj->module;
$this->type = $obj->type; $this->type = $obj->type;
@ -263,7 +263,7 @@ class Menubase
$this->tms = $obj->tms; $this->tms = $obj->tms;
} }
$this->db->free($resql); $this->db->free($resql);
return 1; return 1;
} }
else else
@ -273,8 +273,8 @@ class Menubase
return -1; return -1;
} }
} }
/* /*
* \brief Delete object in database * \brief Delete object in database
* \param user User that delete * \param user User that delete
@ -283,10 +283,10 @@ class Menubase
function delete($user) function delete($user)
{ {
global $conf, $langs; global $conf, $langs;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu";
$sql.= " WHERE rowid=".$this->id; $sql.= " WHERE rowid=".$this->id;
dolibarr_syslog("Menubase::delete sql=".$sql); dolibarr_syslog("Menubase::delete sql=".$sql);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) if (! $resql)
@ -295,11 +295,11 @@ class Menubase
dolibarr_syslog("Menubase::delete ".$this->error, LOG_ERR); dolibarr_syslog("Menubase::delete ".$this->error, LOG_ERR);
return -1; return -1;
} }
return 1; return 1;
} }
/** /**
* \brief Initialise object with example values * \brief Initialise object with example values
* \remarks id must be 0 if object instance is a specimen. * \remarks id must be 0 if object instance is a specimen.
@ -307,7 +307,7 @@ class Menubase
function initAsSpecimen() function initAsSpecimen()
{ {
$this->id=0; $this->id=0;
$this->menu_handler='all'; $this->menu_handler='all';
$this->module='specimen'; $this->module='specimen';
$this->type='top'; $this->type='top';
@ -335,18 +335,18 @@ class Menubase
* @param menu_handler Name of menu_handler used (auguria, eldy...) * @param menu_handler Name of menu_handler used (auguria, eldy...)
* @return array Menu array completed * @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 $langs, $user, $conf, $leftmenu; // To export to dol_eval function
global $rights; // To export to dol_eval function global $rights; // To export to dol_eval function
$leftmenu=$myleftmenu; $leftmenu=$myleftmenu;
$this->newmenu = $newmenu; $this->newmenu = $newmenu;
$this->leftmenu = $leftmenu; $this->leftmenu = $leftmenu;
$tabMenu = array (); $tabMenu = array ();
$sql = "SELECT m.rowid, m.fk_menu, m.url, m.titre, m.langs, m.perms, m.target, m.mainmenu, m.leftmenu,"; $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.= " mo.action";
$sql.= " FROM " . MAIN_DB_PREFIX . "menu as m"; $sql.= " FROM " . MAIN_DB_PREFIX . "menu as m";
@ -375,7 +375,7 @@ class Menubase
// Define $chaine // Define $chaine
$chaine=""; $chaine="";
$title = $langs->trans($menu['titre']); $title = $langs->trans($menu['titre']);
if ($title == $menu['titre'] && ! empty($menu['langs'])) if ($title == $menu['titre'] && ! empty($menu['langs']))
{ {
$title = $langs->trans($menu['titre']); $title = $langs->trans($menu['titre']);
$langs->load($menu['langs']); $langs->load($menu['langs']);
@ -388,8 +388,8 @@ class Menubase
else else
{ {
$chaine = $langs->trans($title); $chaine = $langs->trans($title);
} }
// Define $right // Define $right
$perms = true; $perms = true;
if ($menu['perms']) if ($menu['perms'])
@ -397,7 +397,7 @@ class Menubase
$perms = $this->verifCond($menu['perms']); $perms = $this->verifCond($menu['perms']);
//print "verifCond rowid=".$menu['rowid']." ".$menu['right'].":".$perms."<br>\n"; //print "verifCond rowid=".$menu['rowid']." ".$menu['right'].":".$perms."<br>\n";
} }
// Define $constraint // Define $constraint
$constraint = true; $constraint = true;
if ($menu['action']) if ($menu['action'])
@ -405,7 +405,7 @@ class Menubase
$constraint = $this->verifCond($menu['action']); $constraint = $this->verifCond($menu['action']);
//print "verifCond rowid=".$menu['rowid']." ".$menu['action'].":".$constraint."<br>\n"; //print "verifCond rowid=".$menu['rowid']." ".$menu['action'].":".$constraint."<br>\n";
} }
if ($menu['rowid'] != $oldrowid && $oldrowid) $b++; // Break on new entry if ($menu['rowid'] != $oldrowid && $oldrowid) $b++; // Break on new entry
$oldrowid=$menu['rowid']; $oldrowid=$menu['rowid'];
@ -421,7 +421,7 @@ class Menubase
else $tabMenu[$b][4] = ($tabMenu[$b][4] && $perms); else $tabMenu[$b][4] = ($tabMenu[$b][4] && $perms);
if (! isset($tabMenu[$b][7])) $tabMenu[$b][7] = $constraint; if (! isset($tabMenu[$b][7])) $tabMenu[$b][7] = $constraint;
else $tabMenu[$b][7] = ($tabMenu[$b][7] && $constraint); else $tabMenu[$b][7] = ($tabMenu[$b][7] && $constraint);
$a++; $a++;
} }
$this->db->free($resql); $this->db->free($resql);
@ -430,8 +430,9 @@ class Menubase
{ {
dolibarr_print_error($this->db); dolibarr_print_error($this->db);
} }
// Get menutopid // Get menutopid
$menutopid='';
$sql = "SELECT m.rowid, m.titre, m.type"; $sql = "SELECT m.rowid, m.titre, m.type";
$sql.= " FROM " . MAIN_DB_PREFIX . "menu as m"; $sql.= " FROM " . MAIN_DB_PREFIX . "menu as m";
$sql.= " WHERE m.mainmenu = '".$mainmenu."'"; $sql.= " WHERE m.mainmenu = '".$mainmenu."'";
@ -440,9 +441,9 @@ class Menubase
// It should have only one response // It should have only one response
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
$menutop = $this->db->fetch_object($resql); $menutop = $this->db->fetch_object($resql);
$menutopid=$menutop->rowid; if ($menutop) $menutopid=$menutop->rowid;
$this->db->free($resql); $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 // Now edit this->newmenu to add entries in tabMenu that are in parent sons
$this->recur($tabMenu, $menutopid, 1); $this->recur($tabMenu, $menutopid, 1);
@ -457,27 +458,27 @@ class Menubase
* @param string $pere * @param string $pere
* @param string $rang * @param string $rang
*/ */
function recur($tab, $pere, $rang) function recur($tab, $pere, $rang)
{ {
global $leftmenu; // To be exported in dol_eval function global $leftmenu; // To be exported in dol_eval function
//print "xx".$pere; //print "xx".$pere;
$leftmenu = $this->leftmenu; $leftmenu = $this->leftmenu;
//ballayage du tableau //ballayage du tableau
for ($x = 0; $x < count($tab); $x++) for ($x = 0; $x < count($tab); $x++)
{ {
//si un element a pour pere : $pere //si un element a pour pere : $pere
if ($tab[$x][1] == $pere) if ($tab[$x][1] == $pere)
{ {
if ($tab[$x][7]) if ($tab[$x][7])
{ {
$leftmenuConstraint = true; $leftmenuConstraint = true;
if ($tab[$x][6]) if ($tab[$x][6])
{ {
$leftmenuConstraint = $this->verifCond($tab[$x][6]); $leftmenuConstraint = $this->verifCond($tab[$x][6]);
} }
if ($leftmenuConstraint) if ($leftmenuConstraint)
{ {
// print "x".$pere." ".$tab[$x][6]; // print "x".$pere." ".$tab[$x][6];
@ -500,7 +501,7 @@ class Menubase
global $user,$conf,$lang,$leftmenu; global $user,$conf,$lang,$leftmenu;
global $rights; // To export to dol_eval function global $rights; // To export to dol_eval function
//print $strRights."<br>\n"; //print $strRights."<br>\n";
if ($strRights != "") if ($strRights != "")
{ {
$rights = true; $rights = true;
@ -516,12 +517,12 @@ class Menubase
{ {
$rights = true; $rights = true;
} }
return $rights; 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. * in pre.inc.php must be overwritten completely by dynamic menu.
* *
* @return array * @return array
@ -529,7 +530,7 @@ class Menubase
function listeMainmenu() function listeMainmenu()
{ {
$overwritemenufor=array(); $overwritemenufor=array();
$sql = "SELECT DISTINCT m.mainmenu"; $sql = "SELECT DISTINCT m.mainmenu";
$sql.= " FROM " . MAIN_DB_PREFIX . "menu as m"; $sql.= " FROM " . MAIN_DB_PREFIX . "menu as m";
$sql.= " WHERE m.menu_handler in ('".$this->menu_handler."','all')"; $sql.= " WHERE m.menu_handler in ('".$this->menu_handler."','all')";
@ -548,10 +549,10 @@ class Menubase
{ {
dolibarr_print_error($this->db); dolibarr_print_error($this->db);
} }
return $overwritemenufor; return $overwritemenufor;
} }
/** /**
* \brief Load tabMenu array * \brief Load tabMenu array
* \param type_user 0=Internal,1=External,2=All * \param type_user 0=Internal,1=External,2=All
@ -563,15 +564,15 @@ class Menubase
{ {
global $langs, $user, $conf; global $langs, $user, $conf;
global $rights; // To export to dol_eval function global $rights; // To export to dol_eval function
$tabMenu=array(); $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.= " mo.action";
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; $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_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.= " 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')"; $sql.= " AND m.menu_handler in('".$menu_handler."','all')";
if ($type_user == 0) $sql.= " AND m.user in (0,2)"; if ($type_user == 0) $sql.= " AND m.user in (0,2)";
if ($type_user == 1) $sql.= " AND m.user in (1,2)"; if ($type_user == 1) $sql.= " AND m.user in (1,2)";
@ -590,18 +591,18 @@ class Menubase
while ($a < $numa) while ($a < $numa)
{ {
$objm = $this->db->fetch_object($resql); $objm = $this->db->fetch_object($resql);
// Define $chaine // Define $chaine
$chaine=""; $chaine="";
$title=$langs->trans($objm->titre); $title=$langs->trans($objm->titre);
if ($title == $objm->titre) // Translation not found if ($title == $objm->titre) // Translation not found
{ {
if (! empty($objm->langs)) if (! empty($objm->langs))
{ {
// If it seems there no translation, we load language file defined in menu entry table // If it seems there no translation, we load language file defined in menu entry table
$langs->load($objm->langs); $langs->load($objm->langs);
} }
if (eregi("/",$title)) if (eregi("/",$title))
{ {
$tab_titre = explode("/",$title); $tab_titre = explode("/",$title);
@ -610,28 +611,28 @@ class Menubase
else else
{ {
$chaine = $langs->trans($title); $chaine = $langs->trans($title);
} }
} }
else else
{ {
$chaine=$title; $chaine=$title;
} }
//print "x".$objm->titre."-".$chaine; //print "x".$objm->titre."-".$chaine;
// Define $right // Define $right
$perms = true; $perms = true;
if ($objm->perms) if ($objm->perms)
{ {
$perms = $this->verifCond($objm->perms); $perms = $this->verifCond($objm->perms);
} }
// Define $constraint // Define $constraint
$constraint = true; $constraint = true;
if ($objm->action) if ($objm->action)
{ {
$constraint = $this->verifCond($objm->action); $constraint = $this->verifCond($objm->action);
} }
if ($objm->rowid != $oldrowid && $oldrowid) $b++; // Break on new entry if ($objm->rowid != $oldrowid && $oldrowid) $b++; // Break on new entry
$oldrowid=$objm->rowid; $oldrowid=$objm->rowid;
@ -639,15 +640,14 @@ class Menubase
$tabMenu[$b]['mainmenu'] = $objm->mainmenu; $tabMenu[$b]['mainmenu'] = $objm->mainmenu;
$tabMenu[$b]['titre'] = $chaine; // Title $tabMenu[$b]['titre'] = $chaine; // Title
$tabMenu[$b]['url'] = $objm->url; $tabMenu[$b]['url'] = $objm->url;
$tabMenu[$b]['atarget'] = $this->atarget; $tabMenu[$b]['atarget'] = $objm->target;
$tabMenu[$b]['class'] = $class;
if (! isset($tabMenu[$b]['right'])) $tabMenu[$b]['right'] = $perms; if (! isset($tabMenu[$b]['right'])) $tabMenu[$b]['right'] = $perms;
else $tabMenu[$b]['right'] = ($tabMenu[$b]['right'] && $perms); else $tabMenu[$b]['right'] = ($tabMenu[$b]['right'] && $perms);
if (! isset($tabMenu[$b]['enabled'])) $tabMenu[$b]['enabled'] = $constraint; if (! isset($tabMenu[$b]['enabled'])) $tabMenu[$b]['enabled'] = $constraint;
else $tabMenu[$b]['enabled'] = ($tabMenu[$b]['enabled'] && $constraint); else $tabMenu[$b]['enabled'] = ($tabMenu[$b]['enabled'] && $constraint);
//var_dump($tabMenu); //var_dump($tabMenu);
$a++; $a++;
} }
} }
else else
@ -671,15 +671,15 @@ function dol_eval($s)
// Only global variables can be changed by eval function and returned to caller // Only global variables can be changed by eval function and returned to caller
global $langs, $user, $conf; global $langs, $user, $conf;
global $rights; global $rights;
global $leftmenu; global $leftmenu;
// \todo // \todo
// Warning. We must add code to exclude test if it contains = (affectation) that is not == (compare) // Warning. We must add code to exclude test if it contains = (affectation) that is not == (compare)
//print $s."<br>\n"; //print $s."<br>\n";
eval($s); eval($s);
return 1; return 1;
} }
?> ?>

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* 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> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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; global $user, $langs, $db, $conf;
$this->max=$max; $this->max=$max;
include_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); include_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
$actionstatic=new ActionComm($db); $actionstatic=new ActionComm($db);
@ -89,13 +89,13 @@ class box_actions extends ModeleBoxes {
$sql.= " ORDER BY a.datec DESC"; $sql.= " ORDER BY a.datec DESC";
$sql.= $db->plimit($max, 0); $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); $result = $db->query($sql);
if ($result) if ($result)
{ {
$now=gmmktime(); $now=gmmktime();
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
@ -111,7 +111,7 @@ class box_actions extends ModeleBoxes {
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => ("task"), 'logo' => ("task"),
'url' => DOL_URL_ROOT."/comm/action/fiche.php?id=".$objp->id); 'url' => DOL_URL_ROOT."/comm/action/fiche.php?id=".$objp->id);
$this->info_box_contents[$i][1] = array('td' => 'align="left" nowrap="1"', $this->info_box_contents[$i][1] = array('td' => 'align="left" nowrap="1"',
'text' => dolibarr_trunc($label,12), 'text' => dolibarr_trunc($label,12),
'text2'=> $late, 'text2'=> $late,
@ -132,7 +132,7 @@ class box_actions extends ModeleBoxes {
$i++; $i++;
} }
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoActionsToDo")); if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoActionsToDo"));
} }
else { else {

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* 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 * 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 * 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 $db;
var $param; var $param;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();
@ -57,10 +57,10 @@ class box_factures_fourn extends ModeleBoxes {
*/ */
function loadBox($max=5) function loadBox($max=5)
{ {
global $user, $langs, $db; global $conf, $user, $langs, $db;
$this->max=$max; $this->max=$max;
include_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"); include_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php");
$facturestatic=new FactureFournisseur($db); $facturestatic=new FactureFournisseur($db);
@ -93,23 +93,23 @@ class box_factures_fourn extends ModeleBoxes {
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
$now=gmmktime(); $now=gmmktime();
$i = 0; $i = 0;
$l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)';
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$datelimite=$db->jdate($obj->datelimite); $datelimite=$db->jdate($objp->datelimite);
$datec=$db->jdate($objp->datec); $datec=$db->jdate($objp->datec);
$late = ''; $late = '';
if ($objp->paye == 0 && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dolibarr_print_date($datelimite,'day'))); 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"', $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => $this->boximg, 'logo' => $this->boximg,
'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid); 'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->facnumber, 'text' => $objp->facnumber,
'text2'=> $late, 'text2'=> $late,
@ -124,10 +124,10 @@ class box_factures_fourn extends ModeleBoxes {
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)); 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3));
$i++; $i++;
} }
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpayedCustomerBills")); if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpayedCustomerBills"));
} }
else { else {

View File

@ -1,5 +1,5 @@
<?php <?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 * 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 * it under the terms of the GNU General Public License as published by
@ -34,7 +34,7 @@ class ModeleBoxes
var $db; var $db;
var $error=''; var $error='';
var $max=5; var $max=5;
/* /*
* \brief Constructeur * \brief Constructeur
*/ */
@ -104,7 +104,7 @@ class ModeleBoxes
$var = true; $var = true;
dolibarr_syslog("modules_box::showBox ".get_Class($this)); dolibarr_syslog("modules_box::showBox ".get_Class($this));
// Define nbcol and nblines of the box to show // Define nbcol and nblines of the box to show
$nbcol=0; $nbcol=0;
if (isset($contents[0])) $nbcol=sizeof($contents[0]); if (isset($contents[0])) $nbcol=sizeof($contents[0]);
@ -158,7 +158,7 @@ class ModeleBoxes
if (isset($contents[$i])) if (isset($contents[$i]))
{ {
$var=!$var; $var=!$var;
// TR // TR
if (isset($contents[$i][0]['tr'])) print '<tr valign="top" '.$contents[$i][0]['tr'].'>'; if (isset($contents[$i][0]['tr'])) print '<tr valign="top" '.$contents[$i][0]['tr'].'>';
else print '<tr valign="top" '.$bcx[$var].'>'; else print '<tr valign="top" '.$bcx[$var].'>';
@ -171,7 +171,7 @@ class ModeleBoxes
$tdparam=''; $tdparam='';
if (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td']; 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']:''; $texte=isset($contents[$i][$j]['text'])?$contents[$i][$j]['text']:'';
$textewithnotags=eregi_replace('<[^>]+>','',$texte); $textewithnotags=eregi_replace('<[^>]+>','',$texte);
$texte2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:''; $texte2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:'';
@ -194,7 +194,7 @@ class ModeleBoxes
$logo=eregi_replace("^object_","",$contents[$i][$j]['logo']); $logo=eregi_replace("^object_","",$contents[$i][$j]['logo']);
print img_object($langs->trans("Show"),$logo); print img_object($langs->trans("Show"),$logo);
} }
$maxlength=$MAXLENGTHBOX; $maxlength=$MAXLENGTHBOX;
if (! empty($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength']; 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 if (eregi('^<img',$texte2)) print $texte2; // show text with no html cleaning
else print $texte2withnotags; // show text with html cleaning else print $texte2withnotags; // show text with html cleaning
print "</td>"; print "</td>";
} }
print "</tr>\n"; print "</tr>\n";
} }
} }
// Complete line to max // Complete line to max
/* /*
while ($i < $this->max) while ($i < $this->max)
@ -223,7 +223,7 @@ class ModeleBoxes
print '<tr '.$bcx[$var].'><td colspan="'.$nbcol.'">&nbsp;</td></tr>'; print '<tr '.$bcx[$var].'><td colspan="'.$nbcol.'">&nbsp;</td></tr>';
$i++; $i++;
}*/ }*/
print "</table>\n"; print "</table>\n";
} }

View File

@ -25,7 +25,7 @@
\remarks La construction d'un gestionnaire pour le menu du haut est simple: \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 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 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 $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 $hideifnotallowed=false; // Put 0 for back office menu, 1 for front office menu
var $atarget=""; // Valeur du target a utiliser dans les liens var $atarget=""; // Valeur du target a utiliser dans les liens
/** /**
* \brief Constructeur * \brief Constructeur
* \param db Handler d'acces base de donnee * \param db Handler d'acces base de donnee
@ -49,25 +49,25 @@ class MenuTop {
{ {
global $langs; global $langs;
$this->db=$db; $this->db=$db;
$langs->setTransFromTab("Company",$langs->trans("ThirdParty")); $langs->setTransFromTab("Company",$langs->trans("ThirdParty"));
$langs->setTransFromTab("NewCompany",$langs->trans("NewThirdParty")); $langs->setTransFromTab("NewCompany",$langs->trans("NewThirdParty"));
} }
/** /**
* \brief Affiche le menu * \brief Affiche le menu
*/ */
function showmenu() function showmenu()
{ {
global $user,$conf,$langs,$dolibarr_main_db_name;; global $user,$conf,$langs,$dolibarr_main_db_name;;
// On sauve en session le menu principal choisi // On sauve en session le menu principal choisi
if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"]; if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"];
if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"]; if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"];
$_SESSION["leftmenuopened"]=""; $_SESSION["leftmenuopened"]="";
print '<table class="tmenu"><tr class="tmenu">'; print '<table class="tmenu"><tr class="tmenu">';
// Home // Home
@ -89,7 +89,7 @@ class MenuTop {
{ {
$langs->load("companies"); $langs->load("companies");
$langs->load("suppliers"); $langs->load("suppliers");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies")
{ {
@ -117,7 +117,7 @@ class MenuTop {
if ($conf->produit->enabled || $conf->service->enabled) if ($conf->produit->enabled || $conf->service->enabled)
{ {
$langs->load("products"); $langs->load("products");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "products") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "products")
{ {
@ -131,7 +131,7 @@ class MenuTop {
if ($conf->produit->enabled) { $chaine.=$langs->trans("Products"); } if ($conf->produit->enabled) { $chaine.=$langs->trans("Products"); }
if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; } if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; }
if ($conf->service->enabled) { $chaine.=$langs->trans("Services"); } if ($conf->service->enabled) { $chaine.=$langs->trans("Services"); }
$idsel='id="products" '; $idsel='id="products" ';
if ($user->rights->produit->lire) if ($user->rights->produit->lire)
{ {
@ -154,7 +154,7 @@ class MenuTop {
if ($conf->commercial->enabled) if ($conf->commercial->enabled)
{ {
$langs->load("commercial"); $langs->load("commercial");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "commercial") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "commercial")
{ {
@ -164,7 +164,7 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="commercial" '; $idsel='id="commercial" ';
if($user->rights->societe->lire) if($user->rights->societe->lire)
{ {
@ -181,7 +181,7 @@ class MenuTop {
|| $conf->facture->enabled) || $conf->facture->enabled)
{ {
$langs->load("compta"); $langs->load("compta");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy")
{ {
@ -191,7 +191,7 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="accountancy" '; $idsel='id="accountancy" ';
if ($user->rights->compta->resultat->lire || $user->rights->comptaexpert->plancompte->lire if ($user->rights->compta->resultat->lire || $user->rights->comptaexpert->plancompte->lire
|| $user->rights->facture->lire || $user->rights->banque->lire) || $user->rights->facture->lire || $user->rights->banque->lire)
@ -208,7 +208,7 @@ class MenuTop {
if ($conf->projet->enabled) if ($conf->projet->enabled)
{ {
$langs->load("projects"); $langs->load("projects");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "project") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "project")
{ {
@ -218,7 +218,7 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="project" '; $idsel='id="project" ';
if ($user->rights->projet->lire) if ($user->rights->projet->lire)
{ {
@ -235,7 +235,7 @@ class MenuTop {
|| $conf->global->MAIN_MODULE_IMPORT || $conf->global->MAIN_MODULE_DOMAIN) || $conf->global->MAIN_MODULE_IMPORT || $conf->global->MAIN_MODULE_DOMAIN)
{ {
$langs->load("other"); $langs->load("other");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "tools") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "tools")
{ {
@ -245,7 +245,7 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="tools" '; $idsel='id="tools" ';
if ($user->rights->mailing->lire || $user->rights->bookmark->lire || $user->rights->export->lire) 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>'; if (! $this->hideifnotallowed) print '<td class="tmenu"><a class="tmenudisabled" '.$idsel.'href="#">'.$langs->trans("Tools").'</a></td>';
} }
} }
// Telephonie // Telephonie
if ($conf->telephonie->enabled && $user->rights->telephonie->lire) if (! empty($conf->telephonie->enabled) && $user->rights->telephonie->lire)
{ {
$class=""; $class="";
if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"])) if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"]))
@ -275,7 +275,7 @@ class MenuTop {
} }
// Energie // Energie
if ($conf->energie->enabled) if (! empty($conf->energie->enabled))
{ {
$langs->load("energy"); $langs->load("energy");
$class=""; $class="";
@ -291,12 +291,12 @@ class MenuTop {
$idsel='id="energie" '; $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>'; 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 // OSCommerce 1
if ($conf->boutique->enabled) if (! empty($conf->boutique->enabled))
{ {
$langs->load("shop"); $langs->load("shop");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop")
{ {
@ -306,16 +306,16 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="shop" '; $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>'; 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 // OSCommerce WS
if ($conf->oscommercews->enabled) if (! empty($conf->oscommercews->enabled))
{ {
$langs->load("shop"); $langs->load("shop");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop")
{ {
@ -325,7 +325,7 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="shop" '; $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>'; 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) if ($conf->adherent->enabled)
{ {
// $langs->load("members"); Added in main file // $langs->load("members"); Added in main file
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members")
{ {
@ -344,7 +344,7 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="members" '; $idsel='id="members" ';
if ($user->rights->adherent->lire) if ($user->rights->adherent->lire)
{ {
@ -387,8 +387,8 @@ class MenuTop {
} }
} }
} }
print '</tr></table>'; print '</tr></table>';
} }

View File

@ -25,7 +25,7 @@
\remarks La construction d'un gestionnaire pour le menu du haut est simple: \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 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 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 $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 $hideifnotallowed=true; // Put 0 for back office menu, 1 for front office menu
var $atarget=""; // Valeur du target a utiliser dans les liens var $atarget=""; // Valeur du target a utiliser dans les liens
/** /**
* \brief Constructeur * \brief Constructeur
* \param db Handler d'acces base de donnee * \param db Handler d'acces base de donnee
@ -49,25 +49,25 @@ class MenuTop {
{ {
global $langs; global $langs;
$this->db=$db; $this->db=$db;
$langs->setTransFromTab("Company",$langs->trans("ThirdParty")); $langs->setTransFromTab("Company",$langs->trans("ThirdParty"));
$langs->setTransFromTab("NewCompany",$langs->trans("NewThirdParty")); $langs->setTransFromTab("NewCompany",$langs->trans("NewThirdParty"));
} }
/** /**
* \brief Affiche le menu * \brief Affiche le menu
*/ */
function showmenu() function showmenu()
{ {
global $user,$conf,$langs,$dolibarr_main_db_name;; global $user,$conf,$langs,$dolibarr_main_db_name;;
// On sauve en session le menu principal choisi // On sauve en session le menu principal choisi
if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"]; if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"];
if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"]; if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"];
$_SESSION["leftmenuopened"]=""; $_SESSION["leftmenuopened"]="";
print '<table class="tmenu"><tr class="tmenu">'; print '<table class="tmenu"><tr class="tmenu">';
// Home // Home
@ -89,7 +89,7 @@ class MenuTop {
{ {
$langs->load("companies"); $langs->load("companies");
$langs->load("suppliers"); $langs->load("suppliers");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies")
{ {
@ -117,7 +117,7 @@ class MenuTop {
if ($conf->produit->enabled || $conf->service->enabled) if ($conf->produit->enabled || $conf->service->enabled)
{ {
$langs->load("products"); $langs->load("products");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "products") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "products")
{ {
@ -131,7 +131,7 @@ class MenuTop {
if ($conf->produit->enabled) { $chaine.=$langs->trans("Products"); } if ($conf->produit->enabled) { $chaine.=$langs->trans("Products"); }
if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; } if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; }
if ($conf->service->enabled) { $chaine.=$langs->trans("Services"); } if ($conf->service->enabled) { $chaine.=$langs->trans("Services"); }
$idsel='id="products" '; $idsel='id="products" ';
if ($user->rights->produit->lire) if ($user->rights->produit->lire)
{ {
@ -154,7 +154,7 @@ class MenuTop {
if ($conf->commercial->enabled) if ($conf->commercial->enabled)
{ {
$langs->load("commercial"); $langs->load("commercial");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "commercial") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "commercial")
{ {
@ -164,7 +164,7 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="commercial" '; $idsel='id="commercial" ';
if($user->rights->societe->lire) if($user->rights->societe->lire)
{ {
@ -181,7 +181,7 @@ class MenuTop {
|| $conf->facture->enabled) || $conf->facture->enabled)
{ {
$langs->load("compta"); $langs->load("compta");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy")
{ {
@ -191,7 +191,7 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="accountancy" '; $idsel='id="accountancy" ';
if ($user->rights->compta->resultat->lire || $user->rights->comptaexpert->plancompte->lire if ($user->rights->compta->resultat->lire || $user->rights->comptaexpert->plancompte->lire
|| $user->rights->facture->lire || $user->rights->banque->lire) || $user->rights->facture->lire || $user->rights->banque->lire)
@ -208,7 +208,7 @@ class MenuTop {
if ($conf->projet->enabled) if ($conf->projet->enabled)
{ {
$langs->load("projects"); $langs->load("projects");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "project") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "project")
{ {
@ -218,7 +218,7 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="project" '; $idsel='id="project" ';
if ($user->rights->projet->lire) if ($user->rights->projet->lire)
{ {
@ -235,7 +235,7 @@ class MenuTop {
|| $conf->global->MAIN_MODULE_IMPORT || $conf->global->MAIN_MODULE_DOMAIN) || $conf->global->MAIN_MODULE_IMPORT || $conf->global->MAIN_MODULE_DOMAIN)
{ {
$langs->load("other"); $langs->load("other");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "tools") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "tools")
{ {
@ -245,7 +245,7 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="tools" '; $idsel='id="tools" ';
if ($user->rights->mailing->lire || $user->rights->bookmark->lire || $user->rights->export->lire) 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>'; if (! $this->hideifnotallowed) print '<td class="tmenu"><a class="tmenudisabled" '.$idsel.'href="#">'.$langs->trans("Tools").'</a></td>';
} }
} }
// Telephonie // Telephonie
if ($conf->telephonie->enabled && $user->rights->telephonie->lire) if (! empty($conf->telephonie->enabled) && $user->rights->telephonie->lire)
{ {
$class=""; $class="";
if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"])) if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"]))
@ -275,7 +275,7 @@ class MenuTop {
} }
// Energie // Energie
if ($conf->energie->enabled) if (! empty($conf->energie->enabled))
{ {
$langs->load("energy"); $langs->load("energy");
$class=""; $class="";
@ -291,12 +291,12 @@ class MenuTop {
$idsel='id="energie" '; $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>'; 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 // OSCommerce 1
if ($conf->boutique->enabled) if (! empty($conf->boutique->enabled))
{ {
$langs->load("shop"); $langs->load("shop");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop")
{ {
@ -306,16 +306,16 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="shop" '; $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>'; 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 // OSCommerce WS
if ($conf->oscommercews->enabled) if (! empty($conf->oscommercews->enabled))
{ {
$langs->load("shop"); $langs->load("shop");
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "shop")
{ {
@ -325,16 +325,16 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="shop" '; $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>'; 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 // Members
if ($conf->adherent->enabled) if ($conf->adherent->enabled)
{ {
// $langs->load("members"); Added in main file // $langs->load("members"); Added in main file
$class=""; $class="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members") if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "members")
{ {
@ -344,7 +344,7 @@ class MenuTop {
{ {
$class = 'class="tmenu"'; $class = 'class="tmenu"';
} }
$idsel='id="members" '; $idsel='id="members" ';
if ($user->rights->adherent->lire) if ($user->rights->adherent->lire)
{ {
@ -387,8 +387,8 @@ class MenuTop {
} }
} }
} }
print '</tr></table>'; print '</tr></table>';
} }

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* 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> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -124,17 +124,18 @@ if ($user->societe_id == 0)
$var=true; $var=true;
// Condition à vérifier pour affichage de chaque ligne du tableau de bord // Condition à vérifier pour affichage de chaque ligne du tableau de bord
$conditions=array($conf->societe->enabled && $user->rights->societe->lire, $conditions=array(
$conf->societe->enabled && $user->rights->societe->lire, ! empty($conf->societe->enabled) && $user->rights->societe->lire,
$conf->fournisseur->enabled && $user->rights->fournisseur->lire, ! empty($conf->societe->enabled) && $user->rights->societe->lire,
$conf->adherent->enabled && $user->rights->adherent->lire, ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire,
$conf->produit->enabled && $user->rights->produit->lire, ! empty($conf->adherent->enabled) && $user->rights->adherent->lire,
$conf->service->enabled && $user->rights->produit->lire, ! empty($conf->produit->enabled) && $user->rights->produit->lire,
$conf->propal->enabled && $user->rights->propale->lire, ! empty($conf->service->enabled) && $user->rights->produit->lire,
$conf->commande->enabled && $user->rights->commande->lire, ! empty($conf->propal->enabled) && $user->rights->propale->lire,
$conf->facture->enabled && $user->rights->facture->lire, ! empty($conf->commande->enabled) && $user->rights->commande->lire,
$conf->telephonie->enabled && $user->rights->telephonie->lire, ! empty($conf->facture->enabled) && $user->rights->facture->lire,
$conf->societe->enabled && $user->rights->contrat->activer); ! 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 // Fichier des classes qui contiennent la methode load_state_board pour chaque ligne
$includes=array(DOL_DOCUMENT_ROOT."/client.class.php", $includes=array(DOL_DOCUMENT_ROOT."/client.class.php",
DOL_DOCUMENT_ROOT."/prospect.class.php", DOL_DOCUMENT_ROOT."/prospect.class.php",
@ -219,7 +220,7 @@ if ($user->societe_id == 0)
"bills", "bills",
"", "",
"Contracts"); "Contracts");
//print memory_get_usage()."<br>"; //print memory_get_usage()."<br>";
// Boucle et affiche chaque ligne du tableau // Boucle et affiche chaque ligne du tableau
@ -585,7 +586,7 @@ if (sizeof($boxarray))
print '<tr><td class="notopnoleftnoright">'."\n"; print '<tr><td class="notopnoleftnoright">'."\n";
print '<table width="100%" style="border-collapse: collapse; border: 0px; margin: 0px; padding: 0px;"><tr>'; print '<table width="100%" style="border-collapse: collapse; border: 0px; margin: 0px; padding: 0px;"><tr>';
// Affichage colonne gauche // Affichage colonne gauche
print '<td width="50%" valign="top">'."\n"; print '<td width="50%" valign="top">'."\n";
@ -622,7 +623,7 @@ if (sizeof($boxarray))
print "</td>\n"; print "</td>\n";
// Affichage colonne droite // Affichage colonne droite
print '<td width="50%" valign="top">'; print '<td width="50%" valign="top">';
print "\n<!-- Box right container -->\n"; print "\n<!-- Box right container -->\n";
print '<div id="right">'."\n"; print '<div id="right">'."\n";

View File

@ -260,7 +260,7 @@ function dol_syslog($message, $level=LOG_INFO)
{ {
$facility = LOG_USER; $facility = LOG_USER;
} }
unset ($facility);
openlog("dolibarr", LOG_PID | LOG_PERROR, $facility); openlog("dolibarr", LOG_PID | LOG_PERROR, $facility);
if (! $level) if (! $level)
@ -2051,7 +2051,7 @@ function price($amount, $html=0, $outlangs='', $trunc=1, $rounding=2)
$amount = ereg_replace(',','.',$amount); // should be useless $amount = ereg_replace(',','.',$amount); // should be useless
//print $amount."-"; //print $amount."-";
$datas = split('\.',$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 $decpart = eregi_replace('0+$','',$decpart); // Supprime les 0 de fin de partie decimale
//print "decpart=".$decpart."<br>"; //print "decpart=".$decpart."<br>";
$end=''; $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 if (eregi('^http:',$_SERVER["SCRIPT_URI"]) && ! eregi('^https:',$_SERVER["SCRIPT_URI"])) // If link is http
{ {
$newurl=eregi_replace('^http:','https:',$_SERVER["SCRIPT_URI"]); $newurl=eregi_replace('^http:','https:',$_SERVER["SCRIPT_URI"]);
dolibarr_syslog("dolibarr_main_force_https is on, we make a redirect to ".$newurl,LOG_DEBUG); dolibarr_syslog("dolibarr_main_force_https is on, we make a redirect to ".$newurl,LOG_DEBUG);
header("Location: ".$newurl); header("Location: ".$newurl);
exit; exit;
@ -160,7 +160,7 @@ dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id()
// Disable modules (this must be after session_start) // Disable modules (this must be after session_start)
if (! empty($_REQUEST["disablemodules"])) $_SESSION["disablemodules"]=$_REQUEST["disablemodules"]; if (! empty($_REQUEST["disablemodules"])) $_SESSION["disablemodules"]=$_REQUEST["disablemodules"];
if (! empty($_SESSION["disablemodules"])) if (! empty($_SESSION["disablemodules"]))
{ {
$disabled_modules=split(',',$_SESSION["disablemodules"]); $disabled_modules=split(',',$_SESSION["disablemodules"]);
foreach($disabled_modules as $module) foreach($disabled_modules as $module)
@ -220,11 +220,11 @@ if (! isset($_SESSION["dol_login"]))
dolibarr_syslog('Bad value for code, connexion refused'); dolibarr_syslog('Bad value for code, connexion refused');
$langs->load('main'); $langs->load('main');
$langs->load('other'); $langs->load('other');
$user->trigger_mesg='ErrorBadValueForCode - login='.$_POST["username"]; $user->trigger_mesg='ErrorBadValueForCode - login='.$_POST["username"];
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadValueForCode"); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadValueForCode");
$test=false; $test=false;
// Appel des triggers // Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php"); include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($db); $interface=new Interfaces($db);
@ -282,7 +282,7 @@ if (! isset($_SESSION["dol_login"]))
// Bad password. No authmode has found a good password. // Bad password. No authmode has found a good password.
$user->trigger_mesg=$langs->trans("ErrorBadLoginPassword").' - login='.$_POST["username"]; $user->trigger_mesg=$langs->trans("ErrorBadLoginPassword").' - login='.$_POST["username"];
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword"); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
// Appel des triggers // Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php"); include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($db); $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_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_compile)) $dolibarr_smarty_compile=DOL_DATA_ROOT.'/smarty/templates/temp';
if (empty($dolibarr_smarty_cache)) $dolibarr_smarty_cache=DOL_DATA_ROOT.'/smarty/cache/temp'; if (empty($dolibarr_smarty_cache)) $dolibarr_smarty_cache=DOL_DATA_ROOT.'/smarty/cache/temp';
$smarty_libs = $dolibarr_smarty_libs_dir. "Smarty.class.php"; $smarty_libs = $dolibarr_smarty_libs_dir. "Smarty.class.php";
if (file_exists ($smarty_libs)) if (file_exists ($smarty_libs))
{ {
@ -559,7 +559,7 @@ if ($user->statut < 1)
accessforbidden($langs->trans("ErrorLoginDisabled")); accessforbidden($langs->trans("ErrorLoginDisabled"));
exit; exit;
} }
dolibarr_syslog("Access to ".$_SERVER["PHP_SELF"],LOG_INFO); 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("CurrentTheme").'</b>: '.$conf->theme;
$htmltext.='<br><b>'.$langs->trans("CurrentUserLanguage").'</b>: '.$langs->getDefaultLang(); $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"])); if (! empty($_SESSION["disablemodules"])) $htmltext.='<br><b>'.$langs->trans("DisabledModules").'</b>: <br>'.join('<br>',split(',',$_SESSION["disablemodules"]));
$html=new Form($db); $html=new Form($db);
print $html->textwithtooltip('',$htmltext,2,1,$text); 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', $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'); img_object($langs->trans("List"),'user').' '.$langs->trans("Members"), 'member', 'sall');
} }
if ($ret) if ($ret)
{ {
print "\n"; print "\n";
@ -894,7 +894,7 @@ function left_menu($menu_array, $helppagename='', $form_search='')
print '</div>'."\n"; print '</div>'."\n";
print "<!-- End SearchForm -->\n"; print "<!-- End SearchForm -->\n";
} }
// Zone de recherche supplementaire // Zone de recherche supplementaire
if ($form_search) 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 // Lien vers le bugtrack
$bugbaseurl='http://savannah.nongnu.org/bugs/?'; $bugbaseurl='http://savannah.nongnu.org/bugs/?';
@ -1020,18 +1020,18 @@ function llxFooter($foot='',$limitIEbug=1)
if (sizeof($conf->logbuffer)) if (sizeof($conf->logbuffer))
{ {
print "\n"; print "\n";
print "<!-- Start of log output\n"; print "<!-- Start of log output\n";
//print '<div class="hidden">'."\n"; //print '<div class="hidden">'."\n";
foreach($conf->logbuffer as $logline) foreach($conf->logbuffer as $logline)
{ {
print $logline."<br>\n"; print $logline."<br>\n";
} }
//print '</div>'."\n"; //print '</div>'."\n";
print "End of log output -->\n"; print "End of log output -->\n";
} }
print "\n"; print "\n";
if ($foot) print '<!-- '.$foot.' -->'."\n"; if ($foot) print '<!-- '.$foot.' -->'."\n";
print "</body>\n"; print "</body>\n";
print "</html>\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'; if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation='latin1_swedish_ci';
$conf->db->dolibarr_main_db_collation=$dolibarr_main_db_collation; $conf->db->dolibarr_main_db_collation=$dolibarr_main_db_collation;
// Identifiant autres // Identifiant autres
$conf->main_authentication = $dolibarr_main_authentication; $conf->main_authentication = empty($dolibarr_main_authentication)?'':$dolibarr_main_authentication;
// Force https // 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) // 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'; if (empty($force_charset_do_notuse)) $force_charset_do_notuse='UTF-8';
$conf->character_set_client=strtoupper($force_charset_do_notuse); $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->fax=$conf->global->MAIN_INFO_SOCIETE_FAX;
$mysoc->url=$conf->global->MAIN_INFO_SOCIETE_WEB; $mysoc->url=$conf->global->MAIN_INFO_SOCIETE_WEB;
// Anciens id prof // Anciens id prof
$mysoc->siren=$conf->global->MAIN_INFO_SIREN; $mysoc->siren=empty($conf->global->MAIN_INFO_SIREN)?'':$conf->global->MAIN_INFO_SIREN;
$mysoc->siret=$conf->global->MAIN_INFO_SIRET; $mysoc->siret=empty($conf->global->MAIN_INFO_SIRET)?'':$conf->global->MAIN_INFO_SIRET;
$mysoc->ape=$conf->global->MAIN_INFO_APE; $mysoc->ape=empty($conf->global->MAIN_INFO_APE)?'':$conf->global->MAIN_INFO_APE;
$mysoc->rcs=$conf->global->MAIN_INFO_RCS; $mysoc->rcs=empty($conf->global->MAIN_INFO_RCS)?'':$conf->global->MAIN_INFO_RCS;
// Id prof génériques // Id prof génériques
$mysoc->profid1=$conf->global->MAIN_INFO_SIREN; $mysoc->profid1=empty($conf->global->MAIN_INFO_SIREN)?'':$conf->global->MAIN_INFO_SIREN;
$mysoc->profid2=$conf->global->MAIN_INFO_SIRET; $mysoc->profid2=empty($conf->global->MAIN_INFO_SIRET)?'':$conf->global->MAIN_INFO_SIRET;
$mysoc->profid3=$conf->global->MAIN_INFO_APE; $mysoc->profid3=empty($conf->global->MAIN_INFO_APE)?'':$conf->global->MAIN_INFO_APE;
$mysoc->profid4=$conf->global->MAIN_INFO_RCS; $mysoc->profid4=empty($conf->global->MAIN_INFO_RCS)?'':$conf->global->MAIN_INFO_RCS;
$mysoc->tva_assuj=$conf->global->FACTURE_TVAOPTION; $mysoc->tva_assuj=$conf->global->FACTURE_TVAOPTION;
$mysoc->tva_intra=$conf->global->MAIN_INFO_TVAINTRA; $mysoc->tva_intra=$conf->global->MAIN_INFO_TVAINTRA;
$mysoc->capital=$conf->global->MAIN_INFO_CAPITAL; $mysoc->capital=$conf->global->MAIN_INFO_CAPITAL;

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Éric Seigne <erics@rycks.com> * Copyright (C) 2003 É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 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be> * Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
* *
@ -21,180 +21,180 @@
*/ */
/** /**
\file htdocs/pre.inc.php \file htdocs/pre.inc.php
\brief File to manage left menu for home page \brief File to manage left menu for home page
\version $Id$ \version $Id$
*/ */
require ("./main.inc.php"); require ("./main.inc.php");
function llxHeader($head = "") function llxHeader($head = "")
{ {
global $user, $conf, $langs; global $user, $conf, $langs;
top_menu($head); top_menu($head);
$menu = new Menu(); $menu = new Menu();
if ($conf->societe->enabled && $user->rights->societe->lire) if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
{ {
$langs->load("companies"); $langs->load("companies");
$menu->add(DOL_URL_ROOT."/societe.php", $langs->trans("Companies")); $menu->add(DOL_URL_ROOT."/societe.php", $langs->trans("Companies"));
if ($user->rights->societe->creer) if ($user->rights->societe->creer)
{ {
$menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create", $langs->trans("MenuNewCompany")); $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"); $langs->load("categories");
$menu->add(DOL_URL_ROOT."/categories/index.php?type=0", $langs->trans("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) if (! empty($conf->commercial->enabled) && isset($user->rights->commercial->lire) && $user->rights->commercial->lire)
{ {
$langs->load("commercial"); $langs->load("commercial");
$menu->add(DOL_URL_ROOT."/comm/index.php",$langs->trans("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/clients.php",$langs->trans("Customers"));
$menu->add_submenu(DOL_URL_ROOT."/comm/prospect/prospects.php",$langs->trans("Prospects")); $menu->add_submenu(DOL_URL_ROOT."/comm/prospect/prospects.php",$langs->trans("Prospects"));
if ($user->rights->propale->lire) if ($user->rights->propale->lire)
{ {
$langs->load("propal"); $langs->load("propal");
$menu->add_submenu(DOL_URL_ROOT."/comm/propal.php", $langs->trans("Prop")); $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) if (! empty($conf->compta->enabled) || $conf->comptaexpert->enabled)
{ {
$menu->add_submenu(DOL_URL_ROOT."/product/album/index.php", "Albums"); $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) if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{ {
$langs->load("orders"); $langs->load("orders");
$menu->add(DOL_URL_ROOT."/commande/index.php", $langs->trans("Orders")); $menu->add(DOL_URL_ROOT."/commande/index.php", $langs->trans("Orders"));
} }
if ($conf->document->enabled) if (! empty($conf->document->enabled))
{ {
$menu->add(DOL_URL_ROOT."/docs/index.php", $langs->trans("Documents")); $menu->add(DOL_URL_ROOT."/docs/index.php", $langs->trans("Documents"));
} }
if ($conf->expedition->enabled && $user->rights->expedition->lire) if (! empty($conf->expedition->enabled) && $user->rights->expedition->lire)
{ {
$langs->load("sendings"); $langs->load("sendings");
$menu->add(DOL_URL_ROOT."/expedition/index.php", $langs->trans("Sendings")); $menu->add(DOL_URL_ROOT."/expedition/index.php", $langs->trans("Sendings"));
} }
if ($conf->mailing->enabled && $user->rights->mailing->lire) if (! empty($conf->mailing->enabled) && $user->rights->mailing->lire)
{ {
$langs->load("mails"); $langs->load("mails");
$menu->add(DOL_URL_ROOT."/comm/mailing/index.php",$langs->trans("EMailings")); $menu->add(DOL_URL_ROOT."/comm/mailing/index.php",$langs->trans("EMailings"));
} }
if ($conf->telephonie->enabled) if (! empty($conf->telephonie->enabled))
{ {
$menu->add(DOL_URL_ROOT."/telephonie/index.php", "Téléphonie"); $menu->add(DOL_URL_ROOT."/telephonie/index.php", "Téléphonie");
} }
if ($conf->don->enabled) if (! empty($conf->don->enabled))
{ {
$menu->add(DOL_URL_ROOT."/compta/dons/index.php", $langs->trans("Donations")); $menu->add(DOL_URL_ROOT."/compta/dons/index.php", $langs->trans("Donations"));
} }
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire)
{ {
$langs->load("suppliers"); $langs->load("suppliers");
$menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
} }
if ($conf->voyage->enabled && $user->societe_id == 0) if (! empty($conf->voyage->enabled) && $user->societe_id == 0)
{ {
$menu->add(DOL_URL_ROOT."/compta/voyage/index.php","Voyages"); $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/index.php","Voyages");
$menu->add_submenu(DOL_URL_ROOT."/compta/voyage/reduc.php","Reduc"); $menu->add_submenu(DOL_URL_ROOT."/compta/voyage/reduc.php","Reduc");
} }
if ($conf->domaine->enabled) if (! empty($conf->domaine->enabled))
{ {
$menu->add(DOL_URL_ROOT."/domain/index.php", "Domaines"); $menu->add(DOL_URL_ROOT."/domain/index.php", "Domaines");
} }
if ($conf->postnuke->enabled) if (! empty($conf->postnuke->enabled))
{ {
$menu->add(DOL_URL_ROOT."/postnuke/articles/index.php", "Editorial"); $menu->add(DOL_URL_ROOT."/postnuke/articles/index.php", "Editorial");
} }
if ($conf->bookmark->enabled && $user->rights->bookmark->lire) if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire)
{ {
$menu->add(DOL_URL_ROOT."/bookmarks/liste.php", $langs->trans("Bookmarks")); $menu->add(DOL_URL_ROOT."/bookmarks/liste.php", $langs->trans("Bookmarks"));
} }
if ($conf->export->enabled) if (! empty($conf->export->enabled))
{ {
$langs->load("exports"); $langs->load("exports");
$menu->add(DOL_URL_ROOT."/exports/index.php", $langs->trans("Exports")); $menu->add(DOL_URL_ROOT."/exports/index.php", $langs->trans("Exports"));
} }
if ($user->rights->user->user->lire || $user->admin) if ($user->rights->user->user->lire || $user->admin)
{ {
$langs->load("users"); $langs->load("users");
$menu->add(DOL_URL_ROOT."/user/home.php", $langs->trans("MenuUsersAndGroups")); $menu->add(DOL_URL_ROOT."/user/home.php", $langs->trans("MenuUsersAndGroups"));
} }
if ($user->admin) if ($user->admin)
{ {
$menu->add(DOL_URL_ROOT."/admin/index.php", $langs->trans("Setup")); $menu->add(DOL_URL_ROOT."/admin/index.php", $langs->trans("Setup"));
} }
left_menu($menu->liste); left_menu($menu->liste);
} }
?> ?>

View File

@ -1,11 +1,11 @@
<?php <?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * 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 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.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 * 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 * it under the terms of the GNU General Public License as published by
@ -1717,7 +1717,7 @@ class Propal extends CommonObject
if ($resql) if ($resql)
{ {
if ($mode == 'opened') $delay_warning=$conf->propal->cloture->warning_delay; 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)) while ($obj=$this->db->fetch_object($resql))
{ {