diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 02082dc40ca..f8e2bf4b496 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -1598,7 +1598,7 @@ if ($id > 0 || ! empty($ref))
$var=true;
- $somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'',0,'',$soc->default_lang);
+ $somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'',0,'',$soc->default_lang,$object->hooks);
/*
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index d74e92c288e..c5e689294e0 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -143,9 +143,10 @@ class FormFile
* @param title Title to show on top of form
* @param buttonlabel Label on submit button
* @param codelang Default language code to use on lang combo box if multilang is enabled
+ * @param hooks Object hook of external modules
* @return int <0 if KO, number of shown files if OK
*/
- function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='')
+ function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$hooks='')
{
// filedir = conf->...dir_ouput."/".get_exdir(id)
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
@@ -358,6 +359,15 @@ class FormFile
print ' ';
}
print '';
+
+ // Hook of thirdparty module
+ if (! empty($hooks) && is_array($hooks))
+ {
+ foreach($hooks as $module)
+ {
+ $module->formBuilddocOptions();
+ }
+ }
// Button
print '
';
@@ -374,6 +384,15 @@ class FormFile
print ' | ';
print '';
+
+ // Hook of thirdparty module
+ if (! empty($hooks) && is_array($hooks))
+ {
+ foreach($hooks as $module)
+ {
+ $module->formBuilddocOptions();
+ }
+ }
}
// Get list of files
diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php
index ce9b81cdece..4832836a62a 100644
--- a/htdocs/core/tpl/freeproductline_create.tpl.php
+++ b/htdocs/core/tpl/freeproductline_create.tpl.php
@@ -50,7 +50,7 @@
if (! empty($object->hooks)) {
foreach($object->hooks as $module) {
- $module->formAddProductOption($object);
+ $module->formCreateProductOptions($object);
}
}
diff --git a/htdocs/core/tpl/freeproductline_edit.tpl.php b/htdocs/core/tpl/freeproductline_edit.tpl.php
index 3247c21d6c9..b3052d42f21 100644
--- a/htdocs/core/tpl/freeproductline_edit.tpl.php
+++ b/htdocs/core/tpl/freeproductline_edit.tpl.php
@@ -42,7 +42,7 @@
hooks)) {
foreach($this->hooks as $module) {
- $module->formAddProductOption($this,$line->fk_parent_line);
+ $module->formEditProductOptions($this,$line->fk_parent_line);
echo '
';
}
}
diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php
index bf54d561413..e83dd3309d2 100644
--- a/htdocs/core/tpl/predefinedproductline_create.tpl.php
+++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php
@@ -62,7 +62,7 @@
if (! empty($object->hooks)) {
foreach($object->hooks as $module) {
- $module->formAddProductOption($object);
+ $module->formCreateProductOptions($object);
}
}
diff --git a/htdocs/core/tpl/predefinedproductline_edit.tpl.php b/htdocs/core/tpl/predefinedproductline_edit.tpl.php
index 509ac4a108d..58768013c97 100644
--- a/htdocs/core/tpl/predefinedproductline_edit.tpl.php
+++ b/htdocs/core/tpl/predefinedproductline_edit.tpl.php
@@ -50,7 +50,7 @@
if (! empty($this->hooks)) {
foreach($this->hooks as $module) {
- $module->formAddProductOption($this,$line->fk_parent_line);
+ $module->formEditProductOptions($this,$line->fk_parent_line);
echo '
';
}
}