diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php
index f9c7fe6467c..1cd676fe70b 100644
--- a/htdocs/core/class/notify.class.php
+++ b/htdocs/core/class/notify.class.php
@@ -277,11 +277,14 @@ class Notify
* Check if notification are active for couple action/company.
* If yes, send mail and save trace into llx_notify.
*
- * @param string $notifcode Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage)
- * @param Object $object Object the notification deals on
- * @return int <0 if KO, or number of changes if OK
+ * @param string $notifcode Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage)
+ * @param Object $object Object the notification deals on
+ * @param array $filename_list List of files to attach (full path of filename on file system)
+ * @param array $mimetype_list List of MIME type of attached files
+ * @param array $mimefilename_list List of attached file name in message
+ * @return int <0 if KO, or number of changes if OK
*/
- function send($notifcode, $object)
+ function send($notifcode, $object, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array())
{
global $user,$conf,$langs,$mysoc;
global $hookmanager;
@@ -310,8 +313,6 @@ class Notify
$application = 'Dolibarr';
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $application = $conf->global->MAIN_APPLICATION_TITLE;
$replyto = $conf->notification->email_from;
- $filename = basename($file);
- $mimefile = dol_mimetype($file);
$object_type = '';
$link = '';
$num = 0;
@@ -462,7 +463,7 @@ class Notify
$message.= $mesg;
if ($link) $message.= "\n" . $urlwithroot . $link;
- $parameters=array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$file, 'mimefile'=>$mimefile, 'filename'=>$filename);
+ $parameters=array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$filename_list, 'mimefile'=>$mimetype_list, 'filename'=>$mimefilename_list);
$reshook=$hookmanager->executeHooks('formatNotificationMessage',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
@@ -475,9 +476,9 @@ class Notify
$sendto,
$replyto,
$message,
- array($file),
- array($mimefile),
- array($filename[count($filename)-1]),
+ $filename_list,
+ $mimetype_list,
+ $mimefilename_list,
'',
'',
0,
@@ -671,7 +672,7 @@ class Notify
if ($sendto)
{
- $parameters=array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$file, 'mimefile'=>$mimefile, 'filename'=>$filename);
+ $parameters=array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$filename_list, 'mimefile'=>$mimetype_list, 'filename'=>$mimefilename_list);
$reshook=$hookmanager->executeHooks('formatNotificationMessage',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
@@ -683,9 +684,9 @@ class Notify
$sendto,
$replyto,
$message,
- array($file),
- array($mimefile),
- array($filename[count($filename)-1]),
+ $filename_list,
+ $mimetype_list,
+ $mimefilename_list,
'',
'',
0,
diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang
index 1249849ef0b..fa34b7f49ae 100644
--- a/htdocs/langs/en_US/exports.lang
+++ b/htdocs/langs/en_US/exports.lang
@@ -68,7 +68,7 @@ FieldsTarget=Targeted fields
FieldTarget=Targeted field
FieldSource=Source field
NbOfSourceLines=Number of lines in source file
-NowClickToTestTheImport=Check the CSV format (field and string delimiters) of your file matches the options shown and that you have omitted the header line, or these will be flagged as errors in the following simulation.
Click on the "%s" button to run a check of the file structure/contents and simulate the import process.
No data will be changed in your database.
+NowClickToTestTheImport=Check the import setup you defined (check if you must omit the header lines, or these will be flagged as errors in the following simulation).
Click on the "%s" button to run a check of the file structure/contents and simulate the import process.
No data will be changed in your database.
RunSimulateImportFile=Run Import Simulation
FieldNeedSource=This field requires data from the source file
SomeMandatoryFieldHaveNoSource=Some mandatory fields have no source from data file
diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php
index 336c5ce2e32..be53253ee24 100644
--- a/htdocs/product/stock/replenish.php
+++ b/htdocs/product/stock/replenish.php
@@ -42,6 +42,9 @@ if ($user->societe_id) {
}
$result=restrictedArea($user,'produit|service');
+// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
+$hookmanager->initHooks(array('stockreplenishlist'));
+
//checks if a product has been ordered
$action = GETPOST('action','alpha');
@@ -86,6 +89,9 @@ if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
$usevirtualstock=0;
if ($mode == 'virtual') $usevirtualstock=1;
+$parameters=array();
+$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
+if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
/*
* Actions
@@ -669,6 +675,11 @@ while ($i < ($limit ? min($num, $limit) : $num))
}
$i++;
}
+
+$parameters=array('sql'=>$sql);
+$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+
print '';
print '';