mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
NEW Execute the doAction hook on other ticket pages (#29701)
* Update document.php * Update contact.php
This commit is contained in:
parent
6b0c96a293
commit
404d21a402
|
|
@ -60,6 +60,7 @@ $lineid = GETPOSTINT('lineid');
|
|||
// Store current page url
|
||||
$url_page_current = DOL_URL_ROOT.'/ticket/contact.php';
|
||||
|
||||
$hookmanager->initHooks(array('contactticketcard', 'globalcard'));
|
||||
$object = new Ticket($db);
|
||||
|
||||
// Security check
|
||||
|
|
@ -84,6 +85,11 @@ $permissiontoadd = $user->hasRight('ticket', 'write');
|
|||
/*
|
||||
* Actions
|
||||
*/
|
||||
$parameters = array();
|
||||
$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');
|
||||
}
|
||||
|
||||
if ($action == 'addcontact' && $user->hasRight('ticket', 'write')) {
|
||||
$result = $object->fetch($id, '', $track_id);
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ if (!$sortfield) {
|
|||
$sortfield = "position_name";
|
||||
}
|
||||
|
||||
$hookmanager->initHooks(array('documentticketcard', 'globalcard'));
|
||||
$object = new Ticket($db);
|
||||
$result = $object->fetch($id, $ref, $track_id);
|
||||
|
||||
|
|
@ -100,6 +101,12 @@ $permissiontoadd = $user->hasRight('ticket', 'write'); // Used by the include of
|
|||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||
|
||||
$parameters = array();
|
||||
$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 parent company
|
||||
if ($action == 'set_thirdparty' && $user->hasRight('ticket', 'write')) {
|
||||
if ($object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha')) >= 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user