diff --git a/ChangeLog b/ChangeLog
index 4daaffa5f6029b6dad2c5be6e8fbedfb3c4eb89b..f6f3267d5aa665f83e4aa631da8d885fd49d5a7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,7 +32,7 @@ For developers:
 - New: Add webservice to get or create a product, service.
 - New: Add webservice to get a user.
 - New: Add hooks to change way of showing/editing lines into dictionnaries.
-- New: Add webservice to get or create a prodcut or service.
+- New: Add webservice to get or create a product or service.
 - New: Log module outputs can be setup with "or" rule (not only "xor").
 - New: Add FirePHP output for logging module.
 - New: Add trigger ACTION_DELETE and ACTION_MODIFY
diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php
index feddec8462c8fc44d50b72b8cd9d5846c4d41bf1..cafc98a237371d4eabedeef969fb67dc08d7d1c9 100644
--- a/htdocs/admin/tools/purge.php
+++ b/htdocs/admin/tools/purge.php
@@ -26,6 +26,8 @@ include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
 $langs->load("admin");
 
 $action=GETPOST('action');
+$confirm=GETPOST('confirm');
+$choice=GETPOST('choice');
 
 if (! $user->admin) accessforbidden();
 
@@ -43,11 +45,11 @@ if ($conf->syslog->enabled)
 /*
  *	Actions
  */
-if ($_REQUEST["action"]=='purge' && ! preg_match('/^confirm/i',$_REQUEST["choice"]) && ($_REQUEST["choice"] != 'allfiles' || $_REQUEST["confirm"] == 'yes') )
+if ($action=='purge' && ! preg_match('/^confirm/i',$choice) && ($choice != 'allfiles' || $confirm == 'yes') )
 {
 	$filesarray=array();
 
-	if ($_REQUEST["choice"]=='tempfiles')
+	if ($choice=='tempfiles')
 	{
 		// Delete temporary files
 		if ($dolibarr_main_data_root)
@@ -56,16 +58,16 @@ if ($_REQUEST["action"]=='purge' && ! preg_match('/^confirm/i',$_REQUEST["choice
 		}
 	}
 
-	if ($_REQUEST["choice"]=='allfiles')
+	if ($choice=='allfiles')
 	{
 		// Delete all files
 		if ($dolibarr_main_data_root)
 		{
-			$filesarray=dol_dir_list($dolibarr_main_data_root,"all",0);
+			$filesarray=dol_dir_list($dolibarr_main_data_root,"all",0,'','install\.lock$');
 		}
 	}
 
-	if ($_REQUEST["choice"]=='logfile')
+	if ($choice=='logfile')
 	{
 		$filesarray[]=array('fullname'=>$filelog,'type'=>'file');
 	}
@@ -84,7 +86,7 @@ if ($_REQUEST["action"]=='purge' && ! preg_match('/^confirm/i',$_REQUEST["choice
 			elseif ($filesarray[$key]['type'] == 'file')
 			{
 				// If (file that is not logfile) or (if logfile with option logfile)
-				if ($filesarray[$key]['fullname'] != $filelog || $_POST["choice"]=='logfile')
+				if ($filesarray[$key]['fullname'] != $filelog || $choice=='logfile')
 				{
 					$count+=dol_delete_file($filesarray[$key]['fullname']);
 				}
@@ -92,7 +94,7 @@ if ($_REQUEST["action"]=='purge' && ! preg_match('/^confirm/i',$_REQUEST["choice
 		}
 
 		// Update cachenbofdoc
-		if ($conf->ecm->enabled && $_REQUEST["choice"]=='allfiles')
+		if ($conf->ecm->enabled && $choice=='allfiles')
 		{
 			require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php");
 			$ecmdirstatic = new ECMDirectory($db);
@@ -132,21 +134,21 @@ print '<tr class="border"><td style="padding: 4px">';
 if ($conf->syslog->enabled)
 {
 	print '<input type="radio" name="choice" value="logfile"';
-	print ($_REQUEST["choice"] && $_REQUEST["choice"]=='logfile') ? ' checked="checked"' : '';
+	print ($choice && $choice=='logfile') ? ' checked="checked"' : '';
 	print '> '.$langs->trans("PurgeDeleteLogFile",$filelog).'<br><br>';
 }
 
 print '<input type="radio" name="choice" value="tempfiles"';
-print (! $_REQUEST["choice"] || $_REQUEST["choice"]=='tempfiles' || $_REQUEST["choice"]=='allfiles') ? ' checked="checked"' : '';
+print (! $choice || $choice=='tempfiles' || $choice=='allfiles') ? ' checked="checked"' : '';
 print '> '.$langs->trans("PurgeDeleteTemporaryFiles").'<br><br>';
 
 print '<input type="radio" name="choice" value="confirm_allfiles"';
-print ($_REQUEST["choice"] && $_REQUEST["choice"]=='confirm_allfiles') ? ' checked="checked"' : '';
+print ($choice && $choice=='confirm_allfiles') ? ' checked="checked"' : '';
 print '> '.$langs->trans("PurgeDeleteAllFilesInDocumentsDir",$dolibarr_main_data_root).'<br>';
 
 print '</td></tr></table>';
 
-if ($_REQUEST['choice'] != 'confirm_allfiles')
+if ($choice != 'confirm_allfiles')
 {
 	print '<br>';
 	print '<center><input class="button" type="submit" value="'.$langs->trans("PurgeRunNow").'"></center>';
@@ -161,7 +163,7 @@ if ($message)
 	print "\n";
 }
 
-if (preg_match('/^confirm/i',$_REQUEST["choice"]))
+if (preg_match('/^confirm/i',$choice))
 {
 	print '<br>';
 	$formquestion=array();
diff --git a/htdocs/core/ajax/loadinplace.php b/htdocs/core/ajax/loadinplace.php
index 2d688b7242501ce114b9ab6bb8c56f0070cc5e2f..0b43b1871da372d385ca658e9dad1e4bc5fa5ee5 100644
--- a/htdocs/core/ajax/loadinplace.php
+++ b/htdocs/core/ajax/loadinplace.php
@@ -62,7 +62,8 @@ if((isset($_GET['field']) && ! empty($_GET['field']))
 	
 	if ($element == 'fichinter') $element = 'ficheinter';
 	
-	if ($user->rights->$element->lire || $user->rights->$element->read)
+	if ($user->rights->$element->lire || $user->rights->$element->read
+	|| $user->rights->$element->$subelement->lire || $user->rights->$element->$subelement->read)
 	{
 		if ($type == 'select')
 		{
diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php
index 428e5ace5684896f8b04e946577f1a8def40f878..1ac227482a9e2aa0099088a0959b18b9c2ac3f98 100644
--- a/htdocs/core/ajax/saveinplace.php
+++ b/htdocs/core/ajax/saveinplace.php
@@ -68,7 +68,8 @@ if((isset($_POST['field']) && ! empty($_POST['field']))
 
 	if ($element == 'fichinter') $element = 'ficheinter';
 
-	if ($user->rights->$element->creer || $user->rights->$element->write)
+	if ($user->rights->$element->creer || $user->rights->$element->write
+	|| $user->rights->$element->$subelement->creer || $user->rights->$element->$subelement->write)
 	{
 		// Clean parameters
 		$newvalue = trim($value);
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index d6ac6834b967fe67e2295ea805683360d78f747a..38ef6df39d299a46a9cbd4ddb6b6c34a104d1366 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1356,13 +1356,14 @@ abstract class CommonObject
 	}
 
     /**
-     * 	   Fetch array of objects linked to current object. Links are loaded into this->linked_object array.
+     *	Fetch array of objects linked to current object. Links are loaded into this->linked_object array.
      *
-     *     @param  sourceid
-     *     @param  sourcetype
-     *     @param  targetid
-     *     @param  targettype
-     *     @param  clause			OR, AND
+     *	@param	int		$sourceid		Object source id
+     *	@param  string	$sourcetype		Object source type
+     *	@param  int		$targetid		Object target id
+     *	@param  string	$targettype		Object target type
+     *	@param  string	$clause			OR, AND clause
+     *	@return	void
      */
     function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR')
     {
@@ -1436,27 +1437,27 @@ abstract class CommonObject
                     if ($objecttype == 'facture')			{
                         $classpath = 'compta/facture/class';
                     }
-                    if ($objecttype == 'propal')			{
+                    else if ($objecttype == 'propal')			{
                         $classpath = 'comm/propal/class';
                     }
-                    if ($objecttype == 'shipping')			{
+                    else if ($objecttype == 'shipping')			{
                         $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon';
                     }
-                    if ($objecttype == 'delivery')			{
+                    else if ($objecttype == 'delivery')			{
                         $classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon';
                     }
-                    if ($objecttype == 'invoice_supplier')	{
+                    else if ($objecttype == 'invoice_supplier')	{
                         $classpath = 'fourn/class';
                     }
-                    if ($objecttype == 'order_supplier')	{
+                    else if ($objecttype == 'order_supplier')	{
                         $classpath = 'fourn/class';
                     }
-                    if ($objecttype == 'fichinter')			{
+                    else if ($objecttype == 'fichinter')			{
                         $classpath = 'fichinter/class'; $subelement = 'fichinter'; $module = 'ficheinter';
                     }
 
                     // TODO ajout temporaire - MAXIME MANGIN
-                    if ($objecttype == 'contratabonnement')	{
+                    else if ($objecttype == 'contratabonnement')	{
                         $classpath = 'contrat/class'; $subelement = 'contrat'; $module = 'contratabonnement';
                     }
 
@@ -1464,7 +1465,7 @@ abstract class CommonObject
                     if ($objecttype == 'invoice_supplier') {
                         $classfile = 'fournisseur.facture'; $classname = 'FactureFournisseur';
                     }
-                    if ($objecttype == 'order_supplier')   {
+                    else if ($objecttype == 'order_supplier')   {
                         $classfile = 'fournisseur.commande'; $classname = 'CommandeFournisseur';
                     }
 
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 4b26d3a4c2e7e786e29b51e08a43b2f16b6e933d..3ad8972b97ed5431731ee857c98ac6b14a95c7dd 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -60,9 +60,9 @@ class Form
 	 *
 	 *  @param		DoliDB		$DB      Database handler
      */
-    function Form($DB)
+    public function __construct($db)
     {
-        $this->db = $DB;
+        $this->db = $db;
     }
 
     /**
@@ -257,7 +257,9 @@ class Form
     		{
     		    $tmp=explode(':',$inputType);
     		    $inputType=$tmp[0]; $toolbar=$tmp[1];
-    		    if (! empty($tmp[2])) $savemethod=$tmp[2];
+    		    if (! empty($tmp[2])) $width=$tmp[2];
+    		    if (! empty($tmp[3])) $heigth=$tmp[3];
+    		    if (! empty($tmp[4])) $savemethod=$tmp[4];
     		    
     			if (! empty($conf->fckeditor->enabled))
     			{
diff --git a/htdocs/langs/ca_ES/agenda.lang b/htdocs/langs/ca_ES/agenda.lang
index eeac0c46995cf98345f5cb732c31a5ae3f45e810..5de2bcd4a095b13818ef3a06cde84d2f532325c1 100644
--- a/htdocs/langs/ca_ES/agenda.lang
+++ b/htdocs/langs/ca_ES/agenda.lang
@@ -37,6 +37,7 @@ PropalValidatedInDolibarr=Pressupost %s validat
 InvoiceValidatedInDolibarr=Factura %s validada
 InvoiceBackToDraftInDolibarr=Factura %s tornada a borrador
 OrderValidatedInDolibarr=Comanda %s validada
+OrderApprovedInDolibarr=Comanda %s aprovada
 InterventionValidatedInDolibarr=Intervenció %s validada
 ProposalSentByEMail=Pressupost %s enviat per e-mail
 OrderSentByEMail=Comanda de client %s enviada per e-mail
diff --git a/htdocs/langs/ca_ES/other.lang b/htdocs/langs/ca_ES/other.lang
index 68d4a112d9787437ba47e643b96345d4aee68e22..563a7b5ada04c0ecd7655b21e1c4e3812b80a900 100644
--- a/htdocs/langs/ca_ES/other.lang
+++ b/htdocs/langs/ca_ES/other.lang
@@ -206,7 +206,8 @@ SupplierPaymentDoneInDolibarr=Pagament a proveïdor %s en Dolibarr
 MemberValidatedInDolibarr=Membre %s validat en Dolibarr
 MemberResiliatedInDolibarr=Membre %s donat de baixa en Dolibarr
 MemberDeletedInDolibarr=Membre %s eliminat de Dolibarr
-MemberSubscriptionAddedInDolibarr=Subscripció del membre %s afegida a Dolibar
+MemberSubscriptionAddedInDolibarr=Subscripció del membre %s afegida a Dolibarr
+ShipmentValidatedInDolibarr=Expedició %s validada en Dolibarr
 ##### Export #####
 Export=Exportació
 ExportsArea=Àrea d'exportacions
diff --git a/htdocs/langs/ca_ES/stocks.lang b/htdocs/langs/ca_ES/stocks.lang
index 42be80e3166f27f86a95124572e53bf3e0602146..8fc10594b4c775106ec1611e37586b0aca2ffcb0 100644
--- a/htdocs/langs/ca_ES/stocks.lang
+++ b/htdocs/langs/ca_ES/stocks.lang
@@ -3,6 +3,7 @@ CHARSET=UTF-8
 WarehouseCard=Fitxa magatzem
 Warehouse=Magatzem
 NewWarehouse=Nou magatzem o zona d'emmagatzematge
+WarehouseEdit=Edició magatzem
 MenuNewWarehouse=Nou magatzem
 WarehouseOpened=Magatzem obert
 WarehouseClosed=Magatzem tancat
@@ -77,4 +78,6 @@ EstimatedStockValue=Valor de compra (PMP)
 DeleteAWarehouse=Eliminar un magatzem
 ConfirmDeleteWarehouse=Esteu segur que voleu eliminar el magatzem <b>%s</b> ?
 PersonalStock=Stoc personal %s
-ThisWarehouseIsPersonalStock=Aquest magatzem representa l'estoc personal de %s %s
\ No newline at end of file
+ThisWarehouseIsPersonalStock=Aquest magatzem representa l'estoc personal de %s %s
+SelectWarehouseForStockDecrease=Seleccioneu el magatzem a usar en el decrement d'estoc
+SelectWarehouseForStockIncrease=Seleccioneu el magatzem a utilitzar en l'increment d'estoc
\ No newline at end of file
diff --git a/htdocs/langs/es_ES/agenda.lang b/htdocs/langs/es_ES/agenda.lang
index d4fe8fb776c7de29de9e58d491eec83a477926f7..0c3a662260d247adc8c8ad8c8557171670927264 100644
--- a/htdocs/langs/es_ES/agenda.lang
+++ b/htdocs/langs/es_ES/agenda.lang
@@ -9,8 +9,8 @@ Calendars=Calendarios
 AffectedTo=Asignada a
 DoneBy=Realizado por
 Events=Eventos
-EventOnFullDay=Evento para todo el día
 ListOfActions=Listado de eventos
+EventOnFullDay=Evento para todo el día
 Location=Localización
 SearchAnAction=Buscar un evento/tarea
 MenuToDoActions=Eventos incompletos
@@ -37,6 +37,7 @@ PropalValidatedInDolibarr=Presupuesto %s validado
 InvoiceValidatedInDolibarr=Factura %s validada
 InvoiceBackToDraftInDolibarr=Factura %s devuelta a borrador
 OrderValidatedInDolibarr=Pedido %s validado
+OrderApprovedInDolibarr=Pedido %s aprobado
 InterventionValidatedInDolibarr=Intervención %s validada
 ProposalSentByEMail=Presupuesto %s enviado por e-mail
 OrderSentByEMail=Pedido de cliente %s enviado por e-mail
@@ -59,11 +60,10 @@ AgendaUrlOptions4=<b>logint=%s</b> para restringir inserciones a acciones que af
 AgendaUrlOptions5=<b>logind=%s</b> para restringir inserciones a acciones realizadas por el usuario <b>%s</b>.
 AgendaShowBirthdayEvents=Mostrar cumpleaños de los contactos
 AgendaHideBirthdayEvents=Ocultar cumpleaños de los contactos
-
-# External Sites ical
 ExtSites=Calendarios externos
+# External Sites ical=undefined
 ExtSitesEnableThisTool=Mostrar calendarios externos en la agenda
 ExtSitesNbOfAgenda=Número de calendarios
 AgendaExtNb=Calendario nº %s
 ExtSiteUrlAgenda=Url de acceso al archivo .ical
-ExtSiteNoLabel=Sin descripción
\ No newline at end of file
+ExtSiteNoLabel=Sin descripción
diff --git a/htdocs/langs/es_ES/other.lang b/htdocs/langs/es_ES/other.lang
index b05a106d9405467ed075f3e35387be3f520341c3..a2a34f7ff252e9b90dbc7ef7d688611ae7105de7 100644
--- a/htdocs/langs/es_ES/other.lang
+++ b/htdocs/langs/es_ES/other.lang
@@ -1,4 +1,4 @@
-# Dolibarr language file - es_ES - other 
+# Dolibarr language file - es_ES - other
 CHARSET=UTF-8
 SecurityCode=Código seguridad
 Calendar=Calendario
@@ -45,7 +45,6 @@ AttachANewFile=Adjuntar nuevo archivo/documento
 LinkedObject=Objeto adjuntado
 Miscellanous=Diversos
 NbOfActiveNotifications=Número notificaciones
-
 PredefinedMailTest=Esto es un correo de prueba.\nLas 2 líneas están separadas por un retorno de carro a la línea.
 PredefinedMailTestHtml=Esto es un e-mail de <b>prueba</b>(la palabra prueba debe de estar en negrita).<br>Las 2 líneas están separadas por un retorno de carro en la línea
 PredefinedMailContentSendInvoice=Le adjuntamos la factura __FACREF__\n\nCordialmente\n\n
@@ -184,11 +183,6 @@ UseAnExternalHttpLinkOrRelativeDolibarrLink=Indicar un URL http externo o un URL
 ChooseIfANewWindowMustBeOpenedOnClickOnBookmark=Elegir si debe abrirse la página en una nueva ventana o en la actual
 BookmarksManagement=Gestión de marcadores
 ListOfBookmarks=Listado de marcadores
-##### Webcal #####
-LoginWebcal=Login Webcalendar
-ErrorWebcalLoginNotDefined=El login Webcalendar asociado a su usuario Dolibarr <b>%s</b> no está definido
-##### Phenix #####
-ErrorPhenixLoginNotDefined=El login Phenix asociado a su cuenta Dolibarr <b>%s</b>  no está definido
 ##### Calendar common #####
 AddCalendarEntry=Añadir entrada en el calendario
 NewCompanyToDolibarr=Empresa %s insertada en Dolibarr
@@ -208,6 +202,7 @@ MemberValidatedInDolibarr=Miembro %s validado en Dolibarr
 MemberResiliatedInDolibarr=Miembro %s dado de baja en Dolibarr
 MemberDeletedInDolibarr=Miembro %s eliminado de Dolibarr
 MemberSubscriptionAddedInDolibarr=Subscripción del miembro % añadida en Dolibarr
+ShipmentValidatedInDolibarr=Expedición %s validada en Dolibarr
 ##### Export #####
 Export=Exportación
 ExportsArea=Área de exportaciones
diff --git a/htdocs/langs/es_ES/stocks.lang b/htdocs/langs/es_ES/stocks.lang
index 27d6b57d100e7a3e166d5a3d1b403e4794fd3974..fda765494178afb9277e3d1554fddda8c9ad13b7 100644
--- a/htdocs/langs/es_ES/stocks.lang
+++ b/htdocs/langs/es_ES/stocks.lang
@@ -3,6 +3,7 @@ CHARSET=UTF-8
 WarehouseCard=Ficha almacén
 Warehouse=Almacén
 NewWarehouse=Nuevo almacén o zona de almacenaje
+WarehouseEdit=Edición almacén
 MenuNewWarehouse=Nuevo almacén
 WarehouseOpened=almacén abierto
 WarehouseClosed=almacén cerrado
@@ -77,4 +78,6 @@ EstimatedStockValue=Valor de compra (PMP)
 DeleteAWarehouse=Eliminar un almacén
 ConfirmDeleteWarehouse=¿Está seguro de querer eliminar el almacén <b>%s</b>?
 PersonalStock=Stock personal %s
-ThisWarehouseIsPersonalStock=Este almacén representa el stock personal de %s %s
\ No newline at end of file
+ThisWarehouseIsPersonalStock=Este almacén representa el stock personal de %s %s
+SelectWarehouseForStockDecrease=Seleccione el almacén a usar en el decremento de stock
+SelectWarehouseForStockIncrease=Seleccione el almacén a usar en el incremento de stock