Skip to content
Snippets Groups Projects
Commit be7da6f5 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: avoid warning in php strict mode

parent 89be1207
No related branches found
No related tags found
No related merge requests found
......@@ -91,7 +91,7 @@ class Account extends CommonObject
*
* @param DoliDB $db Database handler
*/
function Account($db)
function __construct($db)
{
global $langs;
......@@ -344,10 +344,9 @@ class Account extends CommonObject
/**
* Create bank account into database
*
* @param User $user Object user making action
* @return int < 0 if KO, > 0 if OK
*/
function create($user='')
function create()
{
global $langs,$conf;
......@@ -597,14 +596,13 @@ class Account extends CommonObject
*
* @param int $id Id 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
*/
function fetch($id,$ref='',$ref_ext='')
function fetch($id,$ref='')
{
global $conf;
if (empty($id) && empty($ref) && empty($ref_ext))
if (empty($id) && empty($ref))
{
$this->error="ErrorBadParameters";
return -1;
......
<?php
/* 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>
*
* This program is free software; you can redistribute it and/or modify
......
......@@ -296,7 +296,7 @@ class modSociete extends DolibarrModules
);
//$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_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
$r++;
......
......@@ -135,10 +135,9 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
return -1;
}
//$date=time();
$date=gmmktime();
$yymm = strftime("%y%m",$date);
$num = sprintf("%04s",$max+1);
$date = dol_now();
$yymm = strftime("%y%m",$date);
$num = sprintf("%04s",$max+1);
dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num);
return $prefix.$yymm."-".$num;
......
......@@ -42,7 +42,7 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/
function liste_modeles($db,$maxfilenamelength=0)
static function liste_modeles($db,$maxfilenamelength=0)
{
global $conf;
......
......@@ -49,11 +49,11 @@ class CompanyBankAccount extends Account
/**
* 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->clos = 0;
......
......@@ -108,6 +108,11 @@ class User extends CommonObject
$this->all_permissions_are_loaded = 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 (! 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 (! isset($this->rights->$module) ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment