Fix: avoid warning in php strict mode

This commit is contained in:
Regis Houssin 2012-03-23 16:44:45 +01:00
parent 89be120764
commit be7da6f52c
7 changed files with 20 additions and 16 deletions

View File

@ -91,7 +91,7 @@ class Account extends CommonObject
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function Account($db) function __construct($db)
{ {
global $langs; global $langs;
@ -344,10 +344,9 @@ class Account extends CommonObject
/** /**
* Create bank account into database * Create bank account into database
* *
* @param User $user Object user making action
* @return int < 0 if KO, > 0 if OK * @return int < 0 if KO, > 0 if OK
*/ */
function create($user='') function create()
{ {
global $langs,$conf; global $langs,$conf;
@ -597,14 +596,13 @@ class Account extends CommonObject
* *
* @param int $id Id of bank account to get * @param int $id Id of bank account to get
* @param string $ref Ref of bank account to get * @param string $ref Ref of bank account to get
* @param string $ref_ext External ref of bank account to get
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id,$ref='',$ref_ext='') function fetch($id,$ref='')
{ {
global $conf; global $conf;
if (empty($id) && empty($ref) && empty($ref_ext)) if (empty($id) && empty($ref))
{ {
$this->error="ErrorBadParameters"; $this->error="ErrorBadParameters";
return -1; return -1;

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (c) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (c) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2010-2012 Regis Houssin <regis@dolibarr.fr>
* 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

View File

@ -296,7 +296,7 @@ class modSociete extends DolibarrModules
); );
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
$this->import_regex_array[$r]=array('s.status'=>'^[0|1]','s.client'=>'^[0|1|2|3]','s.fournisseur'=>'^[0|1]','s.fk_typent'=>'id@'.MAIN_DB_PREFIX.'c_typent','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); $this->import_regex_array[$r]=array('s.status'=>'^[0|1]','s.client'=>'^[0|1|2|3]','s.fournisseur'=>'^[0|1]','s.fk_typent'=>'id@'.MAIN_DB_PREFIX.'c_typent','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
$this->import_examplevalues_array[$r]=array('s.nom'=>"MyBigCompany",'s.status'=>"0 (closed) or 1 (active)",'s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 or 1','s.datec'=>dol_print_date(mktime(),'%Y-%m-%d'),'s.code_client'=>"CU01-0001 or auto",'s.code_fournisseur'=>"SU01-0001 or auto",'s.address'=>"61 jump street",'s.cp'=>"123456",'s.ville'=>"Big town",'s.fk_pays'=>'US, FR, DE...','s.tel'=>"0101010101",'s.fax'=>"0101010102",'s.url'=>"http://mycompany.com",'s.email'=>"test@mycompany.com",'s.siret'=>"",'s.siren'=>"",'s.ape'=>"",'s.idprof4'=>"",'s.tva_intra'=>"FR0123456789",'s.capital'=>"10000",'s.note'=>"This is an example of note for record",'s.fk_typent'=>"2",'s.fk_effectif'=>"3","s.fk_forme_juridique"=>"1",'s.fk_prospectlevel'=>'PL_MEDIUM','s.fk_stcomm'=>'0','s.default_lang'=>'en_US','s.barcode'=>'123456789'); $this->import_examplevalues_array[$r]=array('s.nom'=>"MyBigCompany",'s.status'=>"0 (closed) or 1 (active)",'s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 or 1','s.datec'=>dol_print_date(dol_now(),'%Y-%m-%d'),'s.code_client'=>"CU01-0001 or auto",'s.code_fournisseur'=>"SU01-0001 or auto",'s.address'=>"61 jump street",'s.cp'=>"123456",'s.ville'=>"Big town",'s.fk_pays'=>'US, FR, DE...','s.tel'=>"0101010101",'s.fax'=>"0101010102",'s.url'=>"http://mycompany.com",'s.email'=>"test@mycompany.com",'s.siret'=>"",'s.siren'=>"",'s.ape'=>"",'s.idprof4'=>"",'s.tva_intra'=>"FR0123456789",'s.capital'=>"10000",'s.note'=>"This is an example of note for record",'s.fk_typent'=>"2",'s.fk_effectif'=>"3","s.fk_forme_juridique"=>"1",'s.fk_prospectlevel'=>'PL_MEDIUM','s.fk_stcomm'=>'0','s.default_lang'=>'en_US','s.barcode'=>'123456789');
// Import list of contact and attributes // Import list of contact and attributes
$r++; $r++;

View File

@ -135,10 +135,9 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
return -1; return -1;
} }
//$date=time(); $date = dol_now();
$date=gmmktime(); $yymm = strftime("%y%m",$date);
$yymm = strftime("%y%m",$date); $num = sprintf("%04s",$max+1);
$num = sprintf("%04s",$max+1);
dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num); dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num);
return $prefix.$yymm."-".$num; return $prefix.$yymm."-".$num;

View File

@ -42,7 +42,7 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator
* @param string $maxfilenamelength Max length of value to show * @param string $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
function liste_modeles($db,$maxfilenamelength=0) static function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;

View File

@ -49,11 +49,11 @@ class CompanyBankAccount extends Account
/** /**
* Constructor * Constructor
* *
* @param DoliDB $DB Database handler * @param DoliDB $db Database handler
*/ */
function CompanyBankAccount($DB) function __construct($db)
{ {
$this->db = $DB; $this->db = $db;
$this->socid = 0; $this->socid = 0;
$this->clos = 0; $this->clos = 0;

View File

@ -108,6 +108,11 @@ class User extends CommonObject
$this->all_permissions_are_loaded = 0; $this->all_permissions_are_loaded = 0;
$this->admin=0; $this->admin=0;
$this->rights = (object) array();
$this->rights->user = (object) array();
$this->rights->user->user = (object) array();
$this->rights->user->self = (object) array();
} }
/** /**
@ -522,6 +527,8 @@ class User extends CommonObject
if ($perms) if ($perms)
{ {
if (! is_object($this->rights->$module)) $this->rights->$module = (object) array();
if (! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = (object) array();
if ($subperms) if ($subperms)
{ {
if (! isset($this->rights->$module) || if (! isset($this->rights->$module) ||