diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 25316a6a6fc870e2f686b99e99fd80d23097ab24..d48e8041c1ed016fbe1531d7630ace54d24b5bf4 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -24,7 +24,7 @@
  *  \file       htdocs/commande/class/commande.class.php
  *  \ingroup    commande
  *  \brief      Fichier des classes de commandes
- *  \version    $Id: commande.class.php,v 1.123 2011/08/10 22:47:33 eldy Exp $
+ *  \version    $Id: commande.class.php,v 1.124 2011/08/11 07:41:41 hregis Exp $
  */
 require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
 require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
@@ -899,7 +899,7 @@ class Commande extends CommonObject
 			$this->cond_reglement_id    = $object->cond_reglement_id;
 			$this->mode_reglement_id    = $object->mode_reglement_id;
 			$this->availability_id      = $object->availability_id;
-			$this->demand_reason_id      = $object->demand_reason_id;
+			$this->demand_reason_id     = $object->demand_reason_id;
 			$this->date_livraison       = $object->date_livraison;
 			$this->fk_delivery_address  = $object->fk_delivery_address;
 			$this->contact_id           = $object->contactid;
@@ -917,6 +917,7 @@ class Commande extends CommonObject
 				// Hook of thirdparty module
 				if (is_object($hookmanager))
 				{
+					$parameters=array('objFrom'=>$object);
 					$reshook=$hookmanager->executeHooks('createfrom',$parameters,$this,$action);    // Note that $action and $object may have been modified by some hooks
 					if ($reshook < 0) $error++;
 				}
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 8c7f4f050cea46719b37c7073ddc7bd55cc105c4..056c0902784fa1eb5e6424292527459c53996378 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -21,7 +21,7 @@
  *	\file       htdocs/core/class/html.formfile.class.php
  *  \ingroup    core
  *	\brief      File of class to offer components to list and upload files
- *	\version	$Id: html.formfile.class.php,v 1.54 2011/08/10 22:47:34 eldy Exp $
+ *	\version	$Id: html.formfile.class.php,v 1.55 2011/08/11 07:41:41 hregis Exp $
  */
 
 
@@ -451,7 +451,7 @@ class FormFile
 			$out.= '</tr>';
 
 			// Execute hooks
-			$parameters=array('socid'=>$GLOBALS['socid'],'id'=>$GLOBAL['id']);
+			$parameters=array('socid'=>$GLOBALS['socid'],'id'=>$GLOBALS['id']);
 			if (is_object($hookmanager)) $out.= $hookmanager->executeHooks('formBuilddocOptions',$parameters);
 		}
 
diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php
index ff8a26ec7d4cfe288e217cef8f674b5972da73a0..9bb5d3d1b251d21a8f04c45e7bf6995df04d38d4 100644
--- a/htdocs/core/tpl/predefinedproductline_create.tpl.php
+++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php
@@ -15,7 +15,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/>.
  *
- * $Id: predefinedproductline_create.tpl.php,v 1.16 2011/08/10 22:47:33 eldy Exp $
+ * $Id: predefinedproductline_create.tpl.php,v 1.17 2011/08/11 07:41:41 hregis Exp $
  *
  * Need to have following variables defined:
  * $conf
@@ -61,7 +61,7 @@
 
 	if (is_object($hookmanager))
 	{
-        $parameters=array();
+        $parameters=array('fk_parent_line'=>$_POST["fk_parent_line"]);
 	    $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
 	}
 
diff --git a/htdocs/core/tpl/predefinedproductline_edit.tpl.php b/htdocs/core/tpl/predefinedproductline_edit.tpl.php
index d7c839bda436e2231b95197b34d9bf40c26d23eb..1a21911041a669015f98c212062fff68e517bdc0 100644
--- a/htdocs/core/tpl/predefinedproductline_edit.tpl.php
+++ b/htdocs/core/tpl/predefinedproductline_edit.tpl.php
@@ -15,7 +15,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/>.
  *
- * $Id: predefinedproductline_edit.tpl.php,v 1.18 2011/08/11 01:36:53 eldy Exp $
+ * $Id: predefinedproductline_edit.tpl.php,v 1.19 2011/08/11 07:41:41 hregis Exp $
  *
  * Need to have following variables defined:
  * $conf
@@ -49,16 +49,18 @@
 
 		if (is_object($hookmanager))
 		{
-		    $parameters=array('fk_parent_line'=>$line_fk_parent_line);
+		    $fk_parent_line = ($_POST["fk_parent_line"] ? $_POST["fk_parent_line"] : $line->fk_parent_line);
+			$parameters=array('fk_parent_line'=>$fk_parent_line);
 		    $hookmanager->executeHooks('formEditProductOptions',$parameters,$object,$action);
-
-		    // editeur wysiwyg
-		    $nbrows=ROWS_2;
-		    if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
-		    require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
-		    $doleditor=new DolEditor('desc',$line->description,'',164,'dolibarr_details','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
-		    $doleditor->Create();
-		    ?></td>
+		}
+		
+		// editeur wysiwyg
+		$nbrows=ROWS_2;
+		if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
+		require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
+		$doleditor=new DolEditor('desc',$line->description,'',164,'dolibarr_details','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
+		$doleditor->Create();
+		?></td>
 
 	<td align="right"><?php echo $html->load_tva('tva_tx',$line->tva_tx,$seller,$buyer,'',$line->info_bits); ?></td>
 
@@ -82,7 +84,7 @@
 		value="<?php echo $langs->trans("Cancel"); ?>"></td>
 </tr>
 
-		    <?php if ($conf->service->enabled && $dateSelector && $line->product_type == 1)	{ ?>
+<?php if ($conf->service->enabled && $dateSelector && $line->product_type == 1)	{ ?>
 <tr <?php echo $bc[$var]; ?>>
 	<td colspan="9"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
 	<?php
@@ -91,5 +93,5 @@
 	echo $html->select_date($line->date_end,'date_end',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$line->date_end?0:1,"updateligne");
 	?></td>
 </tr>
-	<?php } ?></form>
-<!-- END PHP TEMPLATE predefinedproductline_edit.tpl.php -->
+<?php } ?></form>
+<!-- END PHP TEMPLATE predefinedproductline_edit.tpl.php -->
\ No newline at end of file