N°2875 - Invert TriggerOnObjectMention approach

- Trigger is now positioned on a specific "host" class (eg. Ticket)
- Trigger now has a "mentioned objects" filter which determines the scope of mentioned objects which will activate the trigger
This commit is contained in:
Molkobain
2021-10-19 11:59:52 +02:00
parent df49e9c3b5
commit 8f2b5ad8e2
4 changed files with 98 additions and 16 deletions

View File

@@ -11,6 +11,7 @@ use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
use Combodo\iTop\Application\UI\Base\UIBlock;
use DBObject;
use MetaModel;
use utils;
/**
* Class CaseLogEntryForm
@@ -203,6 +204,17 @@ class CaseLogEntryForm extends UIContentBlock
protected function InitTextInput()
{
$this->oTextInput = new RichText();
// Add the "host_class" to the mention endpoints so it can filter objects regarding the triggers
$aConfig = $this->oTextInput->GetConfig();
if (isset($aConfig['mentions'])) {
foreach ($aConfig['mentions'] as $iIdx => $aData) {
$sFeed = $aConfig['mentions'][$iIdx]['feed'];
$aConfig['mentions'][$iIdx]['feed'] = utils::AddParameterToUrl($sFeed, 'host_class', $this->GetObjectClass());
}
}
$this->oTextInput->SetConfig($aConfig);
return $this;
}