add hooks for object options

This commit is contained in:
Regis Houssin 2011-08-23 15:23:19 +00:00
parent 8762051f89
commit 68a9994b62
4 changed files with 37 additions and 9 deletions

View File

@ -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 '</td>';
print '</tr>';
}
// Insert hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print "</table>";
print '<br>';
@ -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 $');
?>

View File

@ -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 '</tr>';
}
// 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 '<tr><td height="10">'.$langs->trans('AmountHT').'</td>';
@ -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 $');
?>

View File

@ -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 '</td></tr>';
}
// Insert hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print '<tr><td>'.$langs->trans('Model').'</td>';
print '<td colspan="2">';
@ -1745,7 +1749,6 @@ else
//print '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=22&origin=order&originid='.$object->id.'">'.$langs->trans("DictionnarySource").'</a>';
print '</td></tr>';
// Project
if ($conf->projet->enabled)
{
@ -1768,6 +1771,10 @@ else
}
print '</td></tr>';
}
// 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 $');
?>

View File

@ -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 '</td></tr>';
}
// 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 '<tr><td>'.$langs->trans('Model').'</td>';
@ -2540,6 +2544,10 @@ else
print '</td>';
print '</tr>';
}
// 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 '</table><br>';
@ -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 $');
?>