Fix: avoid warnings (strict mode)
This commit is contained in:
parent
a00205a17d
commit
afdab32bbf
@ -120,11 +120,11 @@ class ActionComm extends CommonObject
|
||||
if (empty($this->punctual)) $this->punctual = 0;
|
||||
if ($this->percentage > 100) $this->percentage = 100;
|
||||
if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date;
|
||||
if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep);
|
||||
if ($this->date && $this->dateend) $this->durationa=($this->dateend - $this->date);
|
||||
if ($this->datep && $this->datef && $this->datep > $this->datef) $this->datef=$this->datep;
|
||||
if ($this->date && $this->dateend && $this->date > $this->dateend) $this->dateend=$this->date;
|
||||
if ($this->fk_project < 0) $this->fk_project = 0;
|
||||
if (! empty($this->datep) && ! empty($this->datef)) $this->durationp=($this->datef - $this->datep);
|
||||
if (! empty($this->date) && ! empty($this->dateend)) $this->durationa=($this->dateend - $this->date);
|
||||
if (! empty($this->datep) && ! empty($this->datef) && $this->datep > $this->datef) $this->datef=$this->datep;
|
||||
if (! empty($this->date) && ! empty($this->dateend) && $this->date > $this->dateend) $this->dateend=$this->date;
|
||||
if (! isset($this->fk_project) || $this->fk_project < 0) $this->fk_project = 0;
|
||||
if ($this->elementtype=='facture') $this->elementtype='invoice';
|
||||
if ($this->elementtype=='commande') $this->elementtype='order';
|
||||
if ($this->elementtype=='contrat') $this->elementtype='contract';
|
||||
@ -186,19 +186,19 @@ class ActionComm extends CommonObject
|
||||
$sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").",";
|
||||
//$sql.= (strval($this->date)!=''?"'".$this->db->idate($this->date)."'":"null").",";
|
||||
//$sql.= (strval($this->dateend)!=''?"'".$this->db->idate($this->dateend)."'":"null").",";
|
||||
$sql.= ($this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").",";
|
||||
$sql.= (isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").",";
|
||||
//$sql.= ($this->durationa >= 0 && $this->durationa != ''?"'".$this->durationa."'":"null").",";
|
||||
$sql.= " '".$this->type_id."',";
|
||||
$sql.= ($this->societe->id>0?" '".$this->societe->id."'":"null").",";
|
||||
$sql.= ($this->fk_project>0?" '".$this->fk_project."'":"null").",";
|
||||
$sql.= (isset($this->societe->id) && $this->societe->id > 0?" '".$this->societe->id."'":"null").",";
|
||||
$sql.= (isset($this->fk_project) && $this->fk_project > 0?" '".$this->fk_project."'":"null").",";
|
||||
$sql.= " '".$this->db->escape($this->note)."',";
|
||||
$sql.= ($this->contact->id > 0?"'".$this->contact->id."'":"null").",";
|
||||
$sql.= ($user->id > 0 ? "'".$user->id."'":"null").",";
|
||||
$sql.= ($this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").",";
|
||||
$sql.= ($this->userdone->id > 0?"'".$this->userdone->id."'":"null").",";
|
||||
$sql.= (isset($this->contact->id) && $this->contact->id > 0?"'".$this->contact->id."'":"null").",";
|
||||
$sql.= (isset($user->id) && $user->id > 0 ? "'".$user->id."'":"null").",";
|
||||
$sql.= (isset($this->usertodo->id) && $this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").",";
|
||||
$sql.= (isset($this->userdone->id) && $this->userdone->id > 0?"'".$this->userdone->id."'":"null").",";
|
||||
$sql.= "'".$this->db->escape($this->label)."','".$this->percentage."','".$this->priority."','".$this->fulldayevent."','".$this->db->escape($this->location)."','".$this->punctual."',";
|
||||
$sql.= ($this->fk_element?$this->fk_element:"null").",";
|
||||
$sql.= ($this->elementtype?"'".$this->elementtype."'":"null").",";
|
||||
$sql.= (! empty($this->fk_element)?$this->fk_element:"null").",";
|
||||
$sql.= (! empty($this->elementtype)?"'".$this->elementtype."'":"null").",";
|
||||
$sql.= $conf->entity;
|
||||
$sql.= ")";
|
||||
|
||||
|
||||
@ -1688,7 +1688,7 @@ class Facture extends CommonInvoice
|
||||
$result=$this->client->set_as_client();
|
||||
|
||||
// Si active on decremente le produit principal et ses composants a la validation de facture
|
||||
if ($this->type != 3 && $result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL)
|
||||
if ($this->type != 3 && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* 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
|
||||
@ -50,11 +50,11 @@ abstract class CommonDocGenerator
|
||||
'myuser_lastname'=>$user->lastname,
|
||||
'myuser_firstname'=>$user->firstname,
|
||||
'myuser_login'=>$user->login,
|
||||
'myuser_phone'=>$user->officephone,
|
||||
'myuser_fax'=>$user->officefax,
|
||||
'myuser_phone'=>$user->office_phone,
|
||||
'myuser_fax'=>$user->office_fax,
|
||||
'myuser_mobile'=>$user->user_mobile,
|
||||
'myuser_email'=>$user->user_email,
|
||||
'myuser_web'=>$user->url
|
||||
'myuser_email'=>$user->email,
|
||||
//'myuser_web'=>$user->url // FIXME url not exist in $user object
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.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
|
||||
@ -43,10 +43,10 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
||||
global $db, $conf, $langs;
|
||||
|
||||
$idprod=$line->fk_product;
|
||||
$label=$line->label; if (empty($label)) $label=$line->libelle;
|
||||
$desc=$line->desc; if (empty($desc)) $desc=$line->description;
|
||||
$ref_supplier=$line->ref_supplier; if (empty($ref_supplier)) $ref_supplier=$line->ref_fourn; // TODO Not yet saved for supplier invoices, only supplier orders
|
||||
$note=$line->note;
|
||||
$label=(! empty($line->label)?$line->label:(! empty($line->libelle)?$line->libelle:''));
|
||||
$desc=(! empty($line->desc)?$line->desc:(! empty($line->description)?$line->description:''));
|
||||
$ref_supplier=(! empty($line->ref_supplier)?$line->ref_supplier:(! empty($line->ref_fourn)?$line->ref_fourn:'')); // TODO Not yet saved for supplier invoices, only supplier orders
|
||||
$note=(! empty($line->note)?$line->note:'');
|
||||
|
||||
if ($issupplierline) $prodser = new ProductFournisseur($db);
|
||||
else $prodser = new Product($db);
|
||||
@ -55,7 +55,7 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
||||
{
|
||||
$prodser->fetch($idprod);
|
||||
// If a predefined product and multilang and on other lang, we renamed label with label translated
|
||||
if ($conf->global->MAIN_MULTILANGS && ($outputlangs->defaultlang != $langs->defaultlang))
|
||||
if (! empty($conf->global->MAIN_MULTILANGS) && ($outputlangs->defaultlang != $langs->defaultlang))
|
||||
{
|
||||
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && $label == $prodser->label) $label=$prodser->multilangs[$outputlangs->defaultlang]["label"];
|
||||
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && $desc == $prodser->description) $desc=$prodser->multilangs[$outputlangs->defaultlang]["description"];
|
||||
@ -89,7 +89,8 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
||||
{
|
||||
if ($idprod)
|
||||
{
|
||||
if ( empty($hidedesc) ) $libelleproduitservice.=$desc;
|
||||
if (empty($hidedesc))
|
||||
$libelleproduitservice.=$desc;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -106,9 +107,9 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
||||
{
|
||||
$prefix_prodserv = "";
|
||||
$ref_prodserv = "";
|
||||
if ($conf->global->PRODUCT_ADD_TYPE_IN_DOCUMENTS) // In standard mode, we do not show this
|
||||
if (! empty($conf->global->PRODUCT_ADD_TYPE_IN_DOCUMENTS)) // In standard mode, we do not show this
|
||||
{
|
||||
if($prodser->isservice())
|
||||
if ($prodser->isservice())
|
||||
{
|
||||
$prefix_prodserv = $outputlangs->transnoentitiesnoconv("Service")." ";
|
||||
}
|
||||
@ -118,7 +119,7 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
||||
}
|
||||
}
|
||||
|
||||
if ( empty($hideref) )
|
||||
if (empty($hideref))
|
||||
{
|
||||
if ($issupplierline) $ref_prodserv = $prodser->ref.' ('.$outputlangs->trans("SupplierRef").' '.$ref_supplier.')'; // Show local ref and supplier ref
|
||||
else $ref_prodserv = $prodser->ref; // Show local ref only
|
||||
@ -130,7 +131,7 @@ function doc_getlinedesc($line,$outputlangs,$hideref=0,$hidedesc=0,$issupplierli
|
||||
}
|
||||
}
|
||||
|
||||
if ($line->date_start || $line->date_end)
|
||||
if (! empty($line->date_start) || ! empty($line->date_end))
|
||||
{
|
||||
$format='day';
|
||||
// Show duration if exists
|
||||
|
||||
@ -246,4 +246,4 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2012 Laurent Destailleur <ely@users.sourceforge.net>
|
||||
/* Copyright (C) 2010-2012 Laurent Destailleur <ely@users.sourceforge.net>
|
||||
* Copyright (C) 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
|
||||
@ -108,12 +109,12 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
||||
'object_ref'=>$object->ref,
|
||||
'object_ref_ext'=>$object->ref_ext,
|
||||
'object_ref_customer'=>$object->ref_client,
|
||||
'object_ref_supplier'=>$object->ref_fournisseur,
|
||||
'object_ref_supplier'=>(! empty($object->ref_fournisseur)?$object->ref_fournisseur:''),
|
||||
'object_source_invoice_ref'=>$invoice_source->ref,
|
||||
'object_date'=>dol_print_date($object->date,'day'),
|
||||
'object_date_limit'=>dol_print_date($object->date_lim_reglement,'day'),
|
||||
'object_date_creation'=>dol_print_date($object->date_creation,'day'),
|
||||
'object_date_modification'=>dol_print_date($object->date_modification,'day'),
|
||||
'object_date_modification'=>(! empty($object->date_modification)?dol_print_date($object->date_modification,'day'):''),
|
||||
'object_date_validation'=>dol_print_date($object->date_validation,'dayhour'),
|
||||
'object_payment_mode_code'=>$object->mode_reglement_code,
|
||||
'object_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code)!='PaymentType'.$object->mode_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code):$object->mode_reglement),
|
||||
@ -122,7 +123,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
||||
'object_total_ht'=>price($object->total_ht,0,$outputlangs),
|
||||
'object_total_vat'=>price($object->total_tva,0,$outputlangs),
|
||||
'object_total_ttc'=>price($object->total_ttc,0,$outputlangs),
|
||||
'object_vatrate'=>vatrate($object->tva),
|
||||
'object_vatrate'=>(isset($object->tva)?vatrate($object->tva):''),
|
||||
'object_note_private'=>$object->note,
|
||||
'object_note'=>$object->note_public,
|
||||
// Payments
|
||||
@ -339,7 +340,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
||||
'__FROM_EMAIL__' => $this->emetteur->email,
|
||||
'__TOTAL_TTC__' => $object->total_ttc,
|
||||
'__TOTAL_HT__' => $object->total_ht,
|
||||
'__TOTAL_VAT__' => $object->total_vat
|
||||
'__TOTAL_VAT__' => $object->total_tva
|
||||
);
|
||||
complete_substitutions_array($substitutionarray, $langs, $object);
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-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
|
||||
@ -95,21 +95,23 @@ class ImportCsv extends ModeleImports
|
||||
}
|
||||
|
||||
/**
|
||||
* getDriverLabel
|
||||
* getDriverLabel
|
||||
*
|
||||
* @return string Label
|
||||
* @param string $key Key
|
||||
* @return string Label
|
||||
*/
|
||||
function getDriverLabel()
|
||||
function getDriverLabel($key='')
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
/**
|
||||
* getDriverDesc
|
||||
* getDriverDesc
|
||||
*
|
||||
* @return string Description
|
||||
* @param string $key Key
|
||||
* @return string Description
|
||||
*/
|
||||
function getDriverDesc()
|
||||
function getDriverDesc($key='')
|
||||
{
|
||||
return $this->desc;
|
||||
}
|
||||
@ -125,21 +127,23 @@ class ImportCsv extends ModeleImports
|
||||
}
|
||||
|
||||
/**
|
||||
* getDriverVersion
|
||||
* getDriverVersion
|
||||
*
|
||||
* @return string Driver version
|
||||
* @param string $key Key
|
||||
* @return string Driver version
|
||||
*/
|
||||
function getDriverVersion()
|
||||
function getDriverVersion($key='')
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
/**
|
||||
* getDriverLabel
|
||||
* getDriverLabel
|
||||
*
|
||||
* @return string Label of external lib
|
||||
* @param string $key Key
|
||||
* @return string Label of external lib
|
||||
*/
|
||||
function getLibLabel()
|
||||
function getLibLabel($key='')
|
||||
{
|
||||
return $this->label_lib;
|
||||
}
|
||||
@ -147,9 +151,10 @@ class ImportCsv extends ModeleImports
|
||||
/**
|
||||
* getLibVersion
|
||||
*
|
||||
* @return string Version of external lib
|
||||
* @param string $key Key
|
||||
* @return string Version of external lib
|
||||
*/
|
||||
function getLibVersion()
|
||||
function getLibVersion($key='')
|
||||
{
|
||||
return $this->version_lib;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* 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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user