Fix: Removed php warnings

This commit is contained in:
Laurent Destailleur 2011-06-22 09:17:21 +00:00
parent 32da27f003
commit f26b94a8ac
4 changed files with 9 additions and 8 deletions

View File

@ -45,6 +45,7 @@ class Adherent extends CommonObject
var $errors=array(); var $errors=array();
var $element='member'; var $element='member';
var $table_element='adherent'; var $table_element='adherent';
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id; var $id;
var $ref; var $ref;

View File

@ -572,7 +572,7 @@ class CommonObject
return $result; return $result;
} }
/** /**
* Update a specific field from an object * Update a specific field from an object
* @param table Table element or element line * @param table Table element or element line
@ -590,7 +590,7 @@ class CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET "; $sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET ";
$sql.= $field." = '".$value."'"; $sql.= $field." = '".$value."'";
$sql.= " WHERE rowid = ".$id; $sql.= " WHERE rowid = ".$id;
dol_syslog("CommonObject::updateObjectField sql=".$sql, LOG_DEBUG); dol_syslog("CommonObject::updateObjectField sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) dol_print_error($this->db); if (! $resql) dol_print_error($this->db);
@ -619,7 +619,7 @@ class CommonObject
$sql = "SELECT MAX(te.".$fieldid.")"; $sql = "SELECT MAX(te.".$fieldid.")";
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as te"; $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as te";
if ($this->ismultientitymanaged == 2 || ($this->element != 'societe' && !$this->isnolinkedbythird && !$user->rights->societe->client->voir)) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity if ($this->ismultientitymanaged == 2 || ($this->element != 'societe' && empty($this->isnolinkedbythird) && empty($user->rights->societe->client->voir))) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity
if (empty($this->isnolinkedbythird) && !$user->rights->societe->client->voir) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$alias.".rowid = sc.fk_soc"; if (empty($this->isnolinkedbythird) && !$user->rights->societe->client->voir) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$alias.".rowid = sc.fk_soc";
$sql.= " WHERE te.".$fieldid." < '".$this->db->escape($this->ref)."'"; $sql.= " WHERE te.".$fieldid." < '".$this->db->escape($this->ref)."'";
if (empty($this->isnolinkedbythird) && !$user->rights->societe->client->voir) $sql.= " AND sc.fk_user = " .$user->id; if (empty($this->isnolinkedbythird) && !$user->rights->societe->client->voir) $sql.= " AND sc.fk_user = " .$user->id;

View File

@ -96,7 +96,7 @@ class FormSms
$form=new Form($this->db); $form=new Form($this->db);
$soc=new Societe($this->db); $soc=new Societe($this->db);
if ($this->withtosocid > 0) if (!empty($this->withtosocid) && $this->withtosocid > 0)
{ {
$soc->fetch($this->withtosocid); $soc->fetch($this->withtosocid);
} }

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2011 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
@ -42,7 +42,7 @@ function member_prepare_head($object)
$head[$h][2] = 'general'; $head[$h][2] = 'general';
$h++; $h++;
if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE) if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
{ {
$langs->load("ldap"); $langs->load("ldap");
@ -52,7 +52,7 @@ function member_prepare_head($object)
$h++; $h++;
} }
if ($user->rights->adherent->cotisation->lire) if (! empty($user->rights->adherent->cotisation->lire))
{ {
$head[$h][0] = DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$object->id;
$head[$h][1] = $langs->trans("Subscriptions"); $head[$h][1] = $langs->trans("Subscriptions");
@ -61,7 +61,7 @@ function member_prepare_head($object)
} }
// Show category tab // Show category tab
if ($conf->categorie->enabled && $user->rights->categorie->lire) if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{ {
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=3'; $head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=3';
$head[$h][1] = $langs->trans('Categories'); $head[$h][1] = $langs->trans('Categories');