FIX Hook resprint be printed

This commit is contained in:
Florian HENRY 2016-04-12 11:35:39 +02:00
parent fabeb37b65
commit 872c99afe9

View File

@ -32,7 +32,7 @@
$usemargins=0; $usemargins=0;
if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande')))
{ {
$usemargins=1; $usemargins=1;
} }
@ -193,11 +193,17 @@ else {
{ {
$parameters=array('fk_parent_line'=>GETPOST('fk_parent_line','int')); $parameters=array('fk_parent_line'=>GETPOST('fk_parent_line','int'));
$reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
if (!empty($hookmanager->resPrint)) {
print $hookmanager->resPrint;
}
} }
if (is_object($hookmanager) && ! empty($senderissupplier)) if (is_object($hookmanager) && ! empty($senderissupplier))
{ {
$parameters=array('htmlname'=>'addproduct'); $parameters=array('htmlname'=>'addproduct');
$reshook=$hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action); $reshook=$hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action);
if (!empty($hookmanager->resPrint)) {
print $hookmanager->resPrint;
}
} }
@ -476,7 +482,7 @@ jQuery(document).ready(function() {
$("#select_type").change(function() $("#select_type").change(function()
{ {
setforfree(); setforfree();
if (jQuery('#select_type').val() >= 0) if (jQuery('#select_type').val() >= 0)
{ {
/* focus work on a standard textarea but not if field was replaced with CKEDITOR */ /* focus work on a standard textarea but not if field was replaced with CKEDITOR */
jQuery('#dp_desc').focus(); jQuery('#dp_desc').focus();
@ -582,7 +588,7 @@ jQuery(document).ready(function() {
<?php } ?> <?php } ?>
/* To set focus */ /* To set focus */
if (jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val() > 0) if (jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val() > 0)
{ {
/* focus work on a standard textarea but not if field was replaced with CKEDITOR */ /* focus work on a standard textarea but not if field was replaced with CKEDITOR */
jQuery('#dp_desc').focus(); jQuery('#dp_desc').focus();