Hooks 'printLeftBlock' and 'formConfirm' are now compliant with hook

development rules. They are "addreplace" hooks, so you must return
content with"->resprints='mycontent'" and not with "return 'mycontent'"
This commit is contained in:
Laurent Destailleur 2015-03-18 14:31:37 +01:00
parent 2c61717e10
commit cd2fc2f890
8 changed files with 36 additions and 28 deletions

View File

@ -31,8 +31,8 @@ WARNING: Following changes may create regression for some external modules, but
Dolibarr better: Dolibarr better:
- Removed hoo supplierorderdao into supplier order creation. This is a business event, so we must use the - Removed hoo supplierorderdao into supplier order creation. This is a business event, so we must use the
trigger ORDER_SUPPLIER_CREATE instead. trigger ORDER_SUPPLIER_CREATE instead.
- printLeftBlock is now compliant with hook development rules. It is an "addreplace" hook so you must - Hooks 'printLeftBlock' and 'formConfirm' are now compliant with hook development rules. They are
return content by doing ->resprints='mycontent' and not by doing return 'mycontent' "addreplace" hooks, so you must return content with "->resprints='mycontent'" and not with "return 'mycontent'"
***** ChangeLog for 3.7 compared to 3.6.* ***** ***** ChangeLog for 3.7 compared to 3.6.* *****

View File

@ -1346,9 +1346,9 @@ if ($action == 'create')
if (! $formconfirm) { if (! $formconfirm) {
$parameters = array('lineid' => $lineid); $parameters = array('lineid' => $lineid);
$formconfirm = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
// by if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
// hook elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm

View File

@ -1680,9 +1680,9 @@ if ($action == 'create')
if (! $formconfirm) { if (! $formconfirm) {
$parameters = array('lineid' => $lineid); $parameters = array('lineid' => $lineid);
$formconfirm = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
// by if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
// hook elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm

View File

@ -1726,8 +1726,9 @@ if ($action == 'create' && $user->rights->commande->creer)
if (! $formconfirm) { if (! $formconfirm) {
$parameters = array('lineid' => $lineid); $parameters = array('lineid' => $lineid);
$formconfirm = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
// by hook if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm

View File

@ -2749,8 +2749,9 @@ if ($action == 'create')
if (! $formconfirm) { if (! $formconfirm) {
$parameters = array('lineid' => $lineid); $parameters = array('lineid' => $lineid);
$formconfirm = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
// hook if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm

View File

@ -1210,7 +1210,9 @@ else if ($id > 0 || ! empty($ref))
if (!$formconfirm) if (!$formconfirm)
{ {
$parameters=array('lineid'=>$lineid); $parameters=array('lineid'=>$lineid);
$formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm

View File

@ -1733,7 +1733,9 @@ elseif (! empty($object->id))
if (!$formconfirm) { if (!$formconfirm) {
$parameters=array('lineid'=>$lineid); $parameters=array('lineid'=>$lineid);
$formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm

View File

@ -1716,7 +1716,9 @@ else
if (!$formconfirm) { if (!$formconfirm) {
$parameters=array('lineid'=>$lineid); $parameters=array('lineid'=>$lineid);
$formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm