New: Uniformize hooks.

This commit is contained in:
Laurent Destailleur 2013-03-27 14:24:33 +01:00
parent a22d39adfb
commit 6c1bbd3aeb

View File

@ -1177,7 +1177,8 @@ if ($action == 'create')
if (1==2 && ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE))
{
print '<tr class="liste_titre">';
print '<td>&nbsp;</td><td>'.$langs->trans('Label').'</td>';
print '<td>&nbsp;</td>';
print '<td>'.$langs->trans('Label').'</td>';
print '<td align="right">'.$langs->trans('PriceUHT').'</td>';
print '<td align="right">'.$langs->trans('VAT').'</td>';
print '<td align="right">'.$langs->trans('Qty').'</td>';
@ -1201,7 +1202,7 @@ if ($action == 'create')
}
// Other options
$parameters=array();
$parameters=array('colspan' => ' colspan="6"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
// Bouton "Create Draft"
@ -1571,7 +1572,7 @@ else
}
// Other options
$parameters=array('colspan' => ' colspan="3"');
$parameters=array('colspan' => ' colspan="4"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print '</table>';
@ -1736,6 +1737,12 @@ else
// Show range
print_date_range($date_start,$date_end);
}
if (is_object($hookmanager))
{
$parameters=array('fk_parent_line'=>$line->fk_parent_line, 'line'=>$object->lines[$i],'var'=>$var,'num'=>$num,'i'=>$i);
$reshook=$hookmanager->executeHooks('formViewProductSupplierOptions',$parameters,$object,$action);
}
print '</td>';
// VAT
@ -1808,7 +1815,7 @@ else
if (is_object($hookmanager))
{
$parameters=array();
$reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
$reshook=$hookmanager->executeHooks('formCreateSupplierProductOptions',$parameters,$object,$action);
}
// Editor wysiwyg