From 87fc27c7e649566ebb467dc32af7b65ee623f292 Mon Sep 17 00:00:00 2001 From: jfefe Date: Mon, 6 Oct 2014 13:31:01 +0200 Subject: [PATCH 1/9] Avoid missing class error for fetch_thirdparty method --- htdocs/core/class/commonobject.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6439e3e003e..7c803a0b8a9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -576,6 +576,9 @@ abstract class CommonObject if (empty($this->socid)) return 0; + if (!class_exists('Societe')) + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + $thirdparty = new Societe($this->db); $result=$thirdparty->fetch($this->socid); $this->client = $thirdparty; // deprecated From 6a4468d94ea397695033249d40e73095970fd247 Mon Sep 17 00:00:00 2001 From: jfefe Date: Mon, 6 Oct 2014 14:18:28 +0200 Subject: [PATCH 2/9] Not need to test if class exists with require_once --- htdocs/core/class/commonobject.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7c803a0b8a9..3ef8241f83f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -576,8 +576,7 @@ abstract class CommonObject if (empty($this->socid)) return 0; - if (!class_exists('Societe')) - require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $thirdparty = new Societe($this->db); $result=$thirdparty->fetch($this->socid); From 7ed496d7d9e64664fa502dfa8bd6072599665702 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 12 Nov 2014 17:51:26 +0100 Subject: [PATCH 3/9] FIX: copy extrafields when creating order from propale and creating invoice from order --- htdocs/commande/class/commande.class.php | 12 +++++++++++- htdocs/compta/facture/class/facture.class.php | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 7a8fd63c8f1..d1a776d3d24 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -972,7 +972,12 @@ class Commande extends CommonOrder $line->marge_tx = $marginInfos[1]; $line->marque_tx = $marginInfos[2]; - $this->lines[$i] = $line; + // get extrafields from original line + $object->lines[$i]->fetch_optionals($object->lines[$i]->rowid); + foreach($object->lines[$i]->array_options as $options_key => $value) + $line->array_options[$options_key] = $value; + + $this->lines[$i] = $line; } $this->socid = $object->socid; @@ -991,6 +996,11 @@ class Commande extends CommonOrder $this->origin = $object->element; $this->origin_id = $object->id; + // get extrafields from original line + $object->fetch_optionals($object->id); + foreach($object->array_options as $options_key => $value) + $this->array_options[$options_key] = $value; + // Possibility to add external linked objects with hooks $this->linked_objects[$this->origin] = $this->origin_id; if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects)) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 93e245746a0..0d91d7944b8 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -701,6 +701,11 @@ class Facture extends CommonInvoice $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); $line->pa_ht = $marginInfos[0]; + // get extrafields from original line + $object->lines[$i]->fetch_optionals($object->lines[$i]->rowid); + foreach($object->lines[$i]->array_options as $options_key => $value) + $line->array_options[$options_key] = $value; + $this->lines[$i] = $line; } @@ -720,6 +725,11 @@ class Facture extends CommonInvoice $this->origin = $object->element; $this->origin_id = $object->id; + // get extrafields from original line + $object->fetch_optionals($object->id); + foreach($object->array_options as $options_key => $value) + $this->array_options[$options_key] = $value; + // Possibility to add external linked objects with hooks $this->linked_objects[$this->origin] = $this->origin_id; if (! empty($object->other_linked_objects) && is_array($object->other_linked_objects)) From c0a3606a595fa21a015ef262ce98fd0e32453412 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 12 Nov 2014 22:53:23 +0100 Subject: [PATCH 4/9] Fix problem on task creation with chrome for french browser. --- htdocs/core/lib/functions.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e238b1e5834..d679882161f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1053,7 +1053,11 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) $default_timezone=@date_default_timezone_get(); } } - else $localtz = new DateTimeZone('UTC'); + + if (empty($localtz)) { + $localtz = new DateTimeZone('UTC'); + } + $dt = new DateTime(null,$localtz); $dt->setDate($year,$month,$day); $dt->setTime((int) $hour, (int) $minute, (int) $second); From 00c6033e11b35d5f004fddacd82f3f3464d1ea9e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 14 Nov 2014 13:28:49 +0100 Subject: [PATCH 5/9] Fix display user signature when WYSIWYG is enabled --- htdocs/user/fiche.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index a0523bcbc28..9b1845d6bff 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -1208,7 +1208,11 @@ else // Signature print ''.$langs->trans('Signature').''; - print dol_htmlentitiesbr($object->signature); + if (empty($conf->global->FCKEDITOR_ENABLE_USERSIGN)) { + print dol_htmlentitiesbr($object->signature); + } else { + print $object->signature; + } print "\n"; // Hierarchy From 01279edfc82213a4b875d709c5e452a44bfc791f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Nov 2014 16:36:32 +0100 Subject: [PATCH 6/9] Fixed: [ bug #1570 ] Negative supplier invoices do not appear in bank planned transactions. --- htdocs/compta/bank/treso.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index f6c59530605..b9274c34eb5 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -164,7 +164,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $sql.= " ORDER BY dlr ASC"; // Supplier invoices - $sql2= " SELECT 'invoice_supplier' as family, ff.rowid as objid, ff.ref_supplier as ref, (-1*ff.total_ttc) as total_ttc, ff.type, ff.date_lim_reglement as dlr,"; + $sql2= " SELECT 'invoice_supplier' as family, ff.rowid as objid, ff.ref as ref, ff.ref_supplier as ref_supplier, (-1*ff.total_ttc) as total_ttc, ff.type, ff.date_lim_reglement as dlr,"; $sql2.= " s.rowid as socid, s.nom, s.fournisseur"; $sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON ff.fk_soc = s.rowid"; @@ -260,12 +260,13 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) if ($obj->family == 'invoice_supplier') { - // TODO This code is to avoid to count suppliers credit note (ff.type = 2) - // Ajouter gestion des avoirs fournisseurs, champ - if (($obj->total_ttc < 0 && $obj->type != 2) - || ($obj->total_ttc > 0 && $obj->type == 2)) + $showline=1; + // Uncomment this line to avoid to count suppliers credit note (ff.type = 2) + //$showline=(($obj->total_ttc < 0 && $obj->type != 2) || ($obj->total_ttc > 0 && $obj->type == 2)) + if ($showline) { - $facturefournstatic->ref=$obj->ref; + $ref=$obj->ref; + $facturefournstatic->ref=$ref; $facturefournstatic->id=$obj->objid; $facturefournstatic->type=$obj->type; $ref = $facturefournstatic->getNomUrl(1,''); @@ -304,7 +305,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) if ($paiement) $total_ttc = $obj->total_ttc - $paiement; $solde += $total_ttc; - // We discard with a remain to pay to 0 + // We discard lines with a remainder to pay to 0 if (price2num($total_ttc) != 0) { $var=!$var; From d0dc792b3cd829c6ef86fa555f880ed8400d3deb Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 17 Nov 2014 11:17:45 +0100 Subject: [PATCH 7/9] check extrafields before inserting in DB --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e363eda6e4a..5af3f5a93c3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2195,7 +2195,7 @@ abstract class CommonObject { $attributeKey = substr($key,8); // Remove 'options_' prefix // Add field of attribut - if ($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate + if (isset($extrafields->attribute_type[$attributeKey]) && $extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate $sql.=",".$attributeKey; } $sql .= ") VALUES (".$this->id; @@ -2203,7 +2203,7 @@ abstract class CommonObject { $attributeKey = substr($key,8); // Remove 'options_' prefix // Add field o fattribut - if($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate) + if(isset($extrafields->attribute_type[$attributeKey]) && $extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate) { if ($this->array_options[$key] != '') { From 1b24356e0f9b7b4cfd8a19464096c788d2cc2560 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Nov 2014 17:13:08 +0100 Subject: [PATCH 8/9] ssl option is set to CURL_SSLVERSION_TLSv1. Some site disabled ssl v1 to 3 (ex: paypal). --- htdocs/paypal/lib/paypal.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 02a16c68b1f..7b161ac30be 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -683,7 +683,8 @@ function hash_call($methodName,$nvpStr) exit;*/ curl_setopt($ch, CURLOPT_URL, $API_Endpoint); curl_setopt($ch, CURLOPT_VERBOSE, 1); - curl_setopt($ch, CURLOPT_SSLVERSION, 3); // Force SSLv3 + //curl_setopt($ch, CURLOPT_SSLVERSION, 3); // Force SSLv3 + curl_setopt($ch, CURLOPT_SSLVERSION, 1); // Force TLSv1 //turning off the server and peer verification(TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); From 3dacdf4e4a5ff54dc7a57a262d95465fc4580569 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 19 Nov 2014 09:41:21 +0100 Subject: [PATCH 9/9] Fix: Conflicts and remove duplicate code --- htdocs/core/class/commonobject.class.php | 4 +--- htdocs/product/class/product.class.php | 8 +------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b5aac7adc74..72eeba4d59f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2011-2014 Philippe Grand * Copyright (C) 2012 Marcos García @@ -611,8 +611,6 @@ abstract class CommonObject require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - $thirdparty = new Societe($this->db); $result=$thirdparty->fetch(isset($this->socid)?$this->socid:$this->fk_soc); $this->client = $thirdparty; // deprecated diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1faa192bd0d..2987d0de8fd 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4,16 +4,10 @@ * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2007-2011 Jean Heimburger -<<<<<<< HEAD * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2013-2014 Cedric GROSS - * Copyright (C) 2013 Marcos García - * Copyright (C) 2011-2014 Alexandre Spangaro -======= - * Copyright (C) 2010-2011 Juanjo Menent - * Copyright (C) 2013 Cedric GROSS * Copyright (C) 2013-2014 Marcos García ->>>>>>> refs/remotes/origin/3.5 + * Copyright (C) 2011-2014 Alexandre Spangaro * * 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