Removed PHP warnings with E_ALL level

This commit is contained in:
Laurent Destailleur 2009-01-21 13:20:26 +00:00
parent bdfecdc751
commit 7683f0f85e
6 changed files with 50 additions and 47 deletions

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>
* *
* 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
@ -31,9 +31,11 @@ $langs->load("companies");
if (!$user->admin) if (!$user->admin)
accessforbidden(); accessforbidden();
$mesg='';
/* /*
* Affichage page * View
*/ */
llxHeader(); llxHeader();
@ -46,7 +48,7 @@ print_fiche_titre($langs->trans("SetupArea"),'','setup');
print "<br>"; print "<br>";
print '<center><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo_2.png" alt="Dolibarr logo"></center><br>'; print '<center><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo_2.png" alt="Dolibarr logo"></center><br>';
if ($message) print $message.'<br>'; if ($mesg) print $mesg.'<br>';
print "<br>"; print "<br>";
print $langs->trans("SetupDescription1")."<br>"; print $langs->trans("SetupDescription1")."<br>";

View File

@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
/** /**
* \file htdocs/admin/modules.php * \file htdocs/admin/modules.php
* \brief Page de configuration et activation des modules * \brief Page de configuration et activation des modules
@ -39,7 +39,7 @@ if (!$user->admin)
* Actions * Actions
*/ */
if ($_GET["action"] == 'set' && $user->admin) if (isset($_GET["action"]) && $_GET["action"] == 'set' && $user->admin)
{ {
$result=Activate($_GET["value"]); $result=Activate($_GET["value"]);
$mesg=''; $mesg='';
@ -48,7 +48,7 @@ if ($_GET["action"] == 'set' && $user->admin)
exit; exit;
} }
if ($_GET["action"] == 'reset' && $user->admin) if (isset($_GET["action"]) && $_GET["action"] == 'reset' && $user->admin)
{ {
$result=UnActivate($_GET["value"]); $result=UnActivate($_GET["value"]);
$mesg=''; $mesg='';
@ -70,21 +70,21 @@ function Activate($value,$withdeps=1)
$modName = $value; $modName = $value;
$ret=''; $ret='';
// Activation du module // Activation du module
if ($modName) if ($modName)
{ {
$file = $modName . ".class.php"; $file = $modName . ".class.php";
// Loop on each directory // Loop on each directory
foreach ($conf->dol_document_root as $dol_document_root) foreach ($conf->dol_document_root as $dol_document_root)
{ {
$found=@include_once($dol_document_root."/includes/modules/".$file); $found=@include_once($dol_document_root."/includes/modules/".$file);
if ($found) break; if ($found) break;
} }
$objMod = new $modName($db); $objMod = new $modName($db);
// Test si version PHP ok // Test si version PHP ok
$verphp=versionphparray(); $verphp=versionphparray();
$vermin=$objMod->phpmin; $vermin=$objMod->phpmin;
@ -92,7 +92,7 @@ function Activate($value,$withdeps=1)
{ {
return $langs->trans("ErrorModuleRequirePHPVersion",versiontostring($vermin)); return $langs->trans("ErrorModuleRequirePHPVersion",versiontostring($vermin));
} }
// Test si version Dolibarr ok // Test si version Dolibarr ok
$verdol=versiondolibarrarray(); $verdol=versiondolibarrarray();
$vermin=$objMod->need_dolibarr_version; $vermin=$objMod->need_dolibarr_version;
@ -112,7 +112,7 @@ function Activate($value,$withdeps=1)
{ {
Activate($objMod->depends[$i]); Activate($objMod->depends[$i]);
} }
// Desactivation des modules qui entrent en conflit // Desactivation des modules qui entrent en conflit
for ($i = 0; $i < sizeof($objMod->conflictwith); $i++) for ($i = 0; $i < sizeof($objMod->conflictwith); $i++)
{ {
@ -147,7 +147,7 @@ function UnActivate($value,$requiredby=1)
{ {
$found=@include_once($dol_document_root."/includes/modules/".$file); $found=@include_once($dol_document_root."/includes/modules/".$file);
if ($found) break; if ($found) break;
} }
if ($found) if ($found)
{ {
@ -204,7 +204,7 @@ foreach ($conf->dol_document_root as $dirroot)
// Load modules attributes in arrays (name, numero, orders) from dir directory // Load modules attributes in arrays (name, numero, orders) from dir directory
//print $dir."\n<br>"; //print $dir."\n<br>";
$handle=opendir($dir); $handle=opendir($dir);
if ($handle) if ($handle)
{ {
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
@ -212,12 +212,12 @@ foreach ($conf->dol_document_root as $dirroot)
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php') if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php')
{ {
$modName = substr($file, 0, strlen($file) - 10); $modName = substr($file, 0, strlen($file) - 10);
if ($modName) if ($modName)
{ {
include_once($dir.$file); include_once($dir.$file);
$objMod = new $modName($db); $objMod = new $modName($db);
if ($objMod->numero > 0) if ($objMod->numero > 0)
{ {
$j = $objMod->numero; $j = $objMod->numero;
@ -226,26 +226,27 @@ foreach ($conf->dol_document_root as $dirroot)
{ {
$j = 1000 + $i; $j = 1000 + $i;
} }
$modulequalified=1; $modulequalified=1;
// We discard modules that does not respect constraint on menu handlers // We discard modules that does not respect constraint on menu handlers
if ($objMod->needleftmenu && sizeof($objMod->needleftmenu) && ! in_array($conf->left_menu,$objMod->needleftmenu)) $modulequalified=0; if (! empty($objMod->needleftmenu) && sizeof($objMod->needleftmenu) && ! in_array($conf->left_menu,$objMod->needleftmenu)) $modulequalified=0;
if ($objMod->needtopmenu && sizeof($objMod->needtopmenu) && ! in_array($conf->top_menu,$objMod->needtopmenu)) $modulequalified=0; if (! empty($objMod->needtopmenu) && sizeof($objMod->needtopmenu) && ! in_array($conf->top_menu,$objMod->needtopmenu)) $modulequalified=0;
// We discard modules according to features level (PS: if module is activated we always show it) // We discard modules according to features level (PS: if module is activated we always show it)
$const_name = 'MAIN_MODULE_'.strtoupper(eregi_replace('^mod','',get_class($objMod))); $const_name = 'MAIN_MODULE_'.strtoupper(eregi_replace('^mod','',get_class($objMod)));
if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0; if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0;
if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0; if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0;
if ($modulequalified) if ($modulequalified)
{ {
$modules[$i] = $objMod; $modules[$i] = $objMod;
$filename[$i]= $modName; $filename[$i]= $modName;
$orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module $orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
//print "x".$modName." ".$orders[$i]."\n<br>"; //print "x".$modName." ".$orders[$i]."\n<br>";
$categ[$objMod->special]++; // Array of all different modules categories if (isset($categ[$objMod->special])) $categ[$objMod->special]++; // Array of all different modules categories
$dirmod[$i] = $dirroot; else $categ[$objMod->special]=1;
$dirmod[$i] = $dirroot;
$j++; $j++;
$i++; $i++;
} }
@ -272,7 +273,7 @@ print "<br>\n";
$h = 0; $h = 0;
$categidx=0; $categidx=0;
if ($categ[$categidx]) if (! empty($categ[$categidx]))
{ {
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $langs->trans("ModulesCommon"); $head[$h][1] = $langs->trans("ModulesCommon");
@ -281,7 +282,7 @@ if ($categ[$categidx])
} }
$categidx=1; $categidx=1;
if ($categ[$categidx]) if (! empty($categ[$categidx]))
{ {
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $langs->trans("ModulesInterfaces"); $head[$h][1] = $langs->trans("ModulesInterfaces");
@ -290,7 +291,7 @@ if ($categ[$categidx])
} }
$categidx=2; $categidx=2;
if ($categ[$categidx]) if (! empty($categ[$categidx]))
{ {
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $langs->trans("ModulesOther"); $head[$h][1] = $langs->trans("ModulesOther");
@ -299,7 +300,7 @@ if ($categ[$categidx])
} }
$categidx=3; $categidx=3;
if ($categ[$categidx]) if (! empty($categ[$categidx]))
{ {
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $langs->trans("ModulesJob"); $head[$h][1] = $langs->trans("ModulesJob");
@ -327,7 +328,8 @@ print "</tr>\n";
// Affichage liste modules // Affichage liste modules
$var=True; $var=true;
$oldfamily='';
$familylib=array( $familylib=array(
'base'=>$langs->trans("ModuleFamilyBase"), 'base'=>$langs->trans("ModuleFamilyBase"),
@ -351,14 +353,14 @@ foreach ($orders as $key => $value)
$const_name = 'MAIN_MODULE_'.strtoupper(eregi_replace('^mod','',get_class($objMod))); $const_name = 'MAIN_MODULE_'.strtoupper(eregi_replace('^mod','',get_class($objMod)));
// Load all lang files of module // Load all lang files of module
if (is_array($objMod->langfiles)) if (isset($objMod->langfiles) && is_array($objMod->langfiles))
{ {
foreach($objMod->langfiles as $domain) foreach($objMod->langfiles as $domain)
{ {
$langs->load($domain); $langs->load($domain);
} }
} }
// Print a separator if we change family // Print a separator if we change family
if ($oldfamily && $family!=$oldfamily && $atleastoneforfamily) { if ($oldfamily && $family!=$oldfamily && $atleastoneforfamily) {
print "<tr class=\"liste_titre\">\n <td colspan=\"9\"></td>\n</tr>\n"; print "<tr class=\"liste_titre\">\n <td colspan=\"9\"></td>\n</tr>\n";
@ -387,7 +389,7 @@ foreach ($orders as $key => $value)
} }
print "</td>\n"; print "</td>\n";
print ' <td valign="top" width="14" align="center">'; print ' <td valign="top" width="14" align="center">';
print $objMod->picto?img_object('',$objMod->picto):img_object('','generic'); print ! empty($objMod->picto)?img_object('',$objMod->picto):img_object('','generic');
print '</td><td valign="top">'.$objMod->getName(); print '</td><td valign="top">'.$objMod->getName();
print "</td>\n <td valign=\"top\">"; print "</td>\n <td valign=\"top\">";
print nl2br($objMod->getDesc()); print nl2br($objMod->getDesc());
@ -397,7 +399,7 @@ foreach ($orders as $key => $value)
// print $objMod->getDbVersion(); // print $objMod->getDbVersion();
print "</td>\n <td align=\"center\" valign=\"top\">"; print "</td>\n <td align=\"center\" valign=\"top\">";
if ($conf->global->$const_name) if (! empty($conf->global->$const_name))
{ {
print img_tick(); print img_tick();
} }
@ -408,13 +410,13 @@ foreach ($orders as $key => $value)
print "</td>\n <td align=\"center\" valign=\"top\">"; print "</td>\n <td align=\"center\" valign=\"top\">";
if ($conf->global->$const_name) if (! empty($conf->global->$const_name))
{ {
// Module actif // Module actif
if ($objMod->always_enabled) print $langs->trans("Required"); if (! empty($objMod->always_enabled)) print $langs->trans("Required");
else print "<a href=\"modules.php?id=".$objMod->numero."&amp;action=reset&amp;value=" . $modName . "&amp;mode=" . $mode . "\">" . $langs->trans("Disable") . "</a></td>\n"; else print "<a href=\"modules.php?id=".$objMod->numero."&amp;action=reset&amp;value=" . $modName . "&amp;mode=" . $mode . "\">" . $langs->trans("Disable") . "</a></td>\n";
if ($objMod->config_page_url) if (! empty($objMod->config_page_url))
{ {
if (is_array($objMod->config_page_url)) if (is_array($objMod->config_page_url))
{ {
@ -450,7 +452,7 @@ foreach ($orders as $key => $value)
} }
else else
{ {
if ($objMod->always_enabled) if (! empty($objMod->always_enabled))
{ {
// Ne devrait pas arriver. // Ne devrait pas arriver.
} }

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com> * Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -35,10 +35,10 @@ function llxHeader($head = '', $title='', $help_url='')
{ {
global $conf, $user, $langs; global $conf, $user, $langs;
top_menu($head, $title, $target); top_menu($head, $title, '');
$menuarray=array(); $menuarray=array();
//if ($conf->left_menu == 'rodolphe.php') //if ($conf->left_menu == 'rodolphe.php')
//{ //{
$langs->load("admin"); $langs->load("admin");
@ -60,7 +60,7 @@ function llxHeader($head = '', $title='', $help_url='')
$menu->add(DOL_URL_ROOT."/admin/tools/", $langs->trans("Tools")); $menu->add(DOL_URL_ROOT."/admin/tools/", $langs->trans("Tools"));
$varmenuarray=$menu->liste; $varmenuarray=$menu->liste;
//} //}
left_menu($varmenuarray, $help_url); left_menu($varmenuarray, $help_url);
} }

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-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* *
@ -81,7 +81,6 @@ class modComptabiliteExpert extends DolibarrModules
$this->dirs[0] = $conf->comptaexpert->dir_output; $this->dirs[0] = $conf->comptaexpert->dir_output;
$this->dirs[1] = $conf->comptaexpert->dir_output."/rapport"; $this->dirs[1] = $conf->comptaexpert->dir_output."/rapport";
$this->dirs[2] = $conf->comptaexpert->dir_output."/export"; $this->dirs[2] = $conf->comptaexpert->dir_output."/export";
$this->dirs[3] = $conf->comptaexpert->dir_images;
// Boites // Boites
$this->boxes = array(); $this->boxes = array();

View File

@ -60,7 +60,7 @@ class modProduit extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr'; $this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0; $this->special = 0;
$this->picto='product'; $this->picto='product';
@ -152,7 +152,7 @@ class modProduit extends DolibarrModules
$r=0; $r=0;
$r++; $r++;
$this->import_code[$r]=$this->id.'_'.$r; $this->import_code[$r]=$this->rights_class.'_'.$r;
$this->import_label[$r]="ProductsOrServices"; // Translation key $this->import_label[$r]="ProductsOrServices"; // Translation key
$this->import_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.envente'=>"OnSell",'p.duration'=>"Duration"); $this->import_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.envente'=>"OnSell",'p.duration'=>"Duration");
$this->import_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>'product','p.envente'=>"product",'p.duration'=>"product"); $this->import_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>'product','p.envente'=>"product",'p.duration'=>"product");
@ -161,7 +161,7 @@ class modProduit extends DolibarrModules
if($conf->global->PRODUIT_MULTIPRICES) if($conf->global->PRODUIT_MULTIPRICES)
{ {
$this->import_multiprices[$r]=array(); $this->import_multiprices[$r]=array();
for($i=1;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++) for($i=1;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++)
{ {
$this->import_multiprices[$r][$i]["price_ht"] = "SellingPriceHT ".$i; $this->import_multiprices[$r][$i]["price_ht"] = "SellingPriceHT ".$i;

View File

@ -57,8 +57,8 @@ else
} }
// Forcage du parametrage PHP error_reporting (Dolibarr non utilisable en mode error E_ALL) // Forcage du parametrage PHP error_reporting (Dolibarr non utilisable en mode error E_ALL)
//error_reporting(E_ALL);
error_reporting(E_ALL ^ E_NOTICE); error_reporting(E_ALL ^ E_NOTICE);
error_reporting(E_ALL);
// Include configuration // Include configuration