NEW Execute the doAction hook on other ticket pages (#29701)

* Update document.php

* Update contact.php
This commit is contained in:
Zephyriony 2024-05-16 17:32:59 +02:00 committed by GitHub
parent 6b0c96a293
commit 404d21a402
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -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);

View File

@ -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) {