Fix: Removed a lot of warnings
This commit is contained in:
parent
20f6615cbe
commit
d4376e60a2
@ -597,11 +597,11 @@ 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' && !$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->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 (!$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;
|
||||||
if (! empty($filter)) $sql.=" AND ".$filter;
|
if (! empty($filter)) $sql.=" AND ".$filter;
|
||||||
if ($this->ismultientitymanaged == 2 || ($this->element != 'societe' && !$this->isnolinkedbythird && !$user->rights->societe->client->voir)) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity
|
if ($this->ismultientitymanaged == 2 || ($this->element != 'societe' && empty($this->isnolinkedbythird) && !$user->rights->societe->client->voir)) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity
|
||||||
if ($this->ismultientitymanaged == 1) $sql.= ' AND te.entity IN (0,'.(! empty($conf->entities[$this->element]) ? $conf->entities[$this->element] : $conf->entity).')';
|
if ($this->ismultientitymanaged == 1) $sql.= ' AND te.entity IN (0,'.(! empty($conf->entities[$this->element]) ? $conf->entities[$this->element] : $conf->entity).')';
|
||||||
|
|
||||||
//print $sql."<br>";
|
//print $sql."<br>";
|
||||||
@ -617,12 +617,12 @@ class CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT MIN(te.".$fieldid.")";
|
$sql = "SELECT MIN(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) && !$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->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 (!$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;
|
||||||
if (isset($filter)) $sql.=" AND ".$filter;
|
if (! empty($filter)) $sql.=" AND ".$filter;
|
||||||
if ($this->ismultientitymanaged == 2 || ($this->element != 'societe' && !$this->isnolinkedbythird && !$user->rights->societe->client->voir)) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity
|
if ($this->ismultientitymanaged == 2 || ($this->element != 'societe' && empty($this->isnolinkedbythird) && !$user->rights->societe->client->voir)) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity
|
||||||
if ($this->ismultientitymanaged == 1) $sql.= ' AND te.entity IN (0,'.(! empty($conf->entities[$this->element]) ? $conf->entities[$this->element] : $conf->entity).')';
|
if ($this->ismultientitymanaged == 1) $sql.= ' AND te.entity IN (0,'.(! empty($conf->entities[$this->element]) ? $conf->entities[$this->element] : $conf->entity).')';
|
||||||
// Rem: Bug in some mysql version: SELECT MIN(rowid) FROM llx_socpeople WHERE rowid > 1 when one row in database with rowid=1, returns 1 instead of null
|
// Rem: Bug in some mysql version: SELECT MIN(rowid) FROM llx_socpeople WHERE rowid > 1 when one row in database with rowid=1, returns 1 instead of null
|
||||||
|
|
||||||
|
|||||||
@ -3284,7 +3284,7 @@ class Form
|
|||||||
$ret='';
|
$ret='';
|
||||||
|
|
||||||
//print "$paramid,$morehtml,$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
|
//print "$paramid,$morehtml,$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
|
||||||
$object->load_previous_next_ref($object->next_prev_filter,$fieldid);
|
$object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid);
|
||||||
$previous_ref = $object->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.img_previous().'</a>':'';
|
$previous_ref = $object->ref_previous?'<a href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.img_previous().'</a>':'';
|
||||||
$next_ref = $object->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.img_next().'</a>':'';
|
$next_ref = $object->ref_next?'<a href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.img_next().'</a>':'';
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -94,7 +94,7 @@ class FormSms
|
|||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
$langs->load("sms");
|
$langs->load("sms");
|
||||||
|
|
||||||
$form=new Form($DB);
|
$form=new Form($this->db);
|
||||||
$soc=new Societe($this->db);
|
$soc=new Societe($this->db);
|
||||||
if ($this->withtosocid > 0)
|
if ($this->withtosocid > 0)
|
||||||
{
|
{
|
||||||
@ -176,9 +176,16 @@ function limitChars(textarea, limit, infodiv)
|
|||||||
dol_include_once('/ovh/class/ovhsms.class.php');
|
dol_include_once('/ovh/class/ovhsms.class.php');
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$sms = new OvhSms($db);
|
$sms = new OvhSms($this->db);
|
||||||
|
if (empty($conf->global->OVHSMS_ACCOUNT))
|
||||||
|
{
|
||||||
|
$resultsender = 'ErrorOVHSMS_ACCOUNT not defined';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$resultsender = $sms->SmsSenderList($conf->global->OVHSMS_ACCOUNT);
|
$resultsender = $sms->SmsSenderList($conf->global->OVHSMS_ACCOUNT);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
dol_print_error('','Error to get list of senders: '.$e->getMessage());
|
dol_print_error('','Error to get list of senders: '.$e->getMessage());
|
||||||
@ -221,7 +228,7 @@ function limitChars(textarea, limit, infodiv)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<input size=\"16\" name=\"sendto\" value=\"".(! is_array($this->withto) && $this->withto != '1'? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto):"+")."\">";
|
print "<input size=\"16\" name=\"sendto\" value=\"".(! is_array($this->withto) && $this->withto != '1'? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto):"+")."\">";
|
||||||
if ($this->withtosocid > 0)
|
if (! empty($this->withtosocid) && $this->withtosocid > 0)
|
||||||
{
|
{
|
||||||
$liste=array();
|
$liste=array();
|
||||||
$liste[0]=' ';
|
$liste[0]=' ';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||||
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
||||||
@ -45,28 +45,29 @@ function societe_prepare_head($object)
|
|||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
// TODO Remove tests on object->object. Functions must be called with a company object directly
|
// TODO Remove tests on object->object. Functions must be called with a company object directly
|
||||||
if (($object->client==2 || $object->client==3 || $object->object->client==2 || $object->object->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
|
if (($object->client==2 || $object->client==3
|
||||||
|
|| (isset($object->object) && $object->object->client==2) || (isset($object->object) && $object->object->client==3)) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("Prospect");
|
$head[$h][1] = $langs->trans("Prospect");
|
||||||
$head[$h][2] = 'prospect';
|
$head[$h][2] = 'prospect';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
if ($object->client==1 || $object->client==3 || $object->object->client==1 || $object->object->client==3)
|
if ($object->client==1 || $object->client==3 || (is_object($object->object) && $object->object->client==1) || (is_object($object->object) && $object->object->client==3))
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("Customer");
|
$head[$h][1] = $langs->trans("Customer");
|
||||||
$head[$h][2] = 'customer';
|
$head[$h][2] = 'customer';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
if ($conf->fournisseur->enabled && ($object->fournisseur || $object->object->fournisseur))
|
if (! empty($conf->fournisseur->enabled) && ($object->fournisseur || (isset($object->object) && $object->object->fournisseur)))
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("Supplier");
|
$head[$h][1] = $langs->trans("Supplier");
|
||||||
$head[$h][2] = 'supplier';
|
$head[$h][2] = 'supplier';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
if ($conf->agenda->enabled)
|
if (! empty($conf->agenda->enabled))
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("Agenda");
|
$head[$h][1] = $langs->trans("Agenda");
|
||||||
@ -74,7 +75,7 @@ function societe_prepare_head($object)
|
|||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
//show categorie tab
|
//show categorie tab
|
||||||
if ($conf->categorie->enabled)
|
if (! empty($conf->categorie->enabled))
|
||||||
{
|
{
|
||||||
$type = 2;
|
$type = 2;
|
||||||
if ($object->fournisseur) $type = 1;
|
if ($object->fournisseur) $type = 1;
|
||||||
@ -107,7 +108,7 @@ function societe_prepare_head($object)
|
|||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
// Notifications
|
// Notifications
|
||||||
if ($conf->notification->enabled && $user->societe_id == 0)
|
if (! empty($conf->notification->enabled) && $user->societe_id == 0)
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("Notifications");
|
$head[$h][1] = $langs->trans("Notifications");
|
||||||
|
|||||||
@ -495,7 +495,7 @@ function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto
|
|||||||
// Show tabs
|
// Show tabs
|
||||||
for ($i = 0 ; $i <= $maxkey ; $i++)
|
for ($i = 0 ; $i <= $maxkey ; $i++)
|
||||||
{
|
{
|
||||||
if ($links[$i][2] == 'image')
|
if (isset($links[$i][2]) && $links[$i][2] == 'image')
|
||||||
{
|
{
|
||||||
if (!empty($links[$i][0]))
|
if (!empty($links[$i][0]))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -643,7 +643,7 @@ function check_value($mask,$value)
|
|||||||
|
|
||||||
// Extract value for mask counter, mask raz and mask offset
|
// Extract value for mask counter, mask raz and mask offset
|
||||||
if (! preg_match('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i',$mask,$reg)) return 'ErrorBadMask';
|
if (! preg_match('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i',$mask,$reg)) return 'ErrorBadMask';
|
||||||
$masktri=$reg[1].$reg[2].$reg[3];
|
$masktri=$reg[1].(isset($reg[2])?$reg[2]:'').(isset($reg[3])?$reg[3]:'');
|
||||||
$maskcounter=$reg[1];
|
$maskcounter=$reg[1];
|
||||||
$maskraz=-1;
|
$maskraz=-1;
|
||||||
$maskoffset=0;
|
$maskoffset=0;
|
||||||
@ -1128,11 +1128,11 @@ function getSoapParams()
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$params=array();
|
$params=array();
|
||||||
$proxyuse=($conf->global->MAIN_PROXY_USE?true:false);
|
$proxyuse =(empty($conf->global->MAIN_PROXY_USE)?false:true);
|
||||||
$proxyhost=($conf->global->MAIN_PROXY_USE?$conf->global->MAIN_PROXY_HOST:false);
|
$proxyhost=(empty($conf->global->MAIN_PROXY_USE)?false:$conf->global->MAIN_PROXY_HOST);
|
||||||
$proxyport=($conf->global->MAIN_PROXY_USE?$conf->global->MAIN_PROXY_PORT:false);
|
$proxyport=(empty($conf->global->MAIN_PROXY_USE)?false:$conf->global->MAIN_PROXY_PORT);
|
||||||
$proxyuser=($conf->global->MAIN_PROXY_USE?$conf->global->MAIN_PROXY_USER:false);
|
$proxyuser=(empty($conf->global->MAIN_PROXY_USE)?false:$conf->global->MAIN_PROXY_USER);
|
||||||
$proxypass=($conf->global->MAIN_PROXY_USE?$conf->global->MAIN_PROXY_PASS:false);
|
$proxypass=(empty($conf->global->MAIN_PROXY_USE)?false:$conf->global->MAIN_PROXY_PASS);
|
||||||
$timeout =(empty($conf->global->MAIN_USE_CONNECT_TIMEOUT)?10:$conf->global->MAIN_USE_CONNECT_TIMEOUT); // Connection timeout
|
$timeout =(empty($conf->global->MAIN_USE_CONNECT_TIMEOUT)?10:$conf->global->MAIN_USE_CONNECT_TIMEOUT); // Connection timeout
|
||||||
$response_timeout=(empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT)?30:$conf->global->MAIN_USE_RESPONSE_TIMEOUT); // Response timeout
|
$response_timeout=(empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT)?30:$conf->global->MAIN_USE_RESPONSE_TIMEOUT); // Response timeout
|
||||||
//print extension_loaded('soap');
|
//print extension_loaded('soap');
|
||||||
|
|||||||
@ -1660,7 +1660,7 @@ if (! function_exists("llxFooter"))
|
|||||||
|
|
||||||
|
|
||||||
print "\n".'</td></tr></table> <!-- end right area -->'."\n";
|
print "\n".'</td></tr></table> <!-- end right area -->'."\n";
|
||||||
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print '</div></div> <!-- end main layout -->'."\n";
|
if ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '</div></div> <!-- end main layout -->'."\n";
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
if ($foot) print '<!-- '.$foot.' -->'."\n";
|
if ($foot) print '<!-- '.$foot.' -->'."\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user