mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-13 21:11:31 +01:00
Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -1,32 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Marc Barilley <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/comm/propal/class/propal.class.php
|
* \file htdocs/comm/propal/class/propal.class.php
|
||||||
* \brief Fichier de la classe des propales
|
* \brief Fichier de la classe des propales
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
|
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/product/class/product.class.php");
|
require_once(DOL_DOCUMENT_ROOT ."/product/class/product.class.php");
|
||||||
@@ -1037,7 +1037,7 @@ class Propal extends CommonObject
|
|||||||
$this->cond_reglement = $obj->cond_reglement;
|
$this->cond_reglement = $obj->cond_reglement;
|
||||||
$this->cond_reglement_doc = $obj->cond_reglement_libelle_doc;
|
$this->cond_reglement_doc = $obj->cond_reglement_libelle_doc;
|
||||||
|
|
||||||
$this->extraparams = (array) dol_json_decode($obj->extraparams, true);
|
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
||||||
|
|
||||||
$this->user_author_id = $obj->fk_user_author;
|
$this->user_author_id = $obj->fk_user_author;
|
||||||
$this->user_valid_id = $obj->fk_user_valid;
|
$this->user_valid_id = $obj->fk_user_valid;
|
||||||
|
|||||||
@@ -1293,7 +1293,7 @@ class Commande extends CommonObject
|
|||||||
$this->fk_delivery_address = $obj->fk_adresse_livraison;
|
$this->fk_delivery_address = $obj->fk_adresse_livraison;
|
||||||
$this->propale_id = $obj->fk_source;
|
$this->propale_id = $obj->fk_source;
|
||||||
|
|
||||||
$this->extraparams = (array) dol_json_decode($obj->extraparams, true);
|
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
||||||
|
|
||||||
$this->lines = array();
|
$this->lines = array();
|
||||||
|
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ class Deplacement extends CommonObject
|
|||||||
$this->note_public = $obj->note_public;
|
$this->note_public = $obj->note_public;
|
||||||
$this->fk_project = $obj->fk_projet;
|
$this->fk_project = $obj->fk_projet;
|
||||||
|
|
||||||
$this->extraparams = (array) dol_json_decode($obj->extraparams, true);
|
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -828,7 +828,7 @@ class Facture extends CommonObject
|
|||||||
$this->user_valid = $obj->fk_user_valid;
|
$this->user_valid = $obj->fk_user_valid;
|
||||||
$this->modelpdf = $obj->model_pdf;
|
$this->modelpdf = $obj->model_pdf;
|
||||||
|
|
||||||
$this->extraparams = (array) dol_json_decode($obj->extraparams, true);
|
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
||||||
|
|
||||||
if ($this->statut == 0) $this->brouillon = 1;
|
if ($this->statut == 0) $this->brouillon = 1;
|
||||||
|
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ class Contrat extends CommonObject
|
|||||||
$this->socid = $result["fk_soc"];
|
$this->socid = $result["fk_soc"];
|
||||||
$this->fk_soc = $result["fk_soc"];
|
$this->fk_soc = $result["fk_soc"];
|
||||||
|
|
||||||
$this->extraparams = (array) dol_json_decode($result["extraparams"], true);
|
$this->extraparams = (array) json_decode($result["extraparams"], true);
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
|
|||||||
@@ -2142,7 +2142,7 @@ abstract class CommonObject
|
|||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||||
$sql.= ' SET extraparams = "'.$this->db->escape(dol_json_encode($this->extraparams)).'"';
|
$sql.= ' SET extraparams = "'.$this->db->escape(json_encode($this->extraparams)).'"';
|
||||||
$sql.= ' WHERE rowid = '.$this->id;
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::setExtraParameters sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::setExtraParameters sql=".$sql, LOG_DEBUG);
|
||||||
@@ -2416,7 +2416,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected,$hookmanager);
|
$this->printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected,$hookmanager);
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
@@ -2443,7 +2443,7 @@ abstract class CommonObject
|
|||||||
* @param HookManager $hookmanager Hook manager
|
* @param HookManager $hookmanager Hook manager
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function _printObjectLine($action,$line,$var=true,$num=0,$i=0,$dateSelector=0,$seller,$buyer,$selected=0,$hookmanager=false)
|
function printObjectLine($action,$line,$var=true,$num=0,$i=0,$dateSelector=0,$seller,$buyer,$selected=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$user;
|
global $conf,$langs,$user;
|
||||||
global $form,$bc,$bcdd;
|
global $form,$bc,$bcdd;
|
||||||
@@ -2567,7 +2567,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_printOriginLine($line,$var);
|
$this->printOriginLine($line,$var);
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
@@ -2584,7 +2584,7 @@ abstract class CommonObject
|
|||||||
* @param string $var Var
|
* @param string $var Var
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function _printOriginLine($line,$var)
|
function printOriginLine($line,$var)
|
||||||
{
|
{
|
||||||
global $langs,$bc;
|
global $langs,$bc;
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ class Conf
|
|||||||
$varname = $partname.'_modules'; // TODO deprecated
|
$varname = $partname.'_modules'; // TODO deprecated
|
||||||
if (! isset($this->$varname) || ! is_array($this->$varname)) { $this->$varname = array(); } // TODO deprecated
|
if (! isset($this->$varname) || ! is_array($this->$varname)) { $this->$varname = array(); } // TODO deprecated
|
||||||
if (! isset($this->modules_parts[$partname]) || ! is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); }
|
if (! isset($this->modules_parts[$partname]) || ! is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); }
|
||||||
$arrValue = dol_json_decode($value,true);
|
$arrValue = json_decode($value,true);
|
||||||
if (is_array($arrValue) && ! empty($arrValue)) $value = $arrValue;
|
if (is_array($arrValue) && ! empty($arrValue)) $value = $arrValue;
|
||||||
else if (in_array($partname,array('login','menus','substitutions','triggers'))) $value = '/'.$modulename.'/core/'.$partname.'/';
|
else if (in_array($partname,array('login','menus','substitutions','triggers'))) $value = '/'.$modulename.'/core/'.$partname.'/';
|
||||||
else if (in_array($partname,array('models'))) $value = '/'.$modulename.'/';
|
else if (in_array($partname,array('models'))) $value = '/'.$modulename.'/';
|
||||||
|
|||||||
@@ -2791,7 +2791,7 @@ class Form
|
|||||||
|
|
||||||
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
|
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
|
||||||
$this->cache_currencies[$obj->code_iso]['label'] = ($obj->code_iso && $langs->trans("Currency".$obj->code_iso)!="Currency".$obj->code_iso?$langs->trans("Currency".$obj->code_iso):($obj->label!='-'?$obj->label:''));
|
$this->cache_currencies[$obj->code_iso]['label'] = ($obj->code_iso && $langs->trans("Currency".$obj->code_iso)!="Currency".$obj->code_iso?$langs->trans("Currency".$obj->code_iso):($obj->label!='-'?$obj->label:''));
|
||||||
$this->cache_currencies[$obj->code_iso]['unicode'] = (array) dol_json_decode($obj->unicode, true);
|
$this->cache_currencies[$obj->code_iso]['unicode'] = (array) json_decode($obj->unicode, true);
|
||||||
$label[$obj->code_iso] = $this->cache_currencies[$obj->code_iso]['label'];
|
$label[$obj->code_iso] = $this->cache_currencies[$obj->code_iso]['label'];
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,38 +145,6 @@ if (! function_exists('json_decode'))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Function that encodes data in json format.
|
|
||||||
* TODO Remove this function because the json_encode is already redesigned by dolibarr function and
|
|
||||||
* this functions was designed for compatibility between an instable 3.2 version with final 3.2 version. We must
|
|
||||||
* manage compatibility only between 2 stable versions.
|
|
||||||
*
|
|
||||||
* @param mixed $elements PHP object to json encode
|
|
||||||
* @return string Json encoded string
|
|
||||||
*/
|
|
||||||
function dol_json_encode($elements)
|
|
||||||
{
|
|
||||||
return json_encode($elements); // This function is redesigned into functions.lib.php
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function that decodes data from json format
|
|
||||||
* TODO Remove this function because the json_encode is already redesigned by dolibarr function and
|
|
||||||
* this functions was designed for compatibility between an instable 3.2 version with final 3.2 version. We must
|
|
||||||
* manage compatibility only between 2 stable versions.
|
|
||||||
*
|
|
||||||
* @param string $json Json encoded to PHP Object or Array
|
|
||||||
* @param bool $assoc False return an object, true return an array
|
|
||||||
* @return mixed Object or Array
|
|
||||||
*/
|
|
||||||
function dol_json_decode($json, $assoc=false)
|
|
||||||
{
|
|
||||||
$out='';
|
|
||||||
$out = @unserialize($json); // For compatibility, test if serialized
|
|
||||||
if (empty($out)) $out = json_decode($json, $assoc); // This function is redesigned into functions.lib.php
|
|
||||||
return $out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to return value of a static property when class
|
* Function to return value of a static property when class
|
||||||
* name is dynamically defined (not hard coded).
|
* name is dynamically defined (not hard coded).
|
||||||
|
|||||||
@@ -1308,12 +1308,12 @@ abstract class DolibarrModules
|
|||||||
// Can defined other parameters
|
// Can defined other parameters
|
||||||
if (is_array($value['data']) && ! empty($value['data']))
|
if (is_array($value['data']) && ! empty($value['data']))
|
||||||
{
|
{
|
||||||
$newvalue = dol_json_encode($value['data']);
|
$newvalue = json_encode($value['data']);
|
||||||
if (isset($value['entity'])) $entity = $value['entity'];
|
if (isset($value['entity'])) $entity = $value['entity'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$newvalue = dol_json_encode($value);
|
$newvalue = json_encode($value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ class Fichinter extends CommonObject
|
|||||||
$this->note_private = $obj->note_private;
|
$this->note_private = $obj->note_private;
|
||||||
$this->modelpdf = $obj->model_pdf;
|
$this->modelpdf = $obj->model_pdf;
|
||||||
|
|
||||||
$this->extraparams = (array) dol_json_decode($obj->extraparams, true);
|
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
||||||
|
|
||||||
if ($this->statut == 0) $this->brouillon = 1;
|
if ($this->statut == 0) $this->brouillon = 1;
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class CommandeFournisseur extends Commande
|
|||||||
$this->note_public = $obj->note_public;
|
$this->note_public = $obj->note_public;
|
||||||
$this->modelpdf = $obj->model_pdf;
|
$this->modelpdf = $obj->model_pdf;
|
||||||
|
|
||||||
$this->extraparams = (array) dol_json_decode($obj->extraparams, true);
|
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ class FactureFournisseur extends Facture
|
|||||||
$this->model_pdf = $obj->model_pdf;
|
$this->model_pdf = $obj->model_pdf;
|
||||||
$this->import_key = $obj->import_key;
|
$this->import_key = $obj->import_key;
|
||||||
|
|
||||||
$this->extraparams = (array) dol_json_decode($obj->extraparams, true);
|
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
||||||
|
|
||||||
$this->socid = $obj->socid;
|
$this->socid = $obj->socid;
|
||||||
$this->socnom = $obj->socnom;
|
$this->socnom = $obj->socnom;
|
||||||
|
|||||||
Reference in New Issue
Block a user