diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index f6d5677af16..001a4972dd7 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -992,7 +992,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; @@ -1011,6 +1016,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/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; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 6e4fbc03c66..6def5560deb 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -725,6 +725,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; } @@ -744,6 +749,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)) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 78ee9ad32f8..4a21bfe3cda 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 @@ -2237,7 +2237,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; @@ -2245,7 +2245,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] != '') { 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); 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); 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 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