Qual: Removed errors and warnings reported by codesniffer
This commit is contained in:
parent
93dada968d
commit
ddcf5965fd
@ -25,7 +25,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/user/class/user.class.php
|
* \file htdocs/user/class/user.class.php
|
||||||
* \brief Fichier de la classe utilisateur
|
* \brief Fichier de la classe utilisateur
|
||||||
* \version $Id: user.class.php,v 1.44 2011/07/04 11:41:02 eldy Exp $
|
* \version $Id: user.class.php,v 1.45 2011/07/08 18:49:16 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
|
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
|
||||||
@ -99,8 +99,8 @@ class User extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructeur de la classe
|
* Constructor de la classe
|
||||||
* @param DB Handler acces base de donnees
|
* @param DoliDb $DB Database handler
|
||||||
*/
|
*/
|
||||||
function User($DB)
|
function User($DB)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
* \file htdocs/user/class/usergroup.class.php
|
* \file htdocs/user/class/usergroup.class.php
|
||||||
* \brief Fichier de la classe des groupes d'utilisateur
|
* \brief Fichier de la classe des groupes d'utilisateur
|
||||||
* \author Rodolphe Qiedeville
|
* \author Rodolphe Qiedeville
|
||||||
* \version $Id: usergroup.class.php,v 1.10 2011/07/04 11:41:04 eldy Exp $
|
* \version $Id: usergroup.class.php,v 1.11 2011/07/08 18:49:16 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
|
||||||
@ -55,8 +55,8 @@ class UserGroup extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor de la classe
|
||||||
* @param DB Handler acces base de donnees
|
* @param DoliDb $DB Database handler
|
||||||
*/
|
*/
|
||||||
function UserGroup($DB)
|
function UserGroup($DB)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/user/fiche.php
|
* \file htdocs/user/fiche.php
|
||||||
* \brief Tab of user card
|
* \brief Tab of user card
|
||||||
* \version $Id: fiche.php,v 1.273 2011/06/29 10:23:33 eldy Exp $
|
* \version $Id: fiche.php,v 1.274 2011/07/08 18:49:17 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
@ -215,7 +215,7 @@ if ($_POST["action"] == 'add' && $canadduser)
|
|||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
if (is_array($edituser->errors) && sizeof($edituser->errors)) $message='<div class="error">'.join('<br>',$langs->trans($edituser->errors)).'</div>';
|
if (is_array($edituser->errors) && count($edituser->errors)) $message='<div class="error">'.join('<br>',$langs->trans($edituser->errors)).'</div>';
|
||||||
else $message='<div class="error">'.$langs->trans($edituser->error).'</div>';
|
else $message='<div class="error">'.$langs->trans($edituser->error).'</div>';
|
||||||
$action="create"; // Go back to create page
|
$action="create"; // Go back to create page
|
||||||
}
|
}
|
||||||
@ -308,7 +308,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ret >=0 && ! sizeof($edituser->errors))
|
if ($ret >=0 && ! count($edituser->errors))
|
||||||
{
|
{
|
||||||
if (GETPOST('deletephoto') && $edituser->photo)
|
if (GETPOST('deletephoto') && $edituser->photo)
|
||||||
{
|
{
|
||||||
@ -347,7 +347,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ret >= 0 && ! sizeof($edituser->errors))
|
if ($ret >= 0 && ! count($edituser->errors))
|
||||||
{
|
{
|
||||||
$message.='<div class="ok">'.$langs->trans("UserModified").'</div>';
|
$message.='<div class="ok">'.$langs->trans("UserModified").'</div>';
|
||||||
$db->commit();
|
$db->commit();
|
||||||
@ -825,7 +825,7 @@ else
|
|||||||
$statutUACF = '';
|
$statutUACF = '';
|
||||||
|
|
||||||
//On verifie les options du compte
|
//On verifie les options du compte
|
||||||
if (sizeof($ldap->uacf) > 0)
|
if (count($ldap->uacf) > 0)
|
||||||
{
|
{
|
||||||
foreach ($ldap->uacf as $key => $statut)
|
foreach ($ldap->uacf as $key => $statut)
|
||||||
{
|
{
|
||||||
@ -1609,7 +1609,7 @@ else
|
|||||||
{
|
{
|
||||||
$contact = new Contact($db);
|
$contact = new Contact($db);
|
||||||
$contact->fetch($fuser->contact_id);
|
$contact->fetch($fuser->contact_id);
|
||||||
print ' / '.'<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$fuser->contact_id.'">'.img_object($langs->trans("ShowContact"),'contact').' '.dol_trunc($contact->getFullName($langs),32).'</a>';
|
print ' / <a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$fuser->contact_id.'">'.img_object($langs->trans("ShowContact"),'contact').' '.dol_trunc($contact->getFullName($langs),32).'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1660,9 +1660,18 @@ else
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
function dolValidElement($element) {
|
llxFooter('$Date: 2011/07/08 18:49:17 $ - $Revision: 1.274 $');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return if var element is ok
|
||||||
|
* @param string $element Variable to check
|
||||||
|
* @return boolean Return true of variable is not empty
|
||||||
|
*/
|
||||||
|
function dolValidElement($element)
|
||||||
|
{
|
||||||
return (trim($element) != '');
|
return (trim($element) != '');
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter('$Date: 2011/06/29 10:23:33 $ - $Revision: 1.273 $');
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/user/group/fiche.php
|
* \file htdocs/user/group/fiche.php
|
||||||
* \brief Onglet groupes utilisateurs
|
* \brief Onglet groupes utilisateurs
|
||||||
* \version $Id$
|
* \version $Id: fiche.php,v 1.68 2011/07/08 18:49:17 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../../main.inc.php");
|
require("../../main.inc.php");
|
||||||
@ -169,7 +169,7 @@ if ($_POST["action"] == 'update')
|
|||||||
|
|
||||||
$ret=$object->update();
|
$ret=$object->update();
|
||||||
|
|
||||||
if ($ret >= 0 && ! sizeof($object->errors))
|
if ($ret >= 0 && ! count($object->errors))
|
||||||
{
|
{
|
||||||
$message.='<div class="ok">'.$langs->trans("GroupModified").'</div>';
|
$message.='<div class="ok">'.$langs->trans("GroupModified").'</div>';
|
||||||
$db->commit();
|
$db->commit();
|
||||||
@ -474,5 +474,5 @@ else
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date: 2011/07/08 18:49:17 $ - $Revision: 1.68 $');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
* \file htdocs/user/group/ldap.php
|
* \file htdocs/user/group/ldap.php
|
||||||
* \ingroup ldap
|
* \ingroup ldap
|
||||||
* \brief Page fiche LDAP groupe
|
* \brief Page fiche LDAP groupe
|
||||||
* \version $Id$
|
* \version $Id: ldap.php,v 1.25 2011/07/08 18:49:17 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../../main.inc.php");
|
require("../../main.inc.php");
|
||||||
@ -186,7 +186,7 @@ if ($result > 0)
|
|||||||
//var_dump($records);
|
//var_dump($records);
|
||||||
|
|
||||||
// Affichage arbre
|
// Affichage arbre
|
||||||
if (sizeof($records) && (! isset($records['count']) || $records['count'] > 0))
|
if (count($records) && (! isset($records['count']) || $records['count'] > 0))
|
||||||
{
|
{
|
||||||
if (! is_array($records))
|
if (! is_array($records))
|
||||||
{
|
{
|
||||||
@ -216,5 +216,5 @@ print '</table>';
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date: 2011/07/08 18:49:17 $ - $Revision: 1.25 $');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
* \file htdocs/user/ldap.php
|
* \file htdocs/user/ldap.php
|
||||||
* \ingroup ldap
|
* \ingroup ldap
|
||||||
* \brief Page fiche LDAP utilisateur
|
* \brief Page fiche LDAP utilisateur
|
||||||
* \version $Id$
|
* \version $Id: ldap.php,v 1.30 2011/07/08 18:49:17 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
@ -53,8 +53,8 @@ $fuser->getrights();
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($_GET["action"] == 'dolibarr2ldap')
|
if ($_GET["action"] == 'dolibarr2ldap')
|
||||||
{
|
{
|
||||||
@ -202,7 +202,7 @@ if ($result > 0)
|
|||||||
//print_r($records);
|
//print_r($records);
|
||||||
|
|
||||||
// Affichage arbre
|
// Affichage arbre
|
||||||
if (sizeof($records) && $records != false && (! isset($records['count']) || $records['count'] > 0))
|
if (count($records) && $records != false && (! isset($records['count']) || $records['count'] > 0))
|
||||||
{
|
{
|
||||||
if (! is_array($records))
|
if (! is_array($records))
|
||||||
{
|
{
|
||||||
@ -233,5 +233,5 @@ print '</table>';
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date: 2011/07/08 18:49:17 $ - $Revision: 1.30 $');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/user/param_ihm.php
|
* \file htdocs/user/param_ihm.php
|
||||||
* \brief Page to show user setup for display
|
* \brief Page to show user setup for display
|
||||||
* \version $Id$
|
* \version $Id: param_ihm.php,v 1.52 2011/07/08 18:49:17 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
@ -259,5 +259,5 @@ else
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date: 2011/07/08 18:49:17 $ - $Revision: 1.52 $');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/user/passwordforgotten.php
|
* \file htdocs/user/passwordforgotten.php
|
||||||
* \brief Page to ask a new password
|
* \brief Page to ask a new password
|
||||||
* \version $Id: passwordforgotten.php,v 1.74 2011/07/08 15:52:24 eldy Exp $
|
* \version $Id: passwordforgotten.php,v 1.75 2011/07/08 18:49:17 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define("NOLOGIN",1); // This means this output page does not require to be logged.
|
define("NOLOGIN",1); // This means this output page does not require to be logged.
|
||||||
|
|||||||
@ -176,6 +176,9 @@
|
|||||||
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent" />
|
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent" />
|
||||||
|
|
||||||
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace" />
|
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace" />
|
||||||
|
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace.Line">
|
||||||
|
<severity>0</severity>
|
||||||
|
</rule>
|
||||||
|
|
||||||
<!-- Already found as a Generic rule -->
|
<!-- Already found as a Generic rule -->
|
||||||
<!-- <rule ref="PEAR.WhiteSpace.ScopeIndent" /> -->
|
<!-- <rule ref="PEAR.WhiteSpace.ScopeIndent" /> -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user