Merge pull request #1041 from FHenry/develop
Add hook into referent product screen
This commit is contained in:
commit
bf2fa31585
@ -41,6 +41,9 @@ $fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
|||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('productstatsorder'));
|
||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
@ -64,6 +67,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
$result = $product->fetch($id, $ref);
|
$result = $product->fetch($id, $ref);
|
||||||
|
|
||||||
|
$parameters=array('id'=>$id);
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
||||||
|
|
||||||
@ -76,6 +83,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$titre=$langs->trans("CardProduct".$product->type);
|
$titre=$langs->trans("CardProduct".$product->type);
|
||||||
$picto=($product->type==1?'service':'product');
|
$picto=($product->type==1?'service':'product');
|
||||||
dol_fiche_head($head, 'referers', $titre, 0, $picto);
|
dol_fiche_head($head, 'referers', $titre, 0, $picto);
|
||||||
|
|
||||||
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|||||||
@ -41,6 +41,9 @@ $fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
|||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('productstatssupplyorder'));
|
||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
@ -64,6 +67,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
$result = $product->fetch($id, $ref);
|
$result = $product->fetch($id, $ref);
|
||||||
|
|
||||||
|
$parameters=array('id'=>$id);
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
||||||
|
|
||||||
@ -73,6 +80,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$titre=$langs->trans("CardProduct".$product->type);
|
$titre=$langs->trans("CardProduct".$product->type);
|
||||||
$picto=($product->type==1?'service':'product');
|
$picto=($product->type==1?'service':'product');
|
||||||
dol_fiche_head($head, 'referers', $titre, 0, $picto);
|
dol_fiche_head($head, 'referers', $titre, 0, $picto);
|
||||||
|
|
||||||
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
|||||||
@ -41,6 +41,9 @@ $fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
|||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('productstatscontract'));
|
||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
@ -67,6 +70,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
$result = $product->fetch($id, $ref);
|
$result = $product->fetch($id, $ref);
|
||||||
|
|
||||||
|
$parameters=array('id'=>$id);
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
||||||
|
|
||||||
@ -76,6 +83,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$titre=$langs->trans("CardProduct".$product->type);
|
$titre=$langs->trans("CardProduct".$product->type);
|
||||||
$picto=($product->type==1?'service':'product');
|
$picto=($product->type==1?'service':'product');
|
||||||
dol_fiche_head($head, 'referers', $titre, 0, $picto);
|
dol_fiche_head($head, 'referers', $titre, 0, $picto);
|
||||||
|
|
||||||
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,9 @@ $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
|
|||||||
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
||||||
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('productstatsinvoice'));
|
||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
@ -69,6 +72,9 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
$result = $product->fetch($id, $ref);
|
$result = $product->fetch($id, $ref);
|
||||||
|
|
||||||
|
$parameters=array('id'=>$id);
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
||||||
|
|
||||||
@ -81,6 +87,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$titre=$langs->trans("CardProduct".$product->type);
|
$titre=$langs->trans("CardProduct".$product->type);
|
||||||
$picto=($product->type==1?'service':'product');
|
$picto=($product->type==1?'service':'product');
|
||||||
dol_fiche_head($head, 'referers', $titre, 0, $picto);
|
dol_fiche_head($head, 'referers', $titre, 0, $picto);
|
||||||
|
|
||||||
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,9 @@ $fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
|||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('productstatssupplyinvoice'));
|
||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
@ -55,6 +58,7 @@ if (! $sortorder) $sortorder="DESC";
|
|||||||
if (! $sortfield) $sortfield="f.datef";
|
if (! $sortfield) $sortfield="f.datef";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -67,6 +71,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
$result = $product->fetch($id, $ref);
|
$result = $product->fetch($id, $ref);
|
||||||
|
|
||||||
|
$parameters=array('id'=>$id);
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
||||||
|
|
||||||
@ -79,6 +87,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$titre=$langs->trans("CardProduct".$product->type);
|
$titre=$langs->trans("CardProduct".$product->type);
|
||||||
$picto=($product->type==1?'service':'product');
|
$picto=($product->type==1?'service':'product');
|
||||||
dol_fiche_head($head, 'referers', $titre, 0, $picto);
|
dol_fiche_head($head, 'referers', $titre, 0, $picto);
|
||||||
|
|
||||||
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|||||||
@ -41,6 +41,9 @@ $fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
|||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('productstatspropal'));
|
||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
@ -63,6 +66,9 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
$result = $product->fetch($id, $ref);
|
$result = $product->fetch($id, $ref);
|
||||||
|
|
||||||
|
$parameters=array('id'=>$id);
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
llxHeader("","",$langs->trans("CardProduct".$product->type));
|
||||||
|
|
||||||
@ -72,6 +78,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$titre=$langs->trans("CardProduct".$product->type);
|
$titre=$langs->trans("CardProduct".$product->type);
|
||||||
$picto=($product->type==1?'service':'product');
|
$picto=($product->type==1?'service':'product');
|
||||||
dol_fiche_head($head, 'referers', $titre,0,$picto);
|
dol_fiche_head($head, 'referers', $titre,0,$picto);
|
||||||
|
|
||||||
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$product,$action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user