diff --git a/ChangeLog b/ChangeLog
index c5aeb5874b39e26858b487598aadb93c4e48c9a3..5182a84cd333cdb5eedfbc6def3f32572a5f9171 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -163,18 +163,20 @@ Dolibarr better:
 
 
 ***** ChangeLog for 3.6.2 compared to 3.6.1 *****
-- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice
-- Fix: bug 1588 : relative discount
+- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
+- Fix: bug 1588 : relative discount.
 - Fix: label of input method not tranlated.
 - Fix: box of customer and propsects were not correctly disabled.
-- Fix: right and error management #1961
-- Fix: Fix Error when trying to clone an Order #1943
 - Fix: [ bug #1618 ] PHP Error thrown when saving a barcode
+- Fix: Civility & birthdate wasn't save into adherent module.
+- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref
+- Fix: Chars - is no more allowed into value for code for extra fields.
+( Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache
 
 ***** ChangeLog for 3.6.1 compared to 3.6.* *****
 For users:
 - Fix: Can upload files on services.
-- Fix: sql errors on updat fichinter.
+- Fix: sql errors on update fichinter.
 - Fix: debian script syntax error.
 - Fix: error "menu param is not inside list" into pos module.
 - Fix: Salary payments are not reflected on the reporting sheets.
@@ -310,6 +312,9 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
 - Remove add_photo_web() that is ot used anymore by core code.
 
 
+***** ChangeLog for 3.5.6 compared to 3.5.5 *****
+Fix: Avoid missing class error for fetch_thirdparty method #1973
+
 ***** ChangeLog for 3.5.5 compared to 3.5.4 *****
 Fix: Holiday module was broken. Initializaion of amount of holidays failed.
 Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php
index b2f839e3c3cf220a61685bc0d22002a181285d18..627d96acf179f6334eb7e090114824962b9efb5c 100644
--- a/htdocs/adherents/admin/adherent_type_extrafields.php
+++ b/htdocs/adherents/admin/adherent_type_extrafields.php
@@ -7,7 +7,7 @@
  *
  * 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
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -17,6 +17,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * or see http://www.gnu.org/
  */
 
 /**
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index ca7706989e01383b2cfee8369825c259d335ce7e..102f45496c6f18200163014fc7e1b73677fff9e5 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -723,7 +723,7 @@ else
 	{
 		/* ************************************************************************** */
 		/*                                                                            */
-		/* Fiche creation                                                             */
+		/* Creation card                                                             */
 		/*                                                                            */
 		/* ************************************************************************** */
 		$object->canvas=$canvas;
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index a057e7cba936fca59fc1be97815c0a6b01b63204..cdbfabf45768a92c952b92fdd592816a703f2339 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -5,6 +5,7 @@
  * Copyright (C) 2004		Sebastien Di Cintio		<sdicintio@ressource-toi.org>
  * Copyright (C) 2004		Benoit Mortier			<benoit.mortier@opensides.be>
  * Copyright (C) 2009-2012	Regis Houssin			<regis.houssin@capnetworks.com>
+ * Copyright (C) 2014		Alexandre Spangaro		<alexandre.spangaro@gmail.com>
  *
  * 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
@@ -124,7 +125,7 @@ class Adherent extends CommonObject
 
 
     /**
-     *  Fonction envoyant un email a l'adherent avec le texte fourni en parametre.
+     *  Function sending an email has the adherent with the text supplied in parameter.
      *
      *  @param	string	$text				Content of message (not html entities encoded)
      *  @param	string	$subject			Subject of message
@@ -247,9 +248,9 @@ class Adherent extends CommonObject
 
 
     /**
-     *	Renvoie le libelle traduit de la nature d'un adherent (physique ou morale)
+     *	Return translated label by the nature of a adherent (physical or moral)
      *
-     *	@param	string		$morphy		Nature physique ou morale de l'adherent
+     *	@param	string		$morphy		Nature of the adherent (physical or moral)
      *	@return	string					Label
      */
     function getmorphylib($morphy='')
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index ad9149d48b004dc57deba3b7a51040e7b28c3676..a9c39fa790f32766143ef1d876c90d16625f5d9a 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -609,6 +609,8 @@ abstract class CommonObject
 
         if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty)) return 0;
 
+	    require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
+
         $thirdparty = new Societe($this->db);
         $result=$thirdparty->fetch(isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty));
         $this->client = $thirdparty;  // deprecated
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index db24d257aeefb7c4029f23fea1cd7c8112519f60..94898ec54529c910a2d76f1e043b8f4df704d126 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -157,7 +157,7 @@ class ExtraFields
 	{
 		$table=$elementtype.'_extrafields';
 
-		if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname))
+		if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9_]*$/",$attrname) && ! is_numeric($attrname))
 		{
 			if ($type=='boolean') {
 				$typedb='int';
@@ -752,15 +752,17 @@ class ExtraFields
 					if (strpos($InfoFieldList[4], 'extra')!==false)
 					{
 						$sql.= ' as main, '.MAIN_DB_PREFIX .$InfoFieldList[0].'_extrafields as extra';
-						$sqlwhere.= ' AND extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4];
+						$sqlwhere.= ' WHERE extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4];
 					}
 					else
 					{
-						$sqlwhere.= ' AND '.$InfoFieldList[4];
+						$sqlwhere.= ' WHERE '.$InfoFieldList[4];
 					}
+				}else {
+					$sqlwhere.= ' WHERE 1';
 				}
 				if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity;	// Some tables may have field, some other not. For the moment we disable it.
-				$sql.=preg_replace('/^ AND /','',$sqlwhere);
+				//$sql.=preg_replace('/^ AND /','',$sqlwhere);
 				//print $sql;
 
 				dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
@@ -988,7 +990,10 @@ class ExtraFields
 				{
 					foreach ($fields_label as $field_toshow)
 					{
-						$translabel=$langs->trans($obj->$field_toshow);
+						$translabel='';
+						if (!empty($obj->$field_toshow)) {
+							$translabel=$langs->trans($obj->$field_toshow);
+						}
 						if ($translabel!=$field_toshow) {
 							$value.=dol_trunc($translabel,18).' ';
 						}else {
@@ -998,7 +1003,10 @@ class ExtraFields
 				}
 				else
 				{
-					$translabel=$langs->trans($obj->$InfoFieldList[1]);
+					$translabel='';
+					if (!empty($obj->$InfoFieldList[1])) {
+						$translabel=$langs->trans($obj->$InfoFieldList[1]);
+					}
 					if ($translabel!=$obj->$InfoFieldList[1]) {
 						$value=dol_trunc($translabel,18);
 					}else {
diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php
index bce8d9f041e7e1c9f06203cafaf2417fd83eba18..4de88a7bfc9feb4b1e9111713366cc6aafdedbb6 100644
--- a/htdocs/core/class/html.formcron.class.php
+++ b/htdocs/core/class/html.formcron.class.php
@@ -4,7 +4,7 @@
  *
  * 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
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -14,6 +14,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * or see http://www.gnu.org/
  */
 
 /**
diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php
index ccc115b5b1d327066a9f7451e6d4e90770c7a17f..866cf004ca64a3840d0a4d696986d1b7953aa239 100644
--- a/htdocs/core/lib/invoice2.lib.php
+++ b/htdocs/core/lib/invoice2.lib.php
@@ -2,19 +2,20 @@
 /*
  * Copyright (C) 2009-2013 Laurent Destailleur  <eldy@users.sourceforge.net>
 *
-* 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
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * or see http://www.gnu.org/
+ */
 
 /**
  *      \file       htdocs/core/lib/invoice2.lib.php
diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php
index 38996c7e6f0b3bba451e7c322c3ed34e306fe7d3..464a01120ecdef4b135d91c62f860dc384467f9d 100644
--- a/htdocs/core/modules/action/rapport.pdf.php
+++ b/htdocs/core/modules/action/rapport.pdf.php
@@ -210,6 +210,7 @@ class CommActionRapport
 		$sql.= " WHERE c.id=a.fk_action AND a.fk_user_author = u.rowid";
 		$sql.= " AND a.datep BETWEEN '".$this->db->idate(dol_get_first_day($this->year,$this->month,false))."'";
 		$sql.= " AND '".$this->db->idate(dol_get_last_day($this->year,$this->month,false))."'";
+		$sql.= " AND a.entity = ".$conf->entity;
 		$sql.= " ORDER BY a.datep DESC";
 
 		$eventstatic=new ActionComm($this->db);
diff --git a/htdocs/install/mssql/functions/functions.sql b/htdocs/install/mssql/functions/functions.sql
index 93766a224064a3dc68cab3dc0878f1477af69f1d..1c2c76996dc312cc2440a2329d46530adb815d7c 100644
Binary files a/htdocs/install/mssql/functions/functions.sql and b/htdocs/install/mssql/functions/functions.sql differ
diff --git a/htdocs/langs/en_US/resource.lang b/htdocs/langs/en_US/resource.lang
index fbc55081185016d1b96d2a297f26d28953c3b828..e0a767cc58adaede1dbc5c7ec0983fb83872006f 100755
--- a/htdocs/langs/en_US/resource.lang
+++ b/htdocs/langs/en_US/resource.lang
@@ -32,4 +32,6 @@ ResourceLinkedWithSuccess=Resource linked with success
 TitleResourceCard=Resource card
 ConfirmDeleteResource=Confirm to delete this resource
 RessourceSuccessfullyDeleted=Resource successfully deleted
-DictionaryResourceType=Type of resources
\ No newline at end of file
+DictionaryResourceType=Type of resources
+
+SelectResource=Select resource
diff --git a/htdocs/langs/fr_FR/resource.lang b/htdocs/langs/fr_FR/resource.lang
index e4c8a6ade874b620dc2be4451e005ceb2e89ce0a..5059d628092327031428e7562579572337c067a6 100755
--- a/htdocs/langs/fr_FR/resource.lang
+++ b/htdocs/langs/fr_FR/resource.lang
@@ -32,4 +32,6 @@ ResourceLinkedWithSuccess=Ressource liée avec succès
 TitleResourceCard=Fiche ressource
 ConfirmDeleteResource=Confirmer la suppression de cette ressource?
 RessourceSuccessfullyDeleted=Ressource effacée avec succès
-DictionaryResourceType=Type de ressources
\ No newline at end of file
+DictionaryResourceType=Type de ressources
+
+SelectResource=Sélectionner la ressource
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 7730abb77cc79830ca6cb79159f5bf963f48b80b..e3e6373962b0122c1e8f4049e5c65a2ab9c2a49c 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -770,7 +770,7 @@ class Task extends CommonObject
         if ($this->db->query($sql) )
         {
             $tasktime_id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task_time");
-            $ret = $tasktme_id;
+            $ret = $tasktime_id;
 
             if (! $notrigger)
             {
@@ -801,10 +801,7 @@ class Task extends CommonObject
                 $this->db->rollback();
                 $ret = -2;
             }
-        }
-
-		if ($ret >= 0)
-        {
+        
             $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time";
             $sql.= " SET thm = (SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->timespent_fk_user.")";
             $sql.= " WHERE rowid = ".$tasktime_id;
diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php
index 241d440cc0f64b4a0955c890bde7f8216ae0231c..ca01963e30bb3a3a9b53ed279b06475d934a9153 100644
--- a/htdocs/resource/class/html.formresource.class.php
+++ b/htdocs/resource/class/html.formresource.class.php
@@ -1,19 +1,20 @@
 <?php
 /* Copyright (C) - 2013	Jean-François FERRY	<jfefe@aternatik.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
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * or see http://www.gnu.org/
+ */
 
 /**
  *       \file       place/class/html.place.class.php
diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php
index e947b4e7ed9d63e58a73bdc848fc7c4a8db6329e..19768f569e39f56309be20bbff766b07cea82cfb 100644
--- a/htdocs/resource/class/resource.class.php
+++ b/htdocs/resource/class/resource.class.php
@@ -23,8 +23,8 @@
  */
 
 // Put here all includes required by your class file
-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."/core/lib/functions2.lib.php";
 
 /**
  *	DAO Resource object
@@ -329,7 +329,7 @@ class Resource extends CommonObject
     function delete($rowid, $notrigger=0)
     {
         global $user,$langs,$conf;
-    
+
         $error=0;
 
         if (! $notrigger)
@@ -339,10 +339,10 @@ class Resource extends CommonObject
             if ($result < 0) return -1;
             // End call triggers
         }
-        
+
         $sql = "DELETE FROM ".MAIN_DB_PREFIX."resource";
         $sql.= " WHERE rowid =".$rowid;
-    
+
         dol_syslog(get_class($this)."::delete", LOG_DEBUG);
         if ($this->db->query($sql))
         {
@@ -364,7 +364,7 @@ class Resource extends CommonObject
             return -1;
         }
     }
-    
+
     /**
      *	Load resource objects into $this->lines
      *
@@ -500,9 +500,9 @@ class Resource extends CommonObject
    					$line->fk_user_create	=	$obj->fk_user_create;
 
 					if($obj->resource_id && $obj->resource_type)
-						$line->objresource = $this->fetchObjectByElement($obj->resource_id,$obj->resource_type);
+						$line->objresource = fetchObjectByElement($obj->resource_id,$obj->resource_type);
 					if($obj->element_id && $obj->element_type)
-						$line->objelement = $this->fetchObjectByElement($obj->element_id,$obj->element_type);
+						$line->objelement = fetchObjectByElement($obj->element_id,$obj->element_type);
         			$this->lines[$i] = $line;
 
    					$i++;
@@ -584,7 +584,7 @@ class Resource extends CommonObject
     				$line->mandatory		=	$obj->mandatory;
     				$line->fk_user_create	=	$obj->fk_user_create;
 
-    				$this->lines[$i] = $this->fetchObjectByElement($obj->resource_id,$obj->resource_type);
+    				$this->lines[$i] = fetchObjectByElement($obj->resource_id,$obj->resource_type);
 
     				$i++;
     			}
@@ -732,7 +732,7 @@ class Resource extends CommonObject
 			{
                 // Call trigger
                 $result=$this->call_trigger('RESOURCE_MODIFY',$user);
-                if ($result < 0) $error++;          
+                if ($result < 0) $error++;
                 // End call triggers
 	    	}
 		}
@@ -802,7 +802,7 @@ class Resource extends CommonObject
     	$i=0;
     	foreach($resources as $nb => $resource)
     	{
-    		$this->lines[$i] = $this->fetchObjectByElement($resource['resource_id'],$resource['resource_type']);
+    		$this->lines[$i] = fetchObjectByElement($resource['resource_id'],$resource['resource_type']);
     		$i++;
     	}
     	return $i;
diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php
index 2d104eb96a1f01d78aeb61e1233f5fd3fb8b9586..696723f7247196a0e946c638b3f786836f83d6af 100644
--- a/htdocs/webservices/server_thirdparty.php
+++ b/htdocs/webservices/server_thirdparty.php
@@ -460,7 +460,7 @@ function createThirdParty($authentication,$thirdparty)
         $result=$newobject->create($fuser);
         if ($newobject->particulier && $result > 0) {
             $newobject->firstname = $thirdparty['firstname'];
-            $newobject->name_bis = $thirdparty['ref'];
+            $newobject->name_bis = $thirdparty['lastname'];
             $result = $newobject->create_individual($fuser);
         }
         if ($result <= 0)