Fix: multiple avoid warning with php strict mode

This commit is contained in:
Regis Houssin 2012-03-23 17:18:33 +01:00
parent be7da6f52c
commit 3c794967c3
8 changed files with 77 additions and 64 deletions

View File

@ -312,7 +312,7 @@ foreach ($dirmodels as $reldir)
// Info
$htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$facture->type=0;
$commande->type=0;
$nextval=$module->getNextValue($mysoc,$commande);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{

View File

@ -344,7 +344,7 @@ foreach ($dirmodels as $reldir)
// Info
$htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$facture->type=0;
$propal->type=0;
$nextval=$module->getNextValue($mysoc,$propal);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{

View File

@ -84,49 +84,36 @@ class Conf
*/
function Conf()
{
// Avoid warnings when filling this->xxx
$this->file = (object) array();
$this->db = (object) array();
$this->global = (object) array();
$this->mycompany = (object) array();
$this->admin = (object) array();
$this->user = (object) array();
$this->syslog = (object) array();
$this->browser = (object) array();
$this->multicompany = (object) array();
$this->expedition_bon = (object) array();
$this->livraison_bon = (object) array();
$this->fournisseur = (object) array();
$this->fournisseur->commande = (object) array();
$this->fournisseur->facture = (object) array();
$this->product = (object) array();
$this->service = (object) array();
$this->contrat = (object) array();
$this->actions = (object) array();
$this->commande = (object) array();
$this->commande->client = (object) array();
$this->commande->fournisseur = (object) array();
$this->propal = (object) array();
$this->propal->cloture = (object) array();
$this->propal->facturation = (object) array();
$this->facture = (object) array();
$this->facture->client = (object) array();
$this->facture->fournisseur = (object) array();
$this->contrat = (object) array();
$this->contrat->services = (object) array();
$this->contrat->services->inactifs = (object) array();
$this->contrat->services->expires = (object) array();
$this->adherent = (object) array();
$this->adherent->cotisation = (object) array();
$this->bank = (object) array();
$this->bank->rappro = (object) array();
$this->bank->cheque = (object) array();
$this->notification = (object) array();
$this->mailing = (object) array();
//! Charset for HTML output and for storing data in memory
$this->file->character_set_client='UTF-8'; // UTF-8, ISO-8859-1
// Avoid warnings when filling this->xxx
$this->file = (object) array();
$this->db = (object) array();
$this->global = (object) array();
$this->mycompany = (object) array();
$this->admin = (object) array();
$this->user = (object) array();
$this->syslog = (object) array();
$this->browser = (object) array();
$this->multicompany = (object) array();
// First level object
$this->expedition_bon = (object) array();
$this->livraison_bon = (object) array();
$this->fournisseur = (object) array();
$this->product = (object) array();
$this->service = (object) array();
$this->contrat = (object) array();
$this->actions = (object) array();
$this->commande = (object) array();
$this->propal = (object) array();
$this->facture = (object) array();
$this->contrat = (object) array();
$this->adherent = (object) array();
$this->bank = (object) array();
$this->notification = (object) array();
$this->mailing = (object) array();
//! Charset for HTML output and for storing data in memory
$this->file->character_set_client='UTF-8'; // UTF-8, ISO-8859-1
}
@ -225,6 +212,22 @@ class Conf
}
//var_dump($this->modules);
//var_dump($this->modules_parts);
// Second or others levels object
$this->propal->cloture = (object) array();
$this->propal->facturation = (object) array();
$this->commande->client = (object) array();
$this->commande->fournisseur = (object) array();
$this->facture->client = (object) array();
$this->facture->fournisseur = (object) array();
$this->fournisseur->commande = (object) array();
$this->fournisseur->facture = (object) array();
$this->contrat->services = (object) array();
$this->contrat->services->inactifs = (object) array();
$this->contrat->services->expires = (object) array();
$this->adherent->cotisation = (object) array();
$this->bank->rappro = (object) array();
$this->bank->cheque = (object) array();
// Clean some variables
if (empty($this->global->MAIN_MENU_STANDARD)) $this->global->MAIN_MENU_STANDARD="eldy_backoffice.php";

View File

@ -73,18 +73,20 @@ abstract class ModeleNumRefCommandes
{
var $error='';
/** Return if a module can be used or not
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
* @return boolean true if module can be used
*/
function isEnabled()
{
return true;
}
/** Renvoie la description par defaut du modele de numerotation
/**
* Renvoie la description par defaut du modele de numerotation
*
* @return string Texte descripif
* @return string Texte descripif
*/
function info()
{
@ -93,9 +95,10 @@ abstract class ModeleNumRefCommandes
return $langs->trans("NoDescription");
}
/** Renvoie un exemple de numerotation
/**
* Renvoie un exemple de numerotation
*
* @return string Example
* @return string Example
*/
function getExample()
{
@ -104,28 +107,33 @@ abstract class ModeleNumRefCommandes
return $langs->trans("NoExample");
}
/** Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner.
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner.
*
* @return boolean false si conflit, true si ok
* @return boolean false si conflit, true si ok
*/
function canBeActivated()
{
return true;
}
/** Renvoie prochaine valeur attribuee
/**
* Renvoie prochaine valeur attribuee
*
* @return string Valeur
* @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for
* @return string Valeur
*/
function getNextValue()
function getNextValue($objsoc,$object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/** Renvoie version du module numerotation
/**
* Renvoie version du module numerotation
*
* @return string Valeur
* @return string Valeur
*/
function getVersion()
{

View File

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

View File

@ -115,9 +115,11 @@ abstract class ModeleNumRefPropales
/**
* Renvoi prochaine valeur attribuee
*
* @return string Valeur
* @param Societe $objsoc Object third party
* @param Propal $propal Object commercial proposal
* @return string Valeur
*/
function getNextValue()
function getNextValue($objsoc,$propal)
{
global $langs;
return $langs->trans("NotAvailable");

View File

@ -885,7 +885,7 @@ class Product extends CommonObject
* @param int $newnpr 0=Standard vat rate, 1=Special vat rate for French NPR VAT
* @return int <0 if KO, >0 if OK
*/
function update_price($id, $newprice, $newpricebase, $user, $newvat='',$newminprice='', $level=0, $newnpr=0)
function updatePrice($id, $newprice, $newpricebase, $user, $newvat='',$newminprice='', $level=0, $newnpr=0)
{
global $conf,$langs;

View File

@ -84,7 +84,7 @@ if ($action == 'update_price' && ! $_POST["cancel"] && ($user->rights->produit->
$newvat=str_replace('*','',$_POST["tva_tx"]);
}
if ($object->update_price($object->id, $newprice, $newpricebase, $user, $newvat, $newprice_min, $level, $newnpr) > 0)
if ($object->updatePrice($object->id, $newprice, $newpricebase, $user, $newvat, $newprice_min, $level, $newnpr) > 0)
{
$action = '';
$mesg = '<div class="ok">'.$langs->trans("RecordSaved").'</div>';
@ -446,7 +446,7 @@ if ($result)
// Il doit au moins y avoir la ligne de prix initial.
// On l'ajoute donc pour remettre a niveau (pb vieilles versions)
$object->update_price($object->id, $object->price, 'HT', $user, $newprice_min);
$object->updatePrice($object->id, $object->price, 'HT', $user, $newprice_min);
$result = $db->query($sql);
$num = $db->num_rows($result);