Fix: Pb of object with wrong type.

This commit is contained in:
Laurent Destailleur 2014-11-15 18:24:38 +01:00
parent 741adc79b2
commit 445f696d28
28 changed files with 94 additions and 61 deletions

View File

@ -180,10 +180,45 @@ tools:
- 'htdocs/includes/*' - 'htdocs/includes/*'
paths: { } paths: { }
php_changetracking:
enabled: false
bug_patterns:
- '\bfix(?:es|ed)?\b'
feature_patterns:
- '\badd(?:s|ed)?\b'
- '\bimplement(?:s|ed)?\b'
filter:
excluded_paths:
- 'build/*'
- 'dev/*'
- 'doc/*'
- 'test/*'
- 'htdocs/includes/*'
paths: { }
# Coding-Style / Bug Detection # Coding-Style / Bug Detection
js_hint: false js_hint:
enabled: false
use_native_config: true
extensions:
- js
filter:
excluded_paths:
- 'build/*'
- 'dev/*'
- 'doc/*'
- 'test/*'
- 'htdocs/includes/*'
paths: { }
config: { }
path_configs: { }
checks:
php:
code_rating: true
duplication: true
before_commands: { } before_commands: { }
after_commands: { } after_commands: { }
artifacts: { } artifacts: { }

View File

@ -182,7 +182,7 @@ class Skeleton_Class extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -107,7 +107,7 @@ class Categorie extends CommonObject
$this->type = $res['type']; $this->type = $res['type'];
$this->entity = $res['entity']; $this->entity = $res['entity'];
$this->fetch_optionals($this->id,$extralabels); $this->fetch_optionals($this->id,null);
$this->db->free($resql); $this->db->free($resql);
@ -202,7 +202,7 @@ class Categorie extends CommonObject
// FIXME le hook fait double emploi avec le trigger !! // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('HookModuleNamedao')); $hookmanager->initHooks(array('HookModuleNamedao'));
$parameters=array('socid'=>$this->id); $parameters=array('socid'=>$this->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,'create'); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) if (empty($reshook))
{ {
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
@ -294,7 +294,7 @@ class Categorie extends CommonObject
// FIXME le hook fait double emploi avec le trigger !! // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('HookCategorydao')); $hookmanager->initHooks(array('HookCategorydao'));
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,'update'); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) if (empty($reshook))
{ {
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
@ -419,7 +419,7 @@ class Categorie extends CommonObject
$error++; $error++;
} }
} }
// Delete category // Delete category
if (! $error) if (! $error)
{ {
@ -441,7 +441,7 @@ class Categorie extends CommonObject
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::delete erreur ".$this->error, LOG_ERR);
} }
} }
} }
@ -799,7 +799,7 @@ class Categorie extends CommonObject
*/ */
function get_full_arbo($type,$markafterid=0) function get_full_arbo($type,$markafterid=0)
{ {
global $langs; global $conf, $langs;
$this->cats = array(); $this->cats = array();
@ -809,11 +809,9 @@ class Categorie extends CommonObject
// Init $this->cats array // Init $this->cats array
$sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.fk_parent"; // Distinct reduce pb with old tables with duplicates $sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.fk_parent"; // Distinct reduce pb with old tables with duplicates
if (! empty($conf->global->MAIN_MULTILANGS)) if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans";
$sql.= ", t.label as label_trans, t.description as description_trans";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie as c";
if (! empty($conf->global->MAIN_MULTILANGS)) if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
$sql.= " WHERE c.entity IN (".getEntity('category',1).")"; $sql.= " WHERE c.entity IN (".getEntity('category',1).")";
$sql.= " AND c.type = ".$type; $sql.= " AND c.type = ".$type;

View File

@ -2118,7 +2118,7 @@ class Propal extends CommonObject
if (! $error) if (! $error)
{ {
dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG); dol_syslog(get_class($this)."::delete ".$this->id." by ".$user->id, LOG_DEBUG);
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }

View File

@ -1145,7 +1145,7 @@ class AccountLine extends CommonObject
* @param User $user User object that delete * @param User $user User object that delete
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user=0) function delete($user=null)
{ {
$nbko=0; $nbko=0;
@ -1194,7 +1194,7 @@ class AccountLine extends CommonObject
* @param User $user User object that delete * @param User $user User object that delete
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete_urls($user=0) function delete_urls($user=null)
{ {
$nbko=0; $nbko=0;

View File

@ -172,7 +172,7 @@ class BankCateg // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -1040,7 +1040,7 @@ class Facture extends CommonInvoice
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -261,7 +261,7 @@ class PaymentTerm // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -127,7 +127,7 @@ class Localtax extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;

View File

@ -73,7 +73,7 @@ class PaymentSalary extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
@ -144,7 +144,7 @@ class PaymentSalary extends CommonObject
* @param User $user User that load * @param User $user User that load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $user=0) function fetch($id, $user=null)
{ {
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";

View File

@ -220,7 +220,7 @@ class PaymentSocialContribution extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -143,7 +143,7 @@ class Tva extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
@ -205,7 +205,7 @@ class Tva extends CommonObject
* @param User $user User that load * @param User $user User that load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $user=0) function fetch($id, $user=null)
{ {
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";

View File

@ -220,7 +220,7 @@ class Contact extends CommonObject
* @param string $action Current action for hookmanager * @param string $action Current action for hookmanager
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($id, $user=0, $notrigger=0, $action='update') function update($id, $user=null, $notrigger=0, $action='update')
{ {
global $conf, $langs, $hookmanager; global $conf, $langs, $hookmanager;
@ -427,7 +427,7 @@ class Contact extends CommonObject
* @param User $user User asking to change alert or birthday * @param User $user User asking to change alert or birthday
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
function update_perso($id, $user=0) function update_perso($id, $user=null)
{ {
$error=0; $error=0;
$result=false; $result=false;
@ -492,7 +492,7 @@ class Contact extends CommonObject
* @param User $user Utilisateur (abonnes aux alertes) qui veut les alertes de ce contact * @param User $user Utilisateur (abonnes aux alertes) qui veut les alertes de ce contact
* @return int -1 if KO, 0 if OK but not found, 1 if OK * @return int -1 if KO, 0 if OK but not found, 1 if OK
*/ */
function fetch($id, $user=0) function fetch($id, $user=null)
{ {
global $langs; global $langs;

View File

@ -989,7 +989,7 @@ class Contrat extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -191,7 +191,7 @@ class Ccountry // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -198,7 +198,7 @@ class Ctypent // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -154,7 +154,7 @@ class Events // extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
@ -191,7 +191,7 @@ class Events // extends CommonObject
* @param User $user User that load * @param User $user User that load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $user=0) function fetch($id, $user=null)
{ {
global $langs; global $langs;

View File

@ -74,7 +74,7 @@ class Menubase
* @param User $user User that create * @param User $user User that create
* @return int <0 if KO, Id of record if OK * @return int <0 if KO, Id of record if OK
*/ */
function create($user=0) function create($user=null)
{ {
global $conf, $langs; global $conf, $langs;
@ -185,7 +185,7 @@ class Menubase
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
@ -250,7 +250,7 @@ class Menubase
* @param User $user User that load * @param User $user User that load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $user=0) function fetch($id, $user=null)
{ {
global $langs; global $langs;

View File

@ -96,7 +96,7 @@ class Cronjob extends CommonObject
$error=0; $error=0;
$now=dol_now(); $now=dol_now();
// Clean parameters // Clean parameters
if (isset($this->label)) $this->label=trim($this->label); if (isset($this->label)) $this->label=trim($this->label);
@ -501,7 +501,7 @@ class Cronjob extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;

View File

@ -184,7 +184,7 @@ class EcmDirectory // extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;

View File

@ -800,7 +800,7 @@ class Expedition extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -539,7 +539,7 @@ class FactureFournisseur extends CommonInvoice
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -470,7 +470,7 @@ class Holiday extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -254,7 +254,7 @@ class Opensurveysondage extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -34,7 +34,7 @@ class Productbatch extends CommonObject
private static $_table_element='product_batch'; //!< Name of table without prefix where object is stored private static $_table_element='product_batch'; //!< Name of table without prefix where object is stored
var $id; var $id;
var $tms=''; var $tms='';
var $fk_product_stock; var $fk_product_stock;
var $sellby=''; var $sellby='';
@ -43,7 +43,7 @@ class Productbatch extends CommonObject
var $qty; var $qty;
var $import_key; var $import_key;
/** /**
@ -92,7 +92,7 @@ class Productbatch extends CommonObject
$sql.= " ".(! isset($this->qty)?'NULL':$this->qty).","; $sql.= " ".(! isset($this->qty)?'NULL':$this->qty).",";
$sql.= " ".(! isset($this->import_key)?'NULL':"'".$this->db->escape($this->import_key)."'").""; $sql.= " ".(! isset($this->import_key)?'NULL':"'".$this->db->escape($this->import_key)."'")."";
$sql.= ")"; $sql.= ")";
$this->db->begin(); $this->db->begin();
@ -148,7 +148,7 @@ class Productbatch extends CommonObject
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";
$sql.= " t.rowid,"; $sql.= " t.rowid,";
$sql.= " t.tms,"; $sql.= " t.tms,";
$sql.= " t.fk_product_stock,"; $sql.= " t.fk_product_stock,";
$sql.= " t.sellby,"; $sql.= " t.sellby,";
@ -157,7 +157,7 @@ class Productbatch extends CommonObject
$sql.= " t.qty,"; $sql.= " t.qty,";
$sql.= " t.import_key"; $sql.= " t.import_key";
$sql.= " FROM ".MAIN_DB_PREFIX.self::$_table_element." as t"; $sql.= " FROM ".MAIN_DB_PREFIX.self::$_table_element." as t";
$sql.= " WHERE t.rowid = ".$id; $sql.= " WHERE t.rowid = ".$id;
@ -196,7 +196,7 @@ class Productbatch extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -376,7 +376,7 @@ class Productbatch extends CommonObject
function initAsSpecimen() function initAsSpecimen()
{ {
$this->id=0; $this->id=0;
$this->tms=''; $this->tms='';
$this->fk_product_stock=''; $this->fk_product_stock='';
$this->sellby=''; $this->sellby='';
@ -384,14 +384,14 @@ class Productbatch extends CommonObject
$this->batch=''; $this->batch='';
$this->import_key=''; $this->import_key='';
} }
/** /**
* Clean fields (triming) * Clean fields (triming)
* *
* @return void * @return void
*/ */
private function clean_param() { private function clean_param() {
if (isset($this->fk_product_stock)) $this->fk_product_stock=(int) trim($this->fk_product_stock); if (isset($this->fk_product_stock)) $this->fk_product_stock=(int) trim($this->fk_product_stock);
if (isset($this->batch)) $this->batch=trim($this->batch); if (isset($this->batch)) $this->batch=trim($this->batch);
@ -429,7 +429,7 @@ class Productbatch extends CommonObject
if (! empty($batch_number)) $sql.= " AND batch = '".$this->db->escape($batch_number)."'"; if (! empty($batch_number)) $sql.= " AND batch = '".$this->db->escape($batch_number)."'";
if (! empty($where)) $sql.= " AND (".implode(" OR ",$where).")"; if (! empty($where)) $sql.= " AND (".implode(" OR ",$where).")";
dol_syslog(get_class($this)."::fetch", LOG_DEBUG); dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
@ -439,7 +439,7 @@ class Productbatch extends CommonObject
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->tms = $this->db->jdate($obj->tms); $this->tms = $this->db->jdate($obj->tms);
$this->fk_product_stock = $obj->fk_product_stock; $this->fk_product_stock = $obj->fk_product_stock;
$this->sellby = $this->db->jdate($obj->sellby); $this->sellby = $this->db->jdate($obj->sellby);
@ -480,10 +480,10 @@ class Productbatch extends CommonObject
$sql.= " t.qty,"; $sql.= " t.qty,";
$sql.= " t.import_key"; $sql.= " t.import_key";
$sql.= " FROM ".MAIN_DB_PREFIX.self::$_table_element." as t"; $sql.= " FROM ".MAIN_DB_PREFIX.self::$_table_element." as t";
$sql.= " WHERE fk_product_stock=".$fk_product_stock; $sql.= " WHERE fk_product_stock=".$fk_product_stock;
if ($with_qty) $sql.= " AND qty<>0"; if ($with_qty) $sql.= " AND qty<>0";
dol_syslog("productbatch::findAll", LOG_DEBUG); dol_syslog("productbatch::findAll", LOG_DEBUG);
$resql=$db->query($sql); $resql=$db->query($sql);

View File

@ -261,7 +261,7 @@ class Task extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -801,7 +801,7 @@ class Task extends CommonObject
$this->db->rollback(); $this->db->rollback();
$ret = -2; $ret = -2;
} }
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time"; $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time";
$sql.= " SET thm = (SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->timespent_fk_user.")"; $sql.= " SET thm = (SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->timespent_fk_user.")";
$sql.= " WHERE rowid = ".$tasktime_id; $sql.= " WHERE rowid = ".$tasktime_id;

View File

@ -205,7 +205,7 @@ class Resource extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -695,7 +695,7 @@ class Resource extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update_element_resource($user=0, $notrigger=0) function update_element_resource($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -232,7 +232,7 @@ class Address
* @param User $user Objet de l'utilisateur * @param User $user Objet de l'utilisateur
* @return int >0 si ok, <0 si ko * @return int >0 si ok, <0 si ko
*/ */
function fetch_lines($socid, $user=0) function fetch_lines($socid, $user=null)
{ {
global $langs, $conf; global $langs, $conf;
@ -325,7 +325,7 @@ class Address
* @param User $user Objet de l'utilisateur * @param User $user Objet de l'utilisateur
* @return int >0 si ok, <0 si ko * @return int >0 si ok, <0 si ko
*/ */
function fetch_address($id, $user=0) function fetch_address($id, $user=null)
{ {
global $langs; global $langs;
global $conf; global $conf;