diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 88cce17f223..7709f285be4 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2011 Remy Younes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,6 +38,11 @@ $langs->load("companies"); if (!$user->admin) accessforbidden(); +// 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('dict')); + $acts[0] = "activate"; $acts[1] = "disable"; //$actl[0] = $langs->trans("Activate"); @@ -663,8 +669,12 @@ if ($_GET["id"]) } } + $action = 'add'; + $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$_GET["id"]]); + $reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters, $obj, $action); // Note that $action and $object may have been modified by some hooks + $error=$hookmanager->error; $errors=$hookmanager->errors; - fieldList($fieldlist,$obj); + if (empty($reshook)) fieldList($fieldlist,$obj); print ''; print ""; @@ -746,7 +756,12 @@ if ($_GET["id"]) print ''; print ''; print ''; - fieldList($fieldlist,$obj); + $action = 'edit'; + $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$_GET["id"]]); + $reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $action); // Note that $action and $object may have been modified by some hooks + $error=$hookmanager->error; $errors=$hookmanager->errors; + + if (empty($reshook)) fieldList($fieldlist,$obj); print ' '; print ' '; }