This commit is contained in:
fhenry 2013-01-21 13:48:29 +01:00
commit 91e86c5a59
32 changed files with 193 additions and 154 deletions

View File

@ -105,6 +105,7 @@ For developers:
- New: Add PRODUCT_PRICE_MODIFY trigger.
- New: Created function to retrieve total amount of discount of an invoice/proposal...
- New: We can use a dynamic value ($conf->global->XXX for example) into titles of menus.
- New: Use PHP classes DateTime* for some data functions instead of adodb
- Qual: Renamed SUPPLIER_INVOICE_BUILDDOC trigger to BILL_SUPPLIER_BUILDDOC
- Qual: Renamed INVOICE_SUPPLIER_DELETE trigger to BILL_SUPPLIER_DELETE
- Qual: Renamed SUPLIER_ORDER_BUILDDOC trigger to ORDER_SUPPLIER_BUILDDOC

View File

@ -767,7 +767,7 @@ if ($id)
// Line to type new values
print "<tr ".$bc[$var].">";
$obj = (object) array();
$obj = new stdClass();
// If data was already input, we define them in obj to populate input fields.
if (GETPOST('actionadd'))
{

View File

@ -55,12 +55,13 @@ print $langs->trans("SetupDescription2")."<br><br>";
print '<br>';
//print '<hr style="color: #DDDDDD;">';
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_PAYS)) $setupcompanynotcomplete=1;
print img_picto('','puce').' '.$langs->trans("SetupDescription3",DOL_URL_ROOT.'/admin/company.php?mainmenu=home');
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_PAYS))
if (! empty($setupcompanynotcomplete))
{
$langs->load("errors");
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
print '<br><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a>';
print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit').'">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a></div>';
}
print '<br>';
print '<br>';
@ -71,7 +72,7 @@ if (count($conf->modules) <= 1) // If only user module enabled
{
$langs->load("errors");
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
print '<br><a href="'.DOL_URL_ROOT.'/admin/modules.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a>';
print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/modules.php?mainmenu=home">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a></div>';
}
print '<br>';
print '<br>';
@ -93,7 +94,7 @@ print '</table>';
//print info_admin($langs->trans("OnceSetupFinishedCreateUsers")).'<br>';
$db->close();
llxFooter();
$db->close();
?>

View File

@ -89,12 +89,12 @@ class ActionComm extends CommonObject
{
$this->db = $db;
$this->author = (object) array();
$this->usermod = (object) array();
$this->usertodo = (object) array();
$this->userdone = (object) array();
$this->societe = (object) array();
$this->contact = (object) array();
$this->author = new stdClass();
$this->usermod = new stdClass();
$this->usertodo = new stdClass();
$this->userdone = new stdClass();
$this->societe = new stdClass();
$this->contact = new stdClass();
}
/**

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
@ -736,6 +736,17 @@ else if ($action == "addline" && $user->rights->propal->creer)
}
$desc=dol_concatdesc($desc,$product_desc);
// Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
{
$tmptxt='(';
if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
$tmptxt.=')';
$desc.= dol_concatdesc($desc, $tmptxt);
}
}
$type = $prod->type;

View File

@ -2405,7 +2405,7 @@ class Propal extends CommonObject
{
$obj = $this->db->fetch_object($resql);
$this->lines[$i] = (object) array();
$this->lines[$i] = new stdClass();
$this->lines[$i]->id = $obj->rowid; // for backward compatibility
$this->lines[$i]->rowid = $obj->rowid;
$this->lines[$i]->label = $obj->custom_label;

View File

@ -212,7 +212,7 @@ $head[$h][1] = $langs->trans("ByMonthYear");
$head[$h][2] = 'byyear';
$h++;
$object=(object) array(); // TODO $object not defined ?
$object=new stdClass(); // TODO $object not defined ?
complete_head_from_modules($conf,$langs,$object,$head,$h,'propal_stats');
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
@ -651,6 +651,17 @@ else if ($action == 'addline' && $user->rights->commande->creer)
}
$desc=dol_concatdesc($desc,$product_desc);
// Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
{
$tmptxt='(';
if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
$tmptxt.=')';
$desc.= dol_concatdesc($desc, $tmptxt);
}
}
$type = $prod->type;

View File

@ -233,7 +233,7 @@ $h++;
if ($mode == 'customer') $type='order_stats';
if ($mode == 'supplier') $type='supplier_order_stats';
$object=(object) array(); // TODO $object not defined ?
$object=new stdClass(); // TODO $object not defined ?
complete_head_from_modules($conf,$langs,$object,$head,$h,$type);
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
@ -1034,7 +1034,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$desc = $product_desc;
}
else
{
{
$tva_tx = get_default_tva($mysoc,$object->client,$prod->id);
$tva_npr = get_default_npr($mysoc,$object->client,$prod->id);
@ -1091,16 +1091,17 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
}
$desc=dol_concatdesc($desc,$product_desc);
}
if (! empty($prod->customcode) || ! empty($prod->country_code))
{
$tmptxt='(';
if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
$tmptxt.=')';
$desc.= (dol_textishtml($desc)?"<br>\n":"\n").$tmptxt;
// Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
{
$tmptxt='(';
if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
$tmptxt.=')';
$desc.= dol_concatdesc($desc, $tmptxt);
}
}
$type = $prod->type;

View File

@ -513,7 +513,7 @@ class RemiseCheque extends CommonObject
$i = 0;
while ($objp = $this->db->fetch_object($result))
{
$docmodel->lines[$i] = (object) array();
$docmodel->lines[$i] = new stdClass();
$docmodel->lines[$i]->bank_chq = $objp->banque;
$docmodel->lines[$i]->emetteur_chq = $objp->emetteur;
$docmodel->lines[$i]->amount_chq = $objp->amount;

View File

@ -37,7 +37,7 @@ class box_activity extends ModeleBoxes
var $db;
var $param;
var $enabled = 1;
var $info_box_head = array();
var $info_box_contents = array();
@ -54,8 +54,8 @@ class box_activity extends ModeleBoxes
$langs->load("orders");
$this->boxlabel = $langs->transnoentitiesnoconv("BoxGlobalActivity");
// Disabled by default because, still has some bug (pgsl support, filters) and slow down seriously Dolibarr
// Disabled by default because, still has some bug (pgsl support, filters, getCurrencySymbol us a cache into a form object not defined, ...) and slow down seriously Dolibarr
$this->enabled = (! empty($conf->global->MAIN_FEATURES_LEVEL) || ! empty($conf->global->MAIN_BOX_ACTIVITY_ENABLED));
}
@ -154,9 +154,9 @@ class box_activity extends ModeleBoxes
$sql.= " AND c.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
$sql.= " AND c.datec between '".$db->idate(dol_get_first_day(date("Y"),1,1))."' AND '".$db->idate(dol_get_last_day(date("Y"),12,1))."'";
$sql.= " AND c.date_commande between '".$db->idate(dol_get_first_day(date("Y"),1,1))."' AND '".$db->idate(dol_get_last_day(date("Y"),12,1))."'";
$sql.= " AND c.facture=0";
$sql.= " GROUP BY c.fk_statut";
$sql.= " GROUP BY c.fk_statut,c.facture";
$sql.= " ORDER BY c.fk_statut DESC";
$result = $db->query($sql);

View File

@ -79,32 +79,32 @@ class Conf
function __construct()
{
// 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->file = new stdClass();
$this->db = new stdClass();
$this->global = new stdClass();
$this->mycompany = new stdClass();
$this->admin = new stdClass();
$this->user = new stdClass();
$this->syslog = new stdClass();
$this->browser = new stdClass();
$this->multicompany = new stdClass();
// 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();
$this->expedition_bon = new stdClass();
$this->livraison_bon = new stdClass();
$this->fournisseur = new stdClass();
$this->product = new stdClass();
$this->service = new stdClass();
$this->contrat = new stdClass();
$this->actions = new stdClass();
$this->commande = new stdClass();
$this->propal = new stdClass();
$this->facture = new stdClass();
$this->contrat = new stdClass();
$this->adherent = new stdClass();
$this->bank = new stdClass();
$this->notification = new stdClass();
$this->mailing = new stdClass();
//! Charset for HTML output and for storing data in memory
$this->file->character_set_client='UTF-8'; // UTF-8, ISO-8859-1
@ -193,7 +193,7 @@ class Conf
{
$modulename=strtolower($reg[1]);
if ($modulename == 'propale') $modulename='propal';
if (! isset($this->$modulename) || ! is_object($this->$modulename)) $this->$modulename=(object) array();
if (! isset($this->$modulename) || ! is_object($this->$modulename)) $this->$modulename=new stdClass();
$this->$modulename->enabled=true;
$this->modules[]=$modulename; // Add this module in list of enabled modules
}
@ -216,20 +216,20 @@ class Conf
}
// 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();
$this->propal->cloture = new stdClass();
$this->propal->facturation = new stdClass();
$this->commande->client = new stdClass();
$this->commande->fournisseur = new stdClass();
$this->facture->client = new stdClass();
$this->facture->fournisseur = new stdClass();
$this->fournisseur->commande = new stdClass();
$this->fournisseur->facture = new stdClass();
$this->contrat->services = new stdClass();
$this->contrat->services->inactifs = new stdClass();
$this->contrat->services->expires = new stdClass();
$this->adherent->cotisation = new stdClass();
$this->bank->rappro = new stdClass();
$this->bank->cheque = new stdClass();
// Clean some variables
if (empty($this->global->MAIN_MENU_STANDARD)) $this->global->MAIN_MENU_STANDARD="eldy_backoffice.php";

View File

@ -385,7 +385,7 @@ function agenda_prepare_head()
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda_admin');
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_extrafields.php";
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
@ -455,7 +455,7 @@ function calendars_prepare_head($param)
$head[$h][2] = 'card';
$h++;
$object=(object) array();
$object=new stdClass();
// Show more tabs from modules
// Entries must be declared in modules descriptor with line

View File

@ -88,7 +88,7 @@ function getServerTimeZoneInt($refgmtdate='now')
// Method 1 (include daylight)
$gmtnow=dol_now('gmt'); $yearref=dol_print_date($gmtnow,'%Y'); $monthref=dol_print_date($gmtnow,'%m'); $dayref=dol_print_date($gmtnow,'%d');
if ($refgmtdate == 'now') $newrefgmtdate=$yearref.'-'.$monthref.'-'.$dayref;
elseif ($refgmtdate == 'summer') $newrefgmtdate=$yearref.'-05-15';
elseif ($refgmtdate == 'summer') $newrefgmtdate=$yearref.'-08-01';
else $newrefgmtdate=$yearref.'-01-01';
$localtz = new DateTimeZone(getServerTimeZoneString());
$localdt = new DateTime($newrefgmtdate, $localtz);
@ -773,7 +773,7 @@ function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $ha
global $langs;
dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday);
// Check parameters
if (! is_int($timestampStart) && ! is_float($timestampStart)) return 'ErrorBadParameter_num_open_day';
if (! is_int($timestampEnd) && ! is_float($timestampEnd)) return 'ErrorBadParameter_num_open_day';

View File

@ -116,27 +116,32 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
if (defined("SYSLOG_FILE_NO_ERROR")) $filefd = @fopen($logfile, 'a+');
else $filefd = fopen($logfile, 'a+');
if (!$filefd && ! defined("SYSLOG_FILE_NO_ERROR"))
if (! $filefd)
{
// Do not break dolibarr usage if log fails
//throw new Exception('Failed to open log file '.basename($logfile));
print 'Failed to open log file '.basename($logfile);
if (! defined("SYSLOG_FILE_NO_ERROR"))
{
// Do not break dolibarr usage if log fails
//throw new Exception('Failed to open log file '.basename($logfile));
print 'Failed to open log file '.basename($logfile);
}
}
else
{
$logLevels = array(
LOG_EMERG => 'EMERG',
LOG_ALERT => 'ALERT',
LOG_CRIT => 'CRIT',
LOG_ERR => 'ERR',
LOG_WARNING => 'WARNING',
LOG_NOTICE => 'NOTICE',
LOG_INFO => 'INFO',
LOG_DEBUG => 'DEBUG'
);
$logLevels = array(
LOG_EMERG => 'EMERG',
LOG_ALERT => 'ALERT',
LOG_CRIT => 'CRIT',
LOG_ERR => 'ERR',
LOG_WARNING => 'WARNING',
LOG_NOTICE => 'NOTICE',
LOG_INFO => 'INFO',
LOG_DEBUG => 'DEBUG'
);
$message = dol_print_date(time(),"%Y-%m-%d %H:%M:%S")." ".sprintf("%-5s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".($this->ident>0?str_pad('',$this->ident,' '):'').$content['message'];
$message = dol_print_date(time(),"%Y-%m-%d %H:%M:%S")." ".sprintf("%-5s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".($this->ident>0?str_pad('',$this->ident,' '):'').$content['message'];
fwrite($filefd, $message."\n");
fclose($filefd);
fwrite($filefd, $message."\n");
fclose($filefd);
}
}
}

View File

@ -406,7 +406,7 @@ class FactureFournisseur extends CommonInvoice
{
$obj = $this->db->fetch_object($resql_rows);
$this->lines[$i] = (object) array();
$this->lines[$i] = new stdClass();
$this->lines[$i]->rowid = $obj->rowid;
$this->lines[$i]->description = $obj->description;
$this->lines[$i]->ref = $obj->product_ref; // TODO deprecated

View File

@ -57,7 +57,7 @@ $offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="fac.datef";
if (! $sortfield) $sortfield="fac.datef,fac.rowid";
$month = GETPOST('month','int');
$year = GETPOST('year','int');
@ -193,7 +193,7 @@ if ($resql)
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"fac.rowid","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"facnumber","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fac.datef","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fac.datef,fac.rowid","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"fac.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"fac.libelle","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);

View File

@ -252,7 +252,7 @@ if ($user->societe_id == 0)
}
}
$object=(object) array();
$object=new stdClass();
$parameters=array();
$action='';
$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks

View File

@ -48,10 +48,10 @@ require_once ADODB_PATH.'adodb-time.inc.php';
// Avoid warnings with strict mode E_STRICT
$conf = new stdClass(); // instantiate $conf explicitely
$conf->global = (object) array();
$conf->file = (object) array();
$conf->db = (object) array();
$conf->syslog = (object) array();
$conf->global = new stdClass();
$conf->file = new stdClass();
$conf->db = new stdClass();
$conf->syslog = new stdClass();
// Force $_REQUEST["logtohtml"]
$_REQUEST["logtohtml"]=1;

View File

@ -5,7 +5,7 @@
-- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
-- Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
-- Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
-- Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
-- Copyright (C) 2012 Sebastian Neuwert <sebastian.neuwert@modula71.de>
-- Copyright (C) 2012 Ricardo Schluter <info@ripasch.nl>
--
@ -284,7 +284,7 @@ insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,no
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (1401,'NL','',1,'','Newfoundland and Labrador');
-- Provinces Spain (id country=4)
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('01', 419, '', 19, 'PAIS VASCO', 'País Vasco', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('01', 419, '', 19, 'ALAVA', 'Álava', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('02', 404, '', 4, 'ALBACETE', 'Albacete', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('03', 411, '', 11, 'ALICANTE', 'Alicante', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('04', 401, '', 1, 'ALMERIA', 'Almería', 1);
@ -294,7 +294,7 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('08', 406, '', 6, 'BARCELONA', 'Barcelona', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('09', 403, '', 8, 'BURGOS', 'Burgos', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('10', 412, '', 12, 'CACERES', 'Cáceres', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('11', 401, '', 1, 'CADIz', 'Cádiz', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('11', 401, '', 1, 'CADIZ', 'Cádiz', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('12', 411, '', 11, 'CASTELLON', 'Castellón', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('13', 404, '', 4, 'CIUDAD REAL', 'Ciudad Real', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('14', 401, '', 1, 'CORDOBA', 'Córdoba', 1);

View File

@ -192,14 +192,14 @@ ALTER TABLE llx_holiday ADD INDEX idx_holiday_fk_user (fk_user);
ALTER TABLE llx_holiday ADD INDEX idx_holiday_date_debut (date_debut);
ALTER TABLE llx_holiday ADD INDEX idx_holiday_date_fin (date_fin);
INSERT INTO llx_holiday_config (rowid ,name ,value) VALUES (NULL , 'userGroup', NULL);
INSERT INTO llx_holiday_config (rowid ,name ,value) VALUES (NULL , 'lastUpdate', NULL);
INSERT INTO llx_holiday_config (rowid ,name ,value) VALUES (NULL , 'nbUser', NULL);
INSERT INTO llx_holiday_config (rowid ,name ,value) VALUES (NULL , 'delayForRequest', '31');
INSERT INTO llx_holiday_config (rowid ,name ,value) VALUES (NULL , 'AlertValidatorDelay', '0');
INSERT INTO llx_holiday_config (rowid ,name ,value) VALUES (NULL , 'AlertValidatorSolde', '0');
INSERT INTO llx_holiday_config (rowid ,name ,value) VALUES (NULL , 'nbHolidayDeducted', '1');
INSERT INTO llx_holiday_config (rowid ,name ,value) VALUES (NULL , 'nbHolidayEveryMonth', '2.08334');
INSERT INTO llx_holiday_config (name ,value) VALUES ('userGroup', NULL);
INSERT INTO llx_holiday_config (name ,value) VALUES ('lastUpdate', NULL);
INSERT INTO llx_holiday_config (name ,value) VALUES ('nbUser', NULL);
INSERT INTO llx_holiday_config (name ,value) VALUES ('delayForRequest', '31');
INSERT INTO llx_holiday_config (name ,value) VALUES ('AlertValidatorDelay', '0');
INSERT INTO llx_holiday_config (name ,value) VALUES ('AlertValidatorSolde', '0');
INSERT INTO llx_holiday_config (name ,value) VALUES ('nbHolidayDeducted', '1');
INSERT INTO llx_holiday_config (name ,value) VALUES ('nbHolidayEveryMonth', '2.08334');
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (80, 'agenda', 'internal', 'ACTOR', 'Responsable', 1);
@ -838,26 +838,32 @@ CREATE TABLE llx_product_price_by_qty
qty_min real DEFAULT 0
)ENGINE=innodb;
ALTER TABLE llx_product_price ADD COLUMN price_by_qty INT NOT NULL DEFAULT 0;
ALTER TABLE llx_product_price ADD COLUMN price_by_qty integer NOT NULL DEFAULT 0;
ALTER TABLE llx_product_price_by_qty ADD UNIQUE INDEX uk_product_price_by_qty_level (fk_product_price, qty_min);
ALTER TABLE llx_product_price_by_qty ADD INDEX idx_product_price_by_qty_fk_product_price (fk_product_price);
ALTER TABLE llx_product_price_by_qty ADD CONSTRAINT fk_product_price_by_qty_fk_product_price FOREIGN KEY (fk_product_price) REFERENCES llx_product_price (rowid);
ALTER TABLE `llx_product_price_by_qty` ADD `remise_percent` DOUBLE NOT NULL DEFAULT '0' AFTER `price_ttc` ,
ADD `remise` DOUBLE NOT NULL DEFAULT '0' AFTER `remise_percent`;
ALTER TABLE llx_product_price_by_qty ADD remise_percent DOUBLE NOT NULL DEFAULT '0' AFTER price_ttc;
ALTER TABLE llx_product_price_by_qty ADD remise DOUBLE NOT NULL DEFAULT '0' AFTER remise_percent;
-- Change index name to be compliant with SQL standard, index name must be unique in database schema
ALTER TABLE llx_c_actioncomm DROP INDEX code, ADD UNIQUE uk_c_actioncomm (code);
ALTER TABLE llx_c_civilite DROP INDEX code, ADD UNIQUE uk_c_civilite (code);
ALTER TABLE llx_c_propalst DROP INDEX code, ADD UNIQUE uk_c_propalst (code);
ALTER TABLE llx_c_stcomm DROP INDEX code, ADD UNIQUE uk_c_stcomm (code);
ALTER TABLE llx_c_type_fees DROP INDEX code, ADD UNIQUE uk_c_type_fees (code);
ALTER TABLE llx_c_typent DROP INDEX code, ADD UNIQUE uk_c_typent (code);
ALTER TABLE llx_c_effectif DROP INDEX code, ADD UNIQUE uk_c_effectif (code);
ALTER TABLE llx_c_paiement DROP INDEX code, ADD UNIQUE uk_c_paiement (code);
ALTER TABLE llx_c_actioncomm DROP INDEX code;
ALTER TABLE llx_c_actioncomm ADD UNIQUE INDEX uk_c_actioncomm(code);
ALTER TABLE llx_c_civilite DROP INDEX code;
ALTER TABLE llx_c_civilite ADD UNIQUE INDEX uk_c_civilite(code);
ALTER TABLE llx_c_propalst DROP INDEX code;
ALTER TABLE llx_c_propalst ADD UNIQUE INDEX uk_c_propalst(code);
ALTER TABLE llx_c_stcomm DROP INDEX code;
ALTER TABLE llx_c_stcomm ADD UNIQUE INDEX uk_c_stcomm(code);
ALTER TABLE llx_c_type_fees DROP INDEX code;
ALTER TABLE llx_c_type_fees ADD UNIQUE INDEX uk_c_type_fees(code);
ALTER TABLE llx_c_typent DROP INDEX code;
ALTER TABLE llx_c_typent ADD UNIQUE INDEX uk_c_typent(code);
ALTER TABLE llx_c_effectif DROP INDEX code;
ALTER TABLE llx_c_effectif ADD UNIQUE INDEX uk_c_effectif(code);
ALTER TABLE llx_c_paiement DROP INDEX code;
ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement(code);
delete from llx_c_actioncomm where id = 40;
INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, position) values ( 40, 'AC_OTH_AUTO','systemauto', 'Other (automatically inserted events)' ,NULL, 20);
@ -913,3 +919,5 @@ ALTER TABLE llx_element_lock DROP COLUMN status;
DELETE FROM llx_c_action_trigger WHERE elementtype='withdraw';
UPDATE llx_c_action_trigger SET code='FICHINTER_VALIDATE' WHERE code='FICHEINTER_VALIDATE';
UPDATE llx_c_departements SET ncc='ALAVA', nom='Álava' WHERE code_departement='01' AND fk_region=419;

View File

@ -23,7 +23,7 @@ create table llx_product_price_by_qty
(
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
fk_product_price integer NOT NULL,
date_price timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
date_price timestamp NOT NULL,
price double(24,8) DEFAULT 0,
quantity double DEFAULT NULL,
remise_percent double NOT NULL DEFAULT 0,

View File

@ -177,7 +177,7 @@ function paypaladmin_prepare_head()
$head[$h][2] = 'paypalaccount';
$h++;
$object=(object) array();
$object=new stdClass();
// Show more tabs from modules
// Entries must be declared in modules descriptor with line

View File

@ -2571,7 +2571,7 @@ class Product extends CommonObject
while ($i < $num)
{
$row = $this->db->fetch_object($result);
$this->stock_warehouse[$row->fk_entrepot] = (object) array();
$this->stock_warehouse[$row->fk_entrepot] = new stdClass();
$this->stock_warehouse[$row->fk_entrepot]->real = $row->reel;
$this->stock_warehouse[$row->fk_entrepot]->pmp = $row->pmp;
$this->stock_reel+=$row->reel;

View File

@ -551,7 +551,7 @@ class Task extends CommonObject
if (! $error)
{
$tasks[$i] = (object) array();
$tasks[$i] = new stdClass();
$tasks[$i]->id = $obj->taskid;
$tasks[$i]->ref = $obj->taskid;
$tasks[$i]->fk_project = $obj->projectid;

View File

@ -66,7 +66,7 @@ $demoprofiles=array(
$tmpaction = 'view';
$parameters=array();
$object=(object) 'nothing';
$object=new stdClass();
$reshook=$hookmanager->executeHooks('addDemoProfile', $parameters, $object, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=$hookmanager->errors;

View File

@ -136,7 +136,7 @@ if ($PAYPALTOKEN)
$ack = strtoupper($resArray["ACK"]);
if($ack=="SUCCESS" || $ack=="SUCCESSWITHWARNING")
{
$object = (object) 'paypal';
$object = new stdClass();
$object->source = $source;
$object->ref = $ref;

View File

@ -45,10 +45,10 @@ require_once ADODB_PATH.'adodb-time.inc.php';
// Avoid warnings with strict mode E_STRICT
$conf = new stdClass(); // instantiate $conf explicitely
$conf->global = (object) array();
$conf->file = (object) array();
$conf->db = (object) array();
$conf->syslog = (object) array();
$conf->global = new stdClass();
$conf->file = new stdClass();
$conf->db = new stdClass();
$conf->syslog = new stdClass();
// Force $_REQUEST["logtohtml"]
$_REQUEST["logtohtml"]=1;

View File

@ -112,11 +112,11 @@ class User extends CommonObject
$this->all_permissions_are_loaded = 0;
$this->admin=0;
$this->conf = (object) array();
$this->rights = (object) array();
$this->rights->user = (object) array();
$this->rights->user->user = (object) array();
$this->rights->user->self = (object) array();
$this->conf = new stdClass();
$this->rights = new stdClass();
$this->rights->user = new stdClass();
$this->rights->user->user = new stdClass();
$this->rights->user->self = new stdClass();
}
/**
@ -538,11 +538,11 @@ class User extends CommonObject
if ($perms)
{
if (! isset($this->rights) || ! is_object($this->rights)) $this->rights = (object) array(); // For avoid error
if (! isset($this->rights->$module) || ! is_object($this->rights->$module)) $this->rights->$module = (object) array();
if (! isset($this->rights) || ! is_object($this->rights)) $this->rights = new stdClass(); // For avoid error
if (! isset($this->rights->$module) || ! is_object($this->rights->$module)) $this->rights->$module = new stdClass();
if ($subperms)
{
if (! isset($this->rights->$module->$perms) || ! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = (object) array();
if (! isset($this->rights->$module->$perms) || ! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = new stdClass();
$this->rights->$module->$perms->$subperms = 1;
}
else
@ -588,11 +588,11 @@ class User extends CommonObject
if ($perms)
{
if (! isset($this->rights) || ! is_object($this->rights)) $this->rights = (object) array(); // For avoid error
if (! isset($this->rights->$module) || ! is_object($this->rights->$module)) $this->rights->$module = (object) array();
if (! isset($this->rights) || ! is_object($this->rights)) $this->rights = new stdClass(); // For avoid error
if (! isset($this->rights->$module) || ! is_object($this->rights->$module)) $this->rights->$module = new stdClass();
if ($subperms)
{
if (! isset($this->rights->$module->$perms) || ! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = (object) array();
if (! isset($this->rights->$module->$perms) || ! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = new stdClass();
$this->rights->$module->$perms->$subperms = 1;
}
else

View File

@ -470,11 +470,11 @@ class UserGroup extends CommonObject
if ($perms)
{
if (! isset($this->rights)) $this->rights = (object) array(); // For avoid error
if (! isset($this->rights->$module) || ! is_object($this->rights->$module)) $this->rights->$module = (object) array();
if (! isset($this->rights)) $this->rights = new stdClass(); // For avoid error
if (! isset($this->rights->$module) || ! is_object($this->rights->$module)) $this->rights->$module = new stdClass();
if ($subperms)
{
if (! isset($this->rights->$module->$perms) || ! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = (object) array();
if (! isset($this->rights->$module->$perms) || ! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = new stdClass();
$this->rights->$module->$perms->$subperms = 1;
}
else

View File

@ -28,6 +28,7 @@ require_once '../master.inc.php';
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
@ -512,8 +513,8 @@ function CreateUserFromThirdparty($authentication,$thirdpartywithuser)
*/
$contact = new Contact($db);
$contact->socid = $thirdparty->id;
$contact->lastname = $thirdparty->name;
$contact->firstname = $thirdparty->firstname;
$contact->lastname = $thirdpartywithuser['name'];
$contact->firstname = $thirdpartywithuser['firstname'];
$contact->civilite_id = $thirdparty->civilite_id;
$contact->address = $thirdparty->address;
$contact->zip = $thirdparty->zip;
@ -523,7 +524,7 @@ function CreateUserFromThirdparty($authentication,$thirdpartywithuser)
$contact->phone_mobile = $thirdparty->phone_mobile;
$contact->fax = $thirdparty->fax;
$contact_id = $contact->create($user);
$contact_id = $contact->create($fuser);
if ($contact_id > 0)
{