NEW Hook on stock product card
This commit is contained in:
parent
359ebed882
commit
f8912267cb
@ -63,12 +63,43 @@ if ($user->societe_id) $socid=$user->societe_id;
|
|||||||
$result=restrictedArea($user,'produit&stock',$id,'product&product','','',$fieldid);
|
$result=restrictedArea($user,'produit&stock',$id,'product&product','','',$fieldid);
|
||||||
|
|
||||||
|
|
||||||
|
$object = new Product($db);
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
|
// fetch optionals attributes and labels
|
||||||
|
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
if ($id > 0 || ! empty($ref))
|
||||||
|
{
|
||||||
|
$result = $object->fetch($id, $ref);
|
||||||
|
|
||||||
|
}
|
||||||
|
$modulepart='product';
|
||||||
|
|
||||||
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
|
$canvas = !empty($object->canvas)?$object->canvas:GETPOST("canvas");
|
||||||
|
$objcanvas=null;
|
||||||
|
if (! empty($canvas))
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
||||||
|
$objcanvas = new Canvas($db,$action);
|
||||||
|
$objcanvas->getCanvas('stockproduct','card',$canvas);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('stockproductcard','globalcard'));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($cancel) $action='';
|
if ($cancel) $action='';
|
||||||
|
|
||||||
|
$parameters=array('id'=>$id, 'ref'=>$ref, 'objcanvas'=>$objcanvas);
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
// Set stock limit
|
// Set stock limit
|
||||||
if ($action == 'setseuil_stock_alerte')
|
if ($action == 'setseuil_stock_alerte')
|
||||||
{
|
{
|
||||||
@ -664,6 +695,11 @@ else
|
|||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
$parameters=array();
|
||||||
|
|
||||||
|
$reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
|
|
||||||
if (empty($action) && $object->id)
|
if (empty($action) && $object->id)
|
||||||
{
|
{
|
||||||
@ -683,7 +719,7 @@ if (empty($action) && $object->id)
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user