From 68a9994b62ace569e91bd815bfa7d14ea26e045f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 23 Aug 2011 15:23:19 +0000 Subject: [PATCH] add hooks for object options --- htdocs/comm/addpropal.php | 13 +++++++++++-- htdocs/comm/propal.php | 8 ++++++-- htdocs/commande/fiche.php | 13 ++++++++++--- htdocs/compta/facture.php | 12 ++++++++++-- 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index a48a0d33abb..49723d6c738 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -23,7 +23,7 @@ * \file htdocs/comm/addpropal.php * \ingroup propal * \brief Page to add a new commercial proposal - * \version $Id: addpropal.php,v 1.132 2011/08/13 00:47:59 eldy Exp $ + * \version $Id: addpropal.php,v 1.133 2011/08/23 15:23:19 hregis Exp $ */ require("../main.inc.php"); @@ -42,6 +42,11 @@ $langs->load("bills"); $langs->load("orders"); $langs->load("deliveries"); +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); +$hookmanager=new HookManager($db); +$hookmanager->callHooks(array('propalcard')); + /* * Actions */ @@ -232,6 +237,10 @@ if ($_GET["action"] == 'create') print ''; print ''; } + + // Insert hooks + $parameters=array(); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook print ""; print '
'; @@ -335,5 +344,5 @@ if ($_GET["action"] == 'create') $db->close(); -llxFooter('$Date: 2011/08/13 00:47:59 $ - $Revision: 1.132 $'); +llxFooter('$Date: 2011/08/23 15:23:19 $ - $Revision: 1.133 $'); ?> diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 58d4498e10d..3af718dbe66 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -26,7 +26,7 @@ * \file htdocs/comm/propal.php * \ingroup propale * \brief Page of commercial proposals card and list - * \version $Id: propal.php,v 1.621 2011/08/12 21:29:47 eldy Exp $ + * \version $Id: propal.php,v 1.622 2011/08/23 15:23:19 hregis Exp $ */ require("../main.inc.php"); @@ -1399,6 +1399,10 @@ if ($id > 0 || ! empty($ref)) } print ''; } + + // Insert hooks + $parameters=array('colspan'=>'colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook // Amount HT print ''.$langs->trans('AmountHT').''; @@ -1932,6 +1936,6 @@ else } $db->close(); -llxFooter('$Date: 2011/08/12 21:29:47 $ - $Revision: 1.621 $'); +llxFooter('$Date: 2011/08/23 15:23:19 $ - $Revision: 1.622 $'); ?> diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 56ccb0822dd..ca7c07e48b3 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -25,7 +25,7 @@ * \file htdocs/commande/fiche.php * \ingroup commande * \brief Page to show customer order - * \version $Id: fiche.php,v 1.535 2011/08/12 05:41:02 hregis Exp $ + * \version $Id: fiche.php,v 1.536 2011/08/23 15:23:19 hregis Exp $ */ require("../main.inc.php"); @@ -1277,6 +1277,10 @@ if ($action == 'create' && $user->rights->commande->creer) } print ''; } + + // Insert hooks + $parameters=array(); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook print ''.$langs->trans('Model').''; print ''; @@ -1745,7 +1749,6 @@ else //print ''.$langs->trans("DictionnarySource").''; print ''; - // Project if ($conf->projet->enabled) { @@ -1768,6 +1771,10 @@ else } print ''; } + + // Insert hooks + $parameters=array('colspan'=>'colspan="2"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook // Lignes de 3 colonnes @@ -2070,5 +2077,5 @@ else $db->close(); -llxFooter('$Date: 2011/08/12 05:41:02 $ - $Revision: 1.535 $'); +llxFooter('$Date: 2011/08/23 15:23:19 $ - $Revision: 1.536 $'); ?> diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index be1791c2464..45aa8252935 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -25,7 +25,7 @@ * \file htdocs/compta/facture.php * \ingroup facture * \brief Page to create/see an invoice - * \version $Id: facture.php,v 1.855 2011/08/11 15:14:50 hregis Exp $ + * \version $Id: facture.php,v 1.856 2011/08/23 15:23:19 hregis Exp $ */ require('../main.inc.php'); @@ -1690,6 +1690,10 @@ if ($action == 'create') select_projects($soc->id, $projectid, 'projectid'); print ''; } + + // Insert hooks + $parameters=array(); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook // Modele PDF print ''.$langs->trans('Model').''; @@ -2540,6 +2544,10 @@ else print ''; print ''; } + + // Insert hooks + $parameters=array('colspan'=>'colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook print '
'; @@ -3185,5 +3193,5 @@ else $db->close(); -llxFooter('$Date: 2011/08/11 15:14:50 $ - $Revision: 1.855 $'); +llxFooter('$Date: 2011/08/23 15:23:19 $ - $Revision: 1.856 $'); ?>