add hook for select produit

This commit is contained in:
FHenry 2012-02-29 14:32:22 +01:00
parent e2cea80f69
commit 59f424bde3
3 changed files with 35 additions and 1 deletions

View File

@ -59,6 +59,11 @@ $projectid = GETPOST("projectid");
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'commande_fournisseur', $id,'');
// 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('fournordercard'));
$mesg='';
$object = new CommandeFournisseur($db);
@ -1318,6 +1323,12 @@ if ($id > 0 || ! empty($ref))
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>';
if (is_object($hookmanager))
{
$parameters=array('filtre'=>$filtre);
echo $hookmanager->executeHooks('formCreateProductFournOptions',$parameters,$object,$action);
}
// Editor wysiwyg
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$nbrows=ROWS_2;

View File

@ -50,6 +50,11 @@ $confirm = GETPOST("confirm");
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
// 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('fournpricecard'));
$object=new FactureFournisseur($db);
@ -1645,6 +1650,13 @@ else
print '<tr '.$bc[$var].'>';
print '<td colspan="4">';
$form->select_produits_fournisseurs($object->socid,'','idprodfournprice','',$filtre);
if (is_object($hookmanager))
{
$parameters=array('filtre'=>$filtre);
echo $hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action);
}
print '</td>';
print '<td align="right"><input type="text" name="qty" value="1" size="1"></td>';
print '<td>&nbsp;</td>';

View File

@ -53,6 +53,11 @@ $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'produit|service&fournisseur',$fieldvalue,'product&product','','',$fieldtype);
// 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('fournpricecard'));
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@ -273,7 +278,13 @@ if ($id || $ref)
}
else
{
print $form->select_company($_POST["id_fourn"],'id_fourn','fournisseur=1',1);
print $form->select_company(GETPOST("id_fourn"),'id_fourn','fournisseur=1',1);
if (is_object($hookmanager))
{
$parameters=array('filtre'=>"fournisseur=1",'html_name'=>'id_fourn','selected'=>GETPOST("id_fourn"),'showempty'=>1,'prod_id'=>$product->id);
echo $hookmanager->executeHooks('formCreateCompagnyOptions',$parameters,$object,$action);
}
}
print '</td></tr>';