Skip to content
Snippets Groups Projects
Commit 81ab37ca authored by Jared Hancock's avatar Jared Hancock
Browse files

forms: Add all forms to the filter subsystem

parent 7044ac71
No related branches found
No related tags found
No related merge requests found
......@@ -368,6 +368,24 @@ Signal::connect('model.updated',
function($o, $d) { return isset($d['dirty'])
&& (isset($d['dirty']['name']) || isset($d['dirty']['type'])); });
Filter::addSupportedMatches(/* trans */ 'Custom Forms', function() {
$matches = array();
foreach (DynamicForm::objects()->filter(array('type'=>'G')) as $form) {
foreach ($form->getFields() as $f) {
if (!$f->hasData())
continue;
$matches['field.'.$f->get('id')] = $form->getTitle().' / '.$f->getLabel();
if (($fi = $f->getImpl()) instanceof SelectionField) {
foreach ($fi->getList()->getProperties() as $p) {
$matches['field.'.$f->get('id').'.'.$p->get('id')]
= $form->getTitle().' / '.$f->getLabel().' / '.$p->getLabel();
}
}
}
}
return $matches;
}, 9900);
require_once(INCLUDE_DIR . "class.json.php");
class DynamicFormField extends VerySimpleModel {
......
......@@ -2299,6 +2299,16 @@ class Ticket {
}
}
if ($vars['topicId']) {
if (($__topic=Topic::lookup($vars['topicId']))
&& $__form = $__topic->getForm()
) {
$__form = $__form->instanciate();
$__form->setSource($vars);
$vars += $__form->getFilterData();
}
}
//Init ticket filters...
$ticket_filter = new TicketFilter($origin, $vars);
// Make sure email contents should not be rejected
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment