Add custom event handler to be triggered by some actions affecting tickets/quotes/invoices/contacts

This commit is contained in:
wrongecho
2024-10-02 11:26:13 +01:00
parent c352f6e3cb
commit 1c404b9cf1
12 changed files with 161 additions and 17 deletions

View File

@@ -1304,6 +1304,7 @@ function enforceUserPermission($module, $check_access_level = 1) {
}
}
// TODO: Probably remove this
function enforceAdminPermission() {
global $session_is_admin;
if (!isset($session_is_admin) || !$session_is_admin) {
@@ -1311,3 +1312,10 @@ function enforceAdminPermission() {
}
return true;
}
function customAction($trigger, $entity) {
chdir(dirname(__FILE__));
if (file_exists(__DIR__ . "/xcustom/xcustom_action_handler.php")) {
include_once __DIR__ . "/xcustom/xcustom_action_handler.php";
}
}