Skip to content
Snippets Groups Projects
Commit 7683f0f8 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Removed PHP warnings with E_ALL level

parent bdfecdc7
No related branches found
No related tags found
No related merge requests found
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
......@@ -31,9 +31,11 @@ $langs->load("companies");
if (!$user->admin)
accessforbidden();
$mesg='';
/*
* Affichage page
* View
*/
llxHeader();
......@@ -46,7 +48,7 @@ print_fiche_titre($langs->trans("SetupArea"),'','setup');
print "<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 $langs->trans("SetupDescription1")."<br>";
......
......@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* \file htdocs/admin/modules.php
* \brief Page de configuration et activation des modules
......@@ -39,7 +39,7 @@ if (!$user->admin)
* Actions
*/
if ($_GET["action"] == 'set' && $user->admin)
if (isset($_GET["action"]) && $_GET["action"] == 'set' && $user->admin)
{
$result=Activate($_GET["value"]);
$mesg='';
......@@ -48,7 +48,7 @@ if ($_GET["action"] == 'set' && $user->admin)
exit;
}
if ($_GET["action"] == 'reset' && $user->admin)
if (isset($_GET["action"]) && $_GET["action"] == 'reset' && $user->admin)
{
$result=UnActivate($_GET["value"]);
$mesg='';
......@@ -70,21 +70,21 @@ function Activate($value,$withdeps=1)
$modName = $value;
$ret='';
// Activation du module
if ($modName)
{
$file = $modName . ".class.php";
// Loop on each directory
foreach ($conf->dol_document_root as $dol_document_root)
{
$found=@include_once($dol_document_root."/includes/modules/".$file);
if ($found) break;
}
$objMod = new $modName($db);
// Test si version PHP ok
$verphp=versionphparray();
$vermin=$objMod->phpmin;
......@@ -92,7 +92,7 @@ function Activate($value,$withdeps=1)
{
return $langs->trans("ErrorModuleRequirePHPVersion",versiontostring($vermin));
}
// Test si version Dolibarr ok
$verdol=versiondolibarrarray();
$vermin=$objMod->need_dolibarr_version;
......@@ -112,7 +112,7 @@ function Activate($value,$withdeps=1)
{
Activate($objMod->depends[$i]);
}
// Desactivation des modules qui entrent en conflit
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);
if ($found) break;
}
}
if ($found)
{
......@@ -204,7 +204,7 @@ foreach ($conf->dol_document_root as $dirroot)
// Load modules attributes in arrays (name, numero, orders) from dir directory
//print $dir."\n<br>";
$handle=opendir($dir);
if ($handle)
if ($handle)
{
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')
{
$modName = substr($file, 0, strlen($file) - 10);
if ($modName)
{
include_once($dir.$file);
$objMod = new $modName($db);
if ($objMod->numero > 0)
{
$j = $objMod->numero;
......@@ -226,26 +226,27 @@ foreach ($conf->dol_document_root as $dirroot)
{
$j = 1000 + $i;
}
$modulequalified=1;
// 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 ($objMod->needtopmenu && sizeof($objMod->needtopmenu) && ! in_array($conf->top_menu,$objMod->needtopmenu)) $modulequalified=0;
if (! empty($objMod->needleftmenu) && sizeof($objMod->needleftmenu) && ! in_array($conf->left_menu,$objMod->needleftmenu)) $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)
$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 == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0;
if ($modulequalified)
{
$modules[$i] = $objMod;
$filename[$i]= $modName;
$orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
//print "x".$modName." ".$orders[$i]."\n<br>";
$categ[$objMod->special]++; // Array of all different modules categories
$dirmod[$i] = $dirroot;
if (isset($categ[$objMod->special])) $categ[$objMod->special]++; // Array of all different modules categories
else $categ[$objMod->special]=1;
$dirmod[$i] = $dirroot;
$j++;
$i++;
}
......@@ -272,7 +273,7 @@ print "<br>\n";
$h = 0;
$categidx=0;
if ($categ[$categidx])
if (! empty($categ[$categidx]))
{
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $langs->trans("ModulesCommon");
......@@ -281,7 +282,7 @@ if ($categ[$categidx])
}
$categidx=1;
if ($categ[$categidx])
if (! empty($categ[$categidx]))
{
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $langs->trans("ModulesInterfaces");
......@@ -290,7 +291,7 @@ if ($categ[$categidx])
}
$categidx=2;
if ($categ[$categidx])
if (! empty($categ[$categidx]))
{
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $langs->trans("ModulesOther");
......@@ -299,7 +300,7 @@ if ($categ[$categidx])
}
$categidx=3;
if ($categ[$categidx])
if (! empty($categ[$categidx]))
{
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $langs->trans("ModulesJob");
......@@ -327,7 +328,8 @@ print "</tr>\n";
// Affichage liste modules
$var=True;
$var=true;
$oldfamily='';
$familylib=array(
'base'=>$langs->trans("ModuleFamilyBase"),
......@@ -351,14 +353,14 @@ foreach ($orders as $key => $value)
$const_name = 'MAIN_MODULE_'.strtoupper(eregi_replace('^mod','',get_class($objMod)));
// Load all lang files of module
if (is_array($objMod->langfiles))
if (isset($objMod->langfiles) && is_array($objMod->langfiles))
{
foreach($objMod->langfiles as $domain)
{
$langs->load($domain);
}
}
// Print a separator if we change family
if ($oldfamily && $family!=$oldfamily && $atleastoneforfamily) {
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 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>\n <td valign=\"top\">";
print nl2br($objMod->getDesc());
......@@ -397,7 +399,7 @@ foreach ($orders as $key => $value)
// print $objMod->getDbVersion();
print "</td>\n <td align=\"center\" valign=\"top\">";
if ($conf->global->$const_name)
if (! empty($conf->global->$const_name))
{
print img_tick();
}
......@@ -408,13 +410,13 @@ foreach ($orders as $key => $value)
print "</td>\n <td align=\"center\" valign=\"top\">";
if ($conf->global->$const_name)
if (! empty($conf->global->$const_name))
{
// 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";
if ($objMod->config_page_url)
if (! empty($objMod->config_page_url))
{
if (is_array($objMod->config_page_url))
{
......@@ -450,7 +452,7 @@ foreach ($orders as $key => $value)
}
else
{
if ($objMod->always_enabled)
if (! empty($objMod->always_enabled))
{
// Ne devrait pas arriver.
}
......
<?php
/* 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>
*
* 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;
top_menu($head, $title, $target);
top_menu($head, $title, '');
$menuarray=array();
//if ($conf->left_menu == 'rodolphe.php')
//{
$langs->load("admin");
......@@ -60,7 +60,7 @@ function llxHeader($head = '', $title='', $help_url='')
$menu->add(DOL_URL_ROOT."/admin/tools/", $langs->trans("Tools"));
$varmenuarray=$menu->liste;
//}
left_menu($varmenuarray, $help_url);
}
......
<?php
/* 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 Benoit Mortier <benoit.mortier@opensides.be>
*
......@@ -81,7 +81,6 @@ class modComptabiliteExpert extends DolibarrModules
$this->dirs[0] = $conf->comptaexpert->dir_output;
$this->dirs[1] = $conf->comptaexpert->dir_output."/rapport";
$this->dirs[2] = $conf->comptaexpert->dir_output."/export";
$this->dirs[3] = $conf->comptaexpert->dir_images;
// Boites
$this->boxes = array();
......
......@@ -60,7 +60,7 @@ class modProduit extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
$this->picto='product';
......@@ -152,7 +152,7 @@ class modProduit extends DolibarrModules
$r=0;
$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_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");
......@@ -161,7 +161,7 @@ class modProduit extends DolibarrModules
if($conf->global->PRODUIT_MULTIPRICES)
{
$this->import_multiprices[$r]=array();
for($i=1;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++)
{
$this->import_multiprices[$r][$i]["price_ht"] = "SellingPriceHT ".$i;
......
......@@ -57,8 +57,8 @@ else
}
// 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);
// Include configuration
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment