NEW add hookmanager on note pages

This commit is contained in:
fr69400 2021-07-09 18:36:21 +02:00
parent 1a63a379cc
commit e45d5c1d0d
31 changed files with 232 additions and 41 deletions

View File

@ -68,15 +68,20 @@ if ($id) {
$caneditfieldmember = $user->rights->adherent->creer;
}
$hookmanager->initHooks(array('membernote'));
// Security check
$result = restrictedArea($user, 'adherent', $object->id, '', '', 'socid', 'rowid', 0);
/*
* Actions
*/
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once

View File

@ -70,8 +70,12 @@ $permissionnote = 1;
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*
* View

View File

@ -70,7 +70,12 @@ restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -52,6 +52,10 @@ if ($user->socid > 0) {
$socid = $user->socid;
$object->id = $user->socid;
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('propalnote'));
restrictedArea($user, 'propal', $object->id, 'propal');
@ -61,7 +65,12 @@ restrictedArea($user, 'propal', $object->id, 'propal');
$permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once

View File

@ -91,6 +91,10 @@ $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($con
if (!empty($user->socid)) {
$socid = $user->socid;
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('ordercard', 'globalcard'));
$result = restrictedArea($user, 'commande', $id);
$object = new Commande($db);
@ -102,9 +106,6 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('ordercard', 'globalcard'));
$usercanread = $user->rights->commande->lire;
$usercancreate = $user->rights->commande->creer;
$usercandelete = $user->rights->commande->supprimer;

View File

@ -45,6 +45,10 @@ $socid = 0;
if ($user->socid) {
$socid = $user->socid;
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('ordernote'));
$result = restrictedArea($user, 'commande', $id, '');
@ -61,7 +65,12 @@ $permissionnote = $user->rights->commande->creer; // Used by the include of acti
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -54,6 +54,8 @@ $socid = 0;
if ($user->socid) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('invoicenote'));
$result = restrictedArea($user, 'facture', $id, '');
@ -61,7 +63,12 @@ $result = restrictedArea($user, 'facture', $id, '');
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once

View File

@ -49,13 +49,19 @@ if ($id > 0) {
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contactcard'));
// $hookmanager->initHooks(array('contactcard')); -> Name conflict with product/card.php
$hookmanager->initHooks(array('contactnote'));
/*
* Actions
*/
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
/*

View File

@ -44,6 +44,10 @@ $ref = GETPOST('ref', 'alpha');
if ($user->socid) {
$socid = $user->socid;
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
//$hookmanager->initHooks(array('contractcard', 'globalcard')); -> Conflict with contrat\card.php
$hookmanager->initHooks(array('contractnote'));
$result = restrictedArea($user, 'contrat', $id);
$object = new Contrat($db);
@ -51,16 +55,17 @@ $object->fetch($id, $ref);
$permissionnote = $user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contractcard', 'globalcard'));
/*
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once

View File

@ -47,6 +47,8 @@ $socid = 0;
if ($user->socid) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('donnote'));
$result = restrictedArea($user, 'don', $id, '');
$object = new Don($db);
@ -58,7 +60,12 @@ $permissionnote = $user->rights->don->creer; // Used by the include of actions_s
/*
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
if ($action == 'classin' && $user->rights->don->creer) {
$object->fetch($id);

View File

@ -115,8 +115,12 @@ $permissiontoadd = $user->rights->eventorganization->conferenceorboothattendee->
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*
* View

View File

@ -69,6 +69,8 @@ $permissionnote = $user->rights->expedition->creer; // Used by the include of ac
if ($user->socid) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('expeditionnote'));
$result = restrictedArea($user, 'expedition', $object->id, '');
@ -76,7 +78,12 @@ $result = restrictedArea($user, 'expedition', $object->id, '');
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -44,6 +44,8 @@ $socid = 0;
if ($user->socid) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('expensereportnote'));
$result = restrictedArea($user, 'expensereport', $id, 'expensereport');
@ -68,12 +70,16 @@ if ($object->id > 0) {
}
}
/*
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -42,6 +42,7 @@ $action = GETPOST('action', 'aZ09');
if ($user->socid) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('fichinternote'));
$result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
$object = new Fichinter($db);
@ -53,7 +54,12 @@ $permissionnote = $user->rights->ficheinter->creer; // Used by the include of ac
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -43,13 +43,13 @@ $action = GETPOST('action', 'aZ09');
if ($user->socid) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('ordersuppliercardnote'));
$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande');
$object = new CommandeFournisseur($db);
$object->fetch($id, $ref);
$hookmanager->initHooks(array('ordersuppliercardnote'));
$permissionnote = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); // Used by the include of actions_setnotes.inc.php
@ -57,7 +57,12 @@ $permissionnote = ($user->rights->fournisseur->commande->creer || $user->rights-
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -44,6 +44,9 @@ $action = GETPOST('action', 'aZ09');
if ($user->socid) {
$socid = $user->socid;
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('invoicesuppliernote'));
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$object = new FactureFournisseur($db);
@ -56,7 +59,12 @@ $permissionnote = ($user->rights->fournisseur->facture->creer || $user->rights->
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
// Set label
if ($action == 'setlabel' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) {

View File

@ -66,7 +66,12 @@ $permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write; /
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -41,6 +41,8 @@ $langs->loadLangs(array("loan"));
// Security check
$id = GETPOST('id', 'int');
$hookmanager->initHooks(array('loannote'));
$result = restrictedArea($user, 'loan', $id, '&loan');
$object = new Loan($db);
@ -55,7 +57,13 @@ $permissionnote = $user->rights->loan->write; // Used by the include of actions_
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -117,7 +117,12 @@ $permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the incl
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -68,7 +68,13 @@ $permissionnote = $user->rights->mrp->write; // Used by the include of actions_s
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -65,8 +65,12 @@ $permissiontoadd = $user->rights->partnership->write; // Used by the include of
/*
* Actions
*/
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -63,11 +63,18 @@ if ($object->id > 0) {
}
$hookmanager->initHooks(array('productnote'));
/*
* Actions
*/
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
/*

View File

@ -46,6 +46,7 @@ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($ob
// Security check
$socid = 0;
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$hookmanager->initHooks(array('projetnote'));
$result = restrictedArea($user, 'projet', $id, 'projet&project');
$permissionnote = $user->rights->projet->creer; // Used by the include of actions_setnotes.inc.php
@ -55,7 +56,12 @@ $permissionnote = $user->rights->projet->creer; // Used by the include of action
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -44,6 +44,9 @@ $socid = 0;
if (!$user->rights->projet->lire) {
accessforbidden();
}
$hookmanager->initHooks(array('projettasknote'));
//$result = restrictedArea($user, 'projet', $id, '', 'task'); // TODO ameliorer la verification
$object = new Task($db);
@ -89,7 +92,12 @@ $permissionnote = ($user->rights->projet->creer || $user->rights->projet->all->c
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php';
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -67,6 +67,11 @@ $permissionnote = $user->rights->reception->creer; // Used by the include of act
if ($user->socid > 0) {
$socid = $user->socid;
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('receptionnote'));
if ($origin == 'reception') {
$result = restrictedArea($user, $origin, $object->id);
} else {
@ -87,7 +92,12 @@ if ($origin == 'reception') {
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -94,7 +94,12 @@ $result = restrictedArea($user, 'recruitment', $object->id, 'recruitment_recruit
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -99,7 +99,12 @@ $result = restrictedArea($user, 'recruitment', $object->id, 'recruitment_recruit
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -40,6 +40,9 @@ $action = GETPOST('action', 'aZ09');
if ($user->socid) {
$socid = $user->socid;
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('resourcenote'));
$result = restrictedArea($user, 'resource', $id, 'resource');
$object = new DolResource($db);
@ -52,7 +55,12 @@ $permissionnote = $user->rights->resource->write; // Used by the include of acti
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -56,6 +56,12 @@ $result = restrictedArea($user, 'societe', $object->id, '&societe');
/*
* Actions
*/
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once

View File

@ -43,6 +43,11 @@ $action = GETPOST('action', 'aZ09');
if ($user->socid) {
$socid = $user->socid;
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('supplier_proposalnote'));
$result = restrictedArea($user, 'supplier_proposal', $id, 'supplier_proposal');
$object = new SupplierProposal($db);
@ -55,7 +60,12 @@ $object = new SupplierProposal($db);
$permissionnote = $user->rights->supplier_proposal->creer; // Used by the include of actions_setnotes.inc.php
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*

View File

@ -68,8 +68,12 @@ restrictedArea($user, $object->element, $object->id, $object->table_element, 'wo
/*
* Actions
*/
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
/*